diff --git a/lib/crewai/src/crewai/cli/constants.py b/lib/crewai/src/crewai/cli/constants.py index a3755b1a6..2e137504d 100644 --- a/lib/crewai/src/crewai/cli/constants.py +++ b/lib/crewai/src/crewai/cli/constants.py @@ -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", diff --git a/lib/crewai/tests/cli/test_constants.py b/lib/crewai/tests/cli/test_constants.py index 013d8ff8c..76bdc2c94 100644 --- a/lib/crewai/tests/cli/test_constants.py +++ b/lib/crewai/tests/cli/test_constants.py @@ -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"