feat: add custom_metadata to OpenAIModel to unify /v1/models with /v1/openai/v1/models

Goal is to consolidate model listing endpoints. This is step 1: adding custom_metadata
field to OpenAIModel that includes model_type, provider_id, provider_resource_id, and
all model metadata from the native /v1/models response.

Next steps: update stainless client to use /v1/openai/v1/models, migrate tests to read
from custom_metadata, then remove /v1/openai/v1/ prefix entirely.
This commit is contained in:
Ashwin Bharambe 2025-11-03 15:11:58 -08:00
parent 415fd9e36b
commit 3af73b754a
3 changed files with 16 additions and 0 deletions

View file

@ -90,12 +90,14 @@ class OpenAIModel(BaseModel):
:object: The object type, which will be "model"
:created: The Unix timestamp in seconds when the model was created
:owned_by: The owner of the model
:custom_metadata: Llama Stack-specific metadata including model_type, provider info, and additional metadata
"""
id: str
object: Literal["model"] = "model"
created: int
owned_by: str
custom_metadata: dict[str, Any] | None = None
class OpenAIListModelsResponse(BaseModel):