Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
feat: set frequency penalty to 1 for gpt-4o (#3962)
cthomasa6528b41d7d7
diff --git a/letta/agents/helpers.py b/letta/agents/helpers.pyindex 422574363..7f0011768 100644--- a/letta/agents/helpers.py+++ b/letta/agents/helpers.py@@ -222,6 +222,7 @@ def _safe_load_tool_call_str(tool_call_args_str: str) -> dict:# Load it again - this is due to sometimes Anthropic returning weird json @carentool_args = json.loads(tool_args)except json.JSONDecodeError:+ logger.error("Failed to JSON decode tool call argument string: %s", tool_call_args_str)tool_args = {}return tool_argsdiff --git a/letta/schemas/providers/openai.py b/letta/schemas/providers/openai.pyindex c01a95427..c38102558 100644--- a/letta/schemas/providers/openai.py+++ b/letta/schemas/providers/openai.py@@ -142,7 +142,7 @@ class OpenAIProvider(Provider):"""This function is used to tune LLMConfig parameters to improve model performance."""# gpt-4o-mini has started to regress with pretty bad emoji spam loops (2025-07)- if "gpt-4o-mini" in model_name or "gpt-4.1-mini" in model_name:+ if "gpt-4o" in model_name or "gpt-4.1-mini" in model_name:llm_config.frequency_penalty = 1.0return llm_config