Implementation:Groq Groq python Model Type
| Knowledge Sources | |
|---|---|
| Domains | Model_Management, Type_System |
| Last Updated | 2026-02-15 16:00 GMT |
Overview
Concrete tool for representing AI model metadata in API responses provided by the Groq Python SDK's type system.
Description
The Model class is a Pydantic BaseModel representing an AI model available through the Groq API. It contains the model's identifier, creation timestamp, object type marker, and owning organization. This type is returned by client.models.retrieve() and as elements within client.models.list().
Usage
Access this type from response objects returned by the models API. The id field is used to specify which model to use in inference requests (chat completions, embeddings, transcriptions, etc.).
Code Reference
Source Location
- Repository: Groq Python SDK
- File: src/groq/types/model.py
- Lines: 1-23
Signature
class Model(BaseModel):
"""Describes an OpenAI 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"."""
owned_by: str
"""The organization that owns the model."""
Import
from groq.types import Model
I/O Contract
Fields
| Name | Type | Required | Description |
|---|---|---|---|
| id | str | Yes | Model identifier (e.g. "llama-3.3-70b-versatile") |
| created | int | Yes | Unix timestamp (seconds) of model creation |
| object | Literal["model"] | Yes | Object type, always "model" |
| owned_by | str | Yes | Organization that owns the model |
Usage Examples
Listing and Inspecting Models
from groq import Groq
client = Groq()
# List all models and access Model type fields
response = client.models.list()
for model in response.data:
print(f"ID: {model.id}")
print(f"Created: {model.created}")
print(f"Owner: {model.owned_by}")
print()
# Retrieve a specific model
model = client.models.retrieve("llama-3.3-70b-versatile")
print(model.to_json())