Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions pydantic_ai_slim/pydantic_ai/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,29 @@
'cohere:command-r7b-12-2024',
'deepseek:deepseek-chat',
'deepseek:deepseek-reasoner',
'gateway/anthropic:claude-haiku-4-5',
'gateway/anthropic:claude-opus-4-0',
'gateway/anthropic:claude-sonnet-4-5',
'gateway/bedrock:anthropic.claude-haiku-4-5-20251001-v1:0',
'gateway/bedrock:anthropic.claude-opus-4-20250514-v1:0',
'gateway/bedrock:anthropic.claude-sonnet-4-5-20250929-v1:0',
'gateway/bedrock:us.amazon.nova-lite-v1:0',
'gateway/bedrock:us.amazon.nova-micro-v1:0',
'gateway/bedrock:us.amazon.nova-pro-v1:0',
'gateway/google-vertex:gemini-2.5-flash',
'gateway/google-vertex:gemini-2.5-flash-lite',
'gateway/google-vertex:gemini-2.5-pro',
'gateway/google-vertex:gemini-3-pro-preview',
'gateway/groq:deepseek-r1-distill-llama-70b',
'gateway/groq:gemma2-9b-it',
'gateway/groq:llama-3.1-8b-instant',
'gateway/groq:llama-3.3-70b-versatile',
'gateway/groq:qwen-qwq-32b',
'gateway/openai:gpt-5',
'gateway/openai:gpt-5-mini',
'gateway/openai:gpt-5-pro',
'gateway/openai:o3',
'gateway/openai:o4-mini',
'google-gla:gemini-flash-latest',
'google-gla:gemini-flash-lite-latest',
'google-gla:gemini-2.0-flash',
Expand Down
26 changes: 26 additions & 0 deletions tests/models/test_model_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,31 @@ def get_model_names(model_name_type: Any) -> Iterator[str]:
openai_names = [f'openai:{n}' for n in get_model_names(OpenAIModelName)]
bedrock_names = [f'bedrock:{n}' for n in get_model_names(BedrockModelName)]
deepseek_names = ['deepseek:deepseek-chat', 'deepseek:deepseek-reasoner']
gateway_names = [
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize you couldn't see this comment in a private Slack channel, but I responded to Samuel (and he agreed):

Agreed, but if we add just a few per provider, people are definitely gonna ask us “but why not this other one?”, so maybe just include them all?

So we should NOT hard-code this, but dynamically build this based on the known model names of the providers that are known to work with gateway/{provider}

'gateway/anthropic:claude-haiku-4-5',
'gateway/anthropic:claude-opus-4-0',
'gateway/anthropic:claude-sonnet-4-5',
'gateway/bedrock:anthropic.claude-haiku-4-5-20251001-v1:0',
'gateway/bedrock:anthropic.claude-opus-4-20250514-v1:0',
'gateway/bedrock:anthropic.claude-sonnet-4-5-20250929-v1:0',
'gateway/bedrock:us.amazon.nova-lite-v1:0',
'gateway/bedrock:us.amazon.nova-micro-v1:0',
'gateway/bedrock:us.amazon.nova-pro-v1:0',
'gateway/google-vertex:gemini-2.5-flash',
'gateway/google-vertex:gemini-2.5-flash-lite',
'gateway/google-vertex:gemini-2.5-pro',
'gateway/google-vertex:gemini-3-pro-preview',
'gateway/groq:deepseek-r1-distill-llama-70b',
'gateway/groq:gemma2-9b-it',
'gateway/groq:llama-3.1-8b-instant',
'gateway/groq:llama-3.3-70b-versatile',
'gateway/groq:qwen-qwq-32b',
'gateway/openai:gpt-5',
'gateway/openai:gpt-5-mini',
'gateway/openai:gpt-5-pro',
'gateway/openai:o3',
'gateway/openai:o4-mini',
]
huggingface_names = [f'huggingface:{n}' for n in get_model_names(HuggingFaceModelName)]
heroku_names = get_heroku_model_names()
cerebras_names = get_cerebras_model_names()
Expand All @@ -86,6 +111,7 @@ def get_model_names(model_name_type: Any) -> Iterator[str]:
+ openai_names
+ bedrock_names
+ deepseek_names
+ gateway_names
+ huggingface_names
+ heroku_names
+ cerebras_names
Expand Down
1 change: 1 addition & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def test_list_models(capfd: CaptureFixture[str]):
'mistral',
'cohere',
'deepseek',
'gateway/',
'heroku',
'moonshotai',
'grok',
Expand Down
Loading