# Models ## Retrieve `models.retrieve(strmodel) -> ModelRetrieveResponse` **get** `/models/{model}` Retrieves a model instance, providing basic information about the model such as the owner and permissioning. ### Parameters - **model:** `str` ### Returns - `class ModelRetrieveResponse` Describes a model offering that can be used with the API. - **id:** `str` The model identifier, which can be referenced in the API endpoints. - **created:** `int` The Unix timestamp (in seconds) when the model was created. - **object:** `Literal["model"]` The object type, which is always "model". - `"model"` - **owned\_by:** `str` The organization that owns the model. ### Example ```python from do_gradientai import GradientAI client = GradientAI( api_key="My API Key", ) model = client.models.retrieve( "llama3-8b-instruct", ) print(model.id) ``` ## List `models.list() -> ModelListResponse` **get** `/models` Lists the currently available models, and provides basic information about each one such as the owner and availability. ### Returns - `class ModelListResponse` - **data:** `List[Data]` - **id:** `str` The model identifier, which can be referenced in the API endpoints. - **created:** `int` The Unix timestamp (in seconds) when the model was created. - **object:** `Literal["model"]` The object type, which is always "model". - `"model"` - **owned\_by:** `str` The organization that owns the model. - **object:** `Literal["list"]` - `"list"` ### Example ```python from do_gradientai import GradientAI client = GradientAI( api_key="My API Key", ) models = client.models.list() print(models.data) ``` ## Domain Types ### API Agreement - `class APIAgreement` Agreement Description - **description:** `Optional[str]` - **name:** `Optional[str]` - **url:** `Optional[str]` - **uuid:** `Optional[str]` ### API Model - `class APIModel` A machine learning model stored on the GenAI platform - **agreement:** `Optional[APIAgreement]` Agreement Description - **created\_at:** `Optional[datetime]` Creation date / time - **is\_foundational:** `Optional[bool]` True if it is a foundational model provided by do - **name:** `Optional[str]` Name of the model - **parent\_uuid:** `Optional[str]` Unique id of the model, this model is based on - **updated\_at:** `Optional[datetime]` Last modified - **upload\_complete:** `Optional[bool]` Model has been fully uploaded - **url:** `Optional[str]` Download url - **uuid:** `Optional[str]` Unique id - **version:** `Optional[APIModelVersion]` Version Information about a Model ### API Model Version - `class APIModelVersion` Version Information about a Model - **major:** `Optional[int]` Major version number - **minor:** `Optional[int]` Minor version number - **patch:** `Optional[int]` Patch version number