Skip to content

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.

fix(llm): correct gpt-4o-mini context window 200000 -> 128000 (#7294)

Shxiao7fe8317fc4a4
diff --git a/lib/crewai/src/crewai/llm.py b/lib/crewai/src/crewai/llm.py
index c2924e542..e6604805d 100644
--- a/lib/crewai/src/crewai/llm.py
+++ b/lib/crewai/src/crewai/llm.py
@@ -170,7 +170,7 @@ ANTHROPIC_PREFIXES: Final[tuple[str, str, str]] = ("anthropic/", "claude-", "cla
LLM_CONTEXT_WINDOW_SIZES: Final[dict[str, int]] = {
"gpt-4": 8192,
"gpt-4o": 128000,
- "gpt-4o-mini": 200000,
+ "gpt-4o-mini": 128000,
"gpt-5.4-mini": 200000,
"gpt-5.6": 1050000, # sol, terra, luna, and the gpt-5.6 alias
"gpt-4-turbo": 128000,
diff --git a/lib/crewai/src/crewai/llms/providers/azure/completion.py b/lib/crewai/src/crewai/llms/providers/azure/completion.py
index 8cdb49cca..eecc1a059 100644
--- a/lib/crewai/src/crewai/llms/providers/azure/completion.py
+++ b/lib/crewai/src/crewai/llms/providers/azure/completion.py
@@ -1320,7 +1320,7 @@ class AzureCompletion(BaseLLM):
"gpt-3.5-turbo": 16385,
"gpt-5.4-mini": 200000,
"gpt-35-turbo": 16385,
- "gpt-4o-mini": 200000,
+ "gpt-4o-mini": 128000,
"gpt-4-turbo": 128000,
"gpt-5.6": 1050000,
"gpt-4o": 128000,
diff --git a/lib/crewai/src/crewai/llms/providers/openai/completion.py b/lib/crewai/src/crewai/llms/providers/openai/completion.py
index 20234e501..280c314ea 100644
--- a/lib/crewai/src/crewai/llms/providers/openai/completion.py
+++ b/lib/crewai/src/crewai/llms/providers/openai/completion.py
@@ -2682,7 +2682,7 @@ class OpenAICompletion(BaseLLM):
"gpt-4.1-nano-2025-04-14": 1047576,
"gpt-5.4-mini": 200000,
"gpt-4-turbo": 128000,
- "gpt-4o-mini": 200000,
+ "gpt-4o-mini": 128000,
"gpt-5-mini": 1047576,
"gpt-5-nano": 1047576,
"o1-preview": 128000,