Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: add effort dropdown for claude 4.5 opus (backend) (#6351)

Ari Webbce2ca8660b36
diff --git a/letta/schemas/llm_config.py b/letta/schemas/llm_config.py
index 937c3931c..cd9d867f3 100644
--- a/letta/schemas/llm_config.py
+++ b/letta/schemas/llm_config.py
@@ -441,6 +441,9 @@ class LLMConfig(BaseModel):
config.put_inner_thoughts_in_kwargs = False
if config.enable_reasoner and config.max_reasoning_tokens == 0:
config.max_reasoning_tokens = 1024
+ # Set default effort level for Claude Opus 4.5
+ if config.model.startswith("claude-opus-4-5") and config.effort is None:
+ config.effort = "medium"
return config
# Google Gemini 2.5 Pro and Gemini 3: not possible to disable
@@ -495,6 +498,9 @@ class LLMConfig(BaseModel):
config.put_inner_thoughts_in_kwargs = False
if config.max_reasoning_tokens == 0:
config.max_reasoning_tokens = 1024
+ # Set default effort level for Claude Opus 4.5
+ if config.model.startswith("claude-opus-4-5") and config.effort is None:
+ config.effort = "medium"
elif cls.is_google_vertex_reasoning_model(config) or cls.is_google_ai_reasoning_model(config):
# Handle as non-reasoner until we support summary
config.put_inner_thoughts_in_kwargs = True
diff --git a/letta/schemas/model.py b/letta/schemas/model.py
index ba2d92b11..2d02e4f70 100644
--- a/letta/schemas/model.py
+++ b/letta/schemas/model.py
@@ -112,6 +112,7 @@ class Model(LLMConfig, ModelBase):
enable_reasoner=llm_config.enable_reasoner,
reasoning_effort=llm_config.reasoning_effort,
max_reasoning_tokens=llm_config.max_reasoning_tokens,
+ effort=llm_config.effort,
frequency_penalty=llm_config.frequency_penalty,
compatibility_type=llm_config.compatibility_type,
verbosity=llm_config.verbosity,
diff --git a/tests/managers/test_agent_manager.py b/tests/managers/test_agent_manager.py
index d463673be..6361e4066 100644
--- a/tests/managers/test_agent_manager.py
+++ b/tests/managers/test_agent_manager.py
@@ -1541,6 +1541,7 @@ async def test_agent_state_schema_unchanged(server: SyncServer):
"max_tokens",
"enable_reasoner",
"reasoning_effort",
+ "effort",
"max_reasoning_tokens",
"frequency_penalty",
"compatibility_type",