Skip to content
Closed
Changes from all 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
10 changes: 6 additions & 4 deletions mem0/llms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def _is_reasoning_model(self, model: str) -> bool:
bool: True if the model is a reasoning model or GPT-5 series
"""
reasoning_models = {
"o1", "o1-preview", "o3-mini", "o3",
"o1", "o1-preview", "o3", "o3-mini", "o4", "o4-mini",
"gpt-5", "gpt-5o", "gpt-5o-mini", "gpt-5o-micro",
}

Expand All @@ -62,9 +62,11 @@ def _is_reasoning_model(self, model: str) -> bool:
if base_model in reasoning_models:
return True

# Match o1/o3 family with prefixes (o1-2024-12-17, o3-2025-04-16)
# but NOT gpt-5.x variants (gpt-5.4-mini supports temperature)
if any(base_model.startswith(prefix) for prefix in ["o1-", "o1.", "o3-", "o3."]):
# Match dated Azure/OpenAI subversions:
# o1-2024-12-17, o3-2025-04-16, o4-mini-2025-04-16
# gpt-5-2025-06-15, gpt-5.4-2025-07-15, gpt-5.4-mini-2025-07-15
reasoning_prefixes = ("o1-", "o1.", "o3-", "o3.", "o4-", "o4.", "gpt-5-", "gpt-5.")
if any(base_model.startswith(prefix) for prefix in reasoning_prefixes):
return True

return False
Expand Down
Loading