model_versions
Model Versions module.
model_versions module
Model Versions module.
class CreateCompatibilities
Bases: TypedDict
Compatibility flags for creating a version.
openai_chat_completions : NotRequired[bool]
Represents whether this version supports the OpenAI compatible chat completions endpoint.
openai_embeddings : NotRequired[bool]
Represents whether this version supports the OpenAI compatible embeddings endpoint.
openai_images_generations : NotRequired[bool]
Represents whether this version supports the OpenAI compatible image generation endpoint.
openai_responses : NotRequired[bool]
Represents whether this version supports the OpenAI compatible responses endpoint.
anthropic_messages : NotRequired[bool]
Represents whether this version supports the Anthropic compatible messages endpoint.
class CreateModelVersionParams
Bases: TypedDict
Parameters for creating a version of a model.
release_notes : str
Information about changes such as new features, bug fixes, or optimizations in this model version.
schemas : Schemas
Schemas for the model version.
container_image_digest : str
SHA256 hash digest of the model version’s container image.
compatibilities : NotRequired[CreateCompatibilities]
Compatibility flags for different API endpoints supported by the version.
class ModelVersions(api)
Bases: Resource
Initializes the Resource with an API instance.
- Parameters: api (API) – An instance of the API class.
get(identifier)
Get a model version.
- Parameters: identifier (str) – The model version identifier in owner/name:version-number format (for example: deepseek-ai/deepseek-r1:1).
- Returns: The model version.
- Return type: ModelVersionWithDetails
async async_get(identifier)
Get a model version.
- Parameters: identifier (str) – The model version identifier in owner/name:version-number format (for example: deepseek-ai/deepseek-r1:1).
- Returns: The model version.
- Return type: ModelVersionWithDetails
list(identifier, pagination_options=None)
List model versions.
- Parameters:
- identifier (str) – The model identifier in owner/name format (for example: deepseek-ai/deepseek-r1).
- pagination_options (PaginationOptions | None) – Optional settings to control pagination behavior.
- Returns: Paginated response containing model versions and navigation metadata.
- Return type: PaginatedResponse[ModelVersion]
async async_list(identifier, pagination_options=None)
List model versions.
- Parameters:
- identifier (str) – The model identifier in owner/name format (for example: deepseek-ai/deepseek-r1).
- pagination_options (PaginationOptions | None) – Optional settings to control pagination behavior.
- Returns: Paginated response containing model versions and navigation metadata.
- Return type: PaginatedResponse[ModelVersion]
delete(identifier)
Delete a model version.
- Parameters: identifier (str) – The model version identifier in owner/name:version-number format (for example: deepseek-ai/deepseek-r1:1).
- Return type: None
async async_delete(identifier)
Delete a model version.
- Parameters: identifier (str) – The model version identifier in owner/name:version-number format (for example: deepseek-ai/deepseek-r1:1).
- Return type: None
create(identifier, options)
Create a version of a model.
- Parameters:
- identifier (str) – The model identifier in owner/name format (for example: deepseek-ai/deepseek-r1).
- options (CreateModelVersionParams) – Model’s version creation parameters.
- Returns: The new model version.
- Return type: ModelVersionWithDetails
async async_create(identifier, options)
Create a version of a model.
- Parameters:
- identifier (str) – The model identifier in owner/name format (for example: deepseek-ai/deepseek-r1).
- options (CreateModelVersionParams) – Model’s version creation parameters.
- Returns: The new model version.
- Return type: ModelVersionWithDetails