mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-11 13:32:34 +00:00
feat(cli): update model options to include latest models
- Update OpenAI models: add gpt-4-turbo, o1, o3, o3-mini, o4-mini - Update Anthropic models: add claude-sonnet-4-5, claude-3-7-sonnet, claude-3-5-sonnet-20241022, claude-3-5-haiku-20241022 - Update Groq models: add llama-3.3-70b-versatile, llama-3.2 variants, mixtral-8x7b-32768 - Update Ollama models: add llama3.2, llama3.3, deepseek-r1 - Add tests to verify latest models are included for major providers Fixes #4317 Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -129,20 +129,25 @@ PROVIDERS = [
|
||||
|
||||
MODELS = {
|
||||
"openai": [
|
||||
"gpt-4",
|
||||
"gpt-4.1",
|
||||
"gpt-4.1-mini-2025-04-14",
|
||||
"gpt-4.1-nano-2025-04-14",
|
||||
"gpt-4o",
|
||||
"gpt-4o-mini",
|
||||
"gpt-4-turbo",
|
||||
"gpt-4.1",
|
||||
"gpt-4.1-mini",
|
||||
"gpt-4.1-nano",
|
||||
"o1",
|
||||
"o1-mini",
|
||||
"o1-preview",
|
||||
"o3",
|
||||
"o3-mini",
|
||||
"o4-mini",
|
||||
],
|
||||
"anthropic": [
|
||||
"claude-3-5-sonnet-20240620",
|
||||
"claude-3-sonnet-20240229",
|
||||
"claude-sonnet-4-5-20250514",
|
||||
"claude-3-7-sonnet-20250219",
|
||||
"claude-3-5-sonnet-20241022",
|
||||
"claude-3-5-haiku-20241022",
|
||||
"claude-3-opus-20240229",
|
||||
"claude-3-haiku-20240307",
|
||||
],
|
||||
"gemini": [
|
||||
"gemini/gemini-3-pro-preview",
|
||||
@@ -230,13 +235,15 @@ MODELS = {
|
||||
"nvidia_nim/baichuan-inc/baichuan2-13b-chat",
|
||||
],
|
||||
"groq": [
|
||||
"groq/llama-3.3-70b-versatile",
|
||||
"groq/llama-3.3-70b-specdec",
|
||||
"groq/llama-3.1-8b-instant",
|
||||
"groq/llama-3.1-70b-versatile",
|
||||
"groq/llama-3.1-405b-reasoning",
|
||||
"groq/llama-3.2-3b-preview",
|
||||
"groq/llama-3.2-1b-preview",
|
||||
"groq/mixtral-8x7b-32768",
|
||||
"groq/gemma2-9b-it",
|
||||
"groq/gemma-7b-it",
|
||||
],
|
||||
"ollama": ["ollama/llama3.1", "ollama/mixtral"],
|
||||
"ollama": ["ollama/llama3.2", "ollama/llama3.3", "ollama/mixtral", "ollama/deepseek-r1"],
|
||||
"watson": [
|
||||
"watsonx/meta-llama/llama-3-1-70b-instruct",
|
||||
"watsonx/meta-llama/llama-3-1-8b-instruct",
|
||||
|
||||
@@ -18,3 +18,68 @@ def test_huggingface_models():
|
||||
"""Test that Huggingface models are properly configured."""
|
||||
assert "huggingface" in MODELS
|
||||
assert len(MODELS["huggingface"]) > 0
|
||||
|
||||
|
||||
def test_openai_models_include_latest():
|
||||
"""Test that OpenAI models include the latest models."""
|
||||
assert "openai" in MODELS
|
||||
openai_models = MODELS["openai"]
|
||||
assert len(openai_models) > 0
|
||||
assert "gpt-4o" in openai_models
|
||||
assert "gpt-4o-mini" in openai_models
|
||||
assert "o1" in openai_models
|
||||
assert "o3" in openai_models
|
||||
assert "o3-mini" in openai_models
|
||||
|
||||
|
||||
def test_anthropic_models_include_latest():
|
||||
"""Test that Anthropic models include the latest Claude models."""
|
||||
assert "anthropic" in MODELS
|
||||
anthropic_models = MODELS["anthropic"]
|
||||
assert len(anthropic_models) > 0
|
||||
assert "claude-3-7-sonnet-20250219" in anthropic_models
|
||||
assert "claude-3-5-sonnet-20241022" in anthropic_models
|
||||
assert "claude-3-5-haiku-20241022" in anthropic_models
|
||||
|
||||
|
||||
def test_groq_models_include_latest():
|
||||
"""Test that Groq models include the latest Llama models."""
|
||||
assert "groq" in MODELS
|
||||
groq_models = MODELS["groq"]
|
||||
assert len(groq_models) > 0
|
||||
assert "groq/llama-3.3-70b-versatile" in groq_models
|
||||
|
||||
|
||||
def test_ollama_models_include_latest():
|
||||
"""Test that Ollama models include the latest models."""
|
||||
assert "ollama" in MODELS
|
||||
ollama_models = MODELS["ollama"]
|
||||
assert len(ollama_models) > 0
|
||||
assert "ollama/llama3.2" in ollama_models
|
||||
assert "ollama/llama3.3" in ollama_models
|
||||
|
||||
|
||||
def test_all_providers_have_models():
|
||||
"""Test that all providers in PROVIDERS have corresponding models in MODELS."""
|
||||
providers_with_models = [
|
||||
"openai",
|
||||
"anthropic",
|
||||
"gemini",
|
||||
"nvidia_nim",
|
||||
"groq",
|
||||
"ollama",
|
||||
"watson",
|
||||
"bedrock",
|
||||
"huggingface",
|
||||
"sambanova",
|
||||
]
|
||||
for provider in providers_with_models:
|
||||
assert provider in MODELS, f"Provider {provider} should have models defined"
|
||||
assert len(MODELS[provider]) > 0, f"Provider {provider} should have at least one model"
|
||||
|
||||
|
||||
def test_all_providers_have_env_vars_or_defaults():
|
||||
"""Test that all providers have environment variable configurations."""
|
||||
for provider in PROVIDERS:
|
||||
if provider in ENV_VARS:
|
||||
assert len(ENV_VARS[provider]) > 0, f"Provider {provider} should have env var config"
|
||||
|
||||
Reference in New Issue
Block a user