Skip to content

πŸ™Œ OpenHands: AI-Driven Development

[Feat] Support o3 and o4 mini (#7898)

Kenny Dizi85e2b73eb4ea
diff --git a/docs/modules/usage/llms/llms.md b/docs/modules/usage/llms/llms.md
index dacd02afdb..4eb284e496 100644
--- a/docs/modules/usage/llms/llms.md
+++ b/docs/modules/usage/llms/llms.md
@@ -17,6 +17,8 @@ Based on these findings and community feedback, the following models have been v
- [gemini/gemini-2.5-pro](https://blog.google/technology/google-deepmind/gemini-model-thinking-updates-march-2025/)
- [deepseek/deepseek-chat](https://api-docs.deepseek.com/)
- [openai/o3-mini](https://openai.com/index/openai-o3-mini/)
+- [openai/o3](https://openai.com/index/introducing-o3-and-o4-mini/)
+- [openai/o4-mini](https://openai.com/index/introducing-o3-and-o4-mini/)
- [all-hands/openhands-lm-32b-v0.1](https://www.all-hands.dev/blog/introducing-openhands-lm-32b----a-strong-open-coding-agent-model) -- available through [OpenRouter](https://openrouter.ai/all-hands/openhands-lm-32b-v0.1)
diff --git a/frontend/src/utils/verified-models.ts b/frontend/src/utils/verified-models.ts
index 146c1c2a7f..a2fc72ba9a 100644
--- a/frontend/src/utils/verified-models.ts
+++ b/frontend/src/utils/verified-models.ts
@@ -2,6 +2,8 @@
export const VERIFIED_PROVIDERS = ["openai", "azure", "anthropic", "deepseek"];
export const VERIFIED_MODELS = [
"o3-mini-2025-01-31",
+ "o3-2025-04-16",
+ "o4-mini-2025-04-16",
"claude-3-5-sonnet-20241022",
"claude-3-7-sonnet-20250219",
"deepseek-chat",
@@ -17,8 +19,12 @@ export const VERIFIED_OPENAI_MODELS = [
"gpt-4-32k",
"o1-mini",
"o1",
+ "o3",
+ "o3-2025-04-16",
"o3-mini",
"o3-mini-2025-01-31",
+ "o4-mini",
+ "o4-mini-2025-04-16",
];
// LiteLLM does not return the compatible Anthropic models with the provider, so we list them here to set them ourselves
diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py
index 06471e4bc2..29268c226f 100644
--- a/openhands/llm/llm.py
+++ b/openhands/llm/llm.py
@@ -69,6 +69,10 @@ FUNCTION_CALLING_SUPPORTED_MODELS = [
'o1-2024-12-17',
'o3-mini-2025-01-31',
'o3-mini',
+ 'o3',
+ 'o3-2025-04-16',
+ 'o4-mini',
+ 'o4-mini-2025-04-16',
'gemini-2.5-pro',
'gpt-4.1',
]
@@ -76,8 +80,12 @@ FUNCTION_CALLING_SUPPORTED_MODELS = [
REASONING_EFFORT_SUPPORTED_MODELS = [
'o1-2024-12-17',
'o1',
+ 'o3',
+ 'o3-2025-04-16',
'o3-mini-2025-01-31',
'o3-mini',
+ 'o4-mini',
+ 'o4-mini-2025-04-16',
]
MODELS_WITHOUT_STOP_WORDS = [