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 gpt-5.2 support (#6698)

Ari Webb4d90f37f50b8
diff --git a/letta/constants.py b/letta/constants.py
index bc3209340..0014e37d7 100644
--- a/letta/constants.py
+++ b/letta/constants.py
@@ -246,6 +246,11 @@ LLM_MAX_TOKENS = {
"gpt-5.1-codex": 272000,
"gpt-5.1-codex-mini": 272000,
"gpt-5.1-codex-max": 272000,
+ # gpt-5.2
+ "gpt-5.2": 272000,
+ "gpt-5.2-2025-12-11": 272000,
+ "gpt-5.2-pro": 272000,
+ "gpt-5.2-pro-2025-12-11": 272000,
# reasoners
"o1": 200000,
# "o1-pro": 200000, # responses API only
diff --git a/letta/llm_api/openai_client.py b/letta/llm_api/openai_client.py
index 77e80109a..51e89c4e8 100644
--- a/letta/llm_api/openai_client.py
+++ b/letta/llm_api/openai_client.py
@@ -83,9 +83,9 @@ def does_not_support_minimal_reasoning(model: str) -> bool:
def supports_none_reasoning_effort(model: str) -> bool:
"""Check if the model supports 'none' reasoning effort.
- Currently, only GPT-5.1 models support the 'none' reasoning effort level.
+ Currently, GPT-5.1 and GPT-5.2 models support the 'none' reasoning effort level.
"""
- return model.startswith("gpt-5.1")
+ return model.startswith("gpt-5.1") or model.startswith("gpt-5.2")
def is_openai_5_model(model: str) -> bool:
diff --git a/letta/schemas/llm_config.py b/letta/schemas/llm_config.py
index 48afe3b35..465235bf1 100644
--- a/letta/schemas/llm_config.py
+++ b/letta/schemas/llm_config.py
@@ -269,6 +269,17 @@ class LLMConfig(BaseModel):
verbosity="medium",
max_tokens=16384,
)
+ elif model_name == "gpt-5.2":
+ return cls(
+ model="gpt-5.2",
+ model_endpoint_type="openai",
+ model_endpoint="https://api.openai.com/v1",
+ model_wrapper=None,
+ context_window=272000,
+ reasoning_effort="none", # Default to "none" for GPT-5.2
+ verbosity="medium",
+ max_tokens=16384,
+ )
elif model_name == "letta":
return cls(
model="memgpt-openai",
diff --git a/tests/configs/llm_model_configs/openai-gpt-5.2.json b/tests/configs/llm_model_configs/openai-gpt-5.2.json
new file mode 100644
index 000000000..77eef6d4d
--- /dev/null
+++ b/tests/configs/llm_model_configs/openai-gpt-5.2.json
@@ -0,0 +1,8 @@
+{
+ "context_window": 32000,
+ "model": "gpt-5.2",
+ "model_endpoint_type": "openai",
+ "model_endpoint": "https://api.openai.com/v1",
+ "model_wrapper": null,
+ "reasoning_effort": "low"
+}