Skip to content

Commit 5fda204

Browse files
authored
feat: support opus 4.1 and gpt-5 (#3806)
1 parent 3faaec1 commit 5fda204

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

letta/llm_api/anthropic.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@
5555
# https://docs.anthropic.com/claude/docs/models-overview
5656
# Sadly hardcoded
5757
MODEL_LIST = [
58+
## Opus 4.1
59+
{
60+
"name": "claude-opus-4-1-20250805",
61+
"context_window": 200000,
62+
},
5863
## Opus 3
5964
{
6065
"name": "claude-3-opus-20240229",

letta/llm_api/openai_client.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ def is_openai_reasoning_model(model: str) -> bool:
4949
return is_reasoning
5050

5151

52+
def is_openai_5_model(model: str) -> bool:
53+
"""Utility function to check if the model is a '5' model"""
54+
return model.startswith("gpt-5")
55+
56+
5257
def accepts_developer_role(model: str) -> bool:
5358
"""Checks if the model accepts the 'developer' role. Note that not all reasoning models accept this role.
5459
@@ -65,7 +70,7 @@ def supports_temperature_param(model: str) -> bool:
6570
6671
Example error: 400 - {'error': {'message': "Unsupported parameter: 'temperature' is not supported with this model.", 'type': 'invalid_request_error', 'param': 'temperature', 'code': 'unsupported_parameter'}}
6772
"""
68-
if is_openai_reasoning_model(model):
73+
if is_openai_reasoning_model(model) or is_openai_5_model(model):
6974
return False
7075
else:
7176
return True

letta/schemas/providers/openai.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
logger = get_logger(__name__)
1313

14-
ALLOWED_PREFIXES = {"gpt-4", "o1", "o3", "o4"}
14+
ALLOWED_PREFIXES = {"gpt-4", "gpt-5", "o1", "o3", "o4"}
1515
DISALLOWED_KEYWORDS = {"transcribe", "search", "realtime", "tts", "audio", "computer", "o1-mini", "o1-preview", "o1-pro"}
1616
DEFAULT_EMBEDDING_BATCH_SIZE = 1024
1717

0 commit comments

Comments
 (0)