11from dataclasses import dataclass
2- from typing import Literal
32
43from dataclasses_json import dataclass_json
54
6- INSTANCE_TYPES_ENDPOINT = '/instance-types'
5+ from verda . constants import Currency
76
8- Currency = Literal [ 'usd' , 'eur' ]
7+ INSTANCE_TYPES_ENDPOINT = '/instance-types'
98
109
1110@dataclass_json
@@ -24,6 +23,17 @@ class InstanceType:
2423 memory: Instance type memory details.
2524 gpu_memory: Instance type GPU memory details.
2625 storage: Instance type storage details.
26+ best_for: Suggested use cases for the instance type.
27+ model: GPU model.
28+ name: Human-readable instance type name.
29+ p2p: Peer-to-peer interconnect bandwidth details.
30+ currency: Currency used for pricing.
31+ manufacturer: Hardware manufacturer.
32+ display_name: Display name shown to users.
33+ supported_os: Supported operating system images.
34+ deploy_warning: Optional deployment warning returned by the API.
35+ serverless_price: Optional serverless price for the same hardware profile.
36+ serverless_spot_price: Optional serverless spot price for the same hardware profile.
2737 """
2838
2939 id : str
@@ -45,8 +55,6 @@ class InstanceType:
4555 display_name : str
4656 supported_os : list [str ]
4757 deploy_warning : str | None = None
48- dynamic_price : float | None = None
49- max_dynamic_price : float | None = None
5058 serverless_price : float | None = None
5159 serverless_spot_price : float | None = None
5260
@@ -88,16 +96,6 @@ def get(self, currency: Currency = 'usd') -> list[InstanceType]:
8896 display_name = instance_type ['display_name' ],
8997 supported_os = instance_type ['supported_os' ],
9098 deploy_warning = instance_type .get ('deploy_warning' ),
91- dynamic_price = (
92- float (instance_type ['dynamic_price' ])
93- if instance_type .get ('dynamic_price' ) is not None
94- else None
95- ),
96- max_dynamic_price = (
97- float (instance_type ['max_dynamic_price' ])
98- if instance_type .get ('max_dynamic_price' ) is not None
99- else None
100- ),
10199 serverless_price = (
102100 float (instance_type ['serverless_price' ])
103101 if instance_type .get ('serverless_price' ) is not None
@@ -113,7 +111,3 @@ def get(self, currency: Currency = 'usd') -> list[InstanceType]:
113111 ]
114112
115113 return instance_type_objects
116-
117- def get_price_history (self ):
118- """Get the deprecated dynamic price history endpoint as raw JSON."""
119- return self ._http_client .get (f'{ INSTANCE_TYPES_ENDPOINT } /price-history' ).json ()
0 commit comments