Light Logo
Python SDK (v0.31.1)Reference

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 ModelVersionConfiguration

Bases: TypedDict

Configuration for the model version.

hardware_identifier : str

The identifier of the hardware used by the model version.

variable_keys : list[str]

A list of variable keys for the model version.

class UpdateModelVersionConfigurationParams

Bases: TypedDict

Parameters for updating the configuration of a model version.

hardware_identifier : NotRequired[str]

The identifier of the hardware used by the model version.

variable_keys : NotRequired[list[str]]

The new list of variable keys to attach to the model version. Replaces all current variable keys.

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.

configuration : NotRequired[ModelVersionConfiguration]

Configuration for the model version. Omit to inherit configuration from the previous version.

class ModelVersionWithDetailsAndConfiguration

Bases: ModelVersionWithDetails

Represents a model version with it’s details and configuration.

configuration : ModelVersionConfiguration

Configuration for the model version.

number : int

release_notes : str

created_at : str

container_image_digest : str

schemas : Schemas

compatibilities : Compatibilities

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.

async async_create(identifier, options)

Create a version of a model.

update_configuration(identifier, params)

Update the configuration of a model version.

  • Parameters:
    • identifier (str) – The model version identifier in owner/name:version-number format (for example: deepseek-ai/deepseek-r1:1).
    • params (UpdateModelVersionConfigurationParams) – The new configuration for the model version.
  • Returns: The updated model version configuration.
  • Return type: ModelVersionConfiguration

async async_update_configuration(identifier, params)

Update the configuration of a model version.

  • Parameters:
    • identifier (str) – The model version identifier in owner/name:version-number format (for example: deepseek-ai/deepseek-r1:1).
    • params (UpdateModelVersionConfigurationParams) – The new configuration for the model version.
  • Returns: The updated model version configuration.
  • Return type: ModelVersionConfiguration

get_configuration(identifier)

Get the configuration of 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 configuration.
  • Return type: ModelVersionConfiguration

async async_get_configuration(identifier)

Get the configuration of 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 configuration.
  • Return type: ModelVersionConfiguration