From cb2db18b1f2f4901458cd987eb7271eeef3e3013 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 18 Jan 2026 22:15:48 -0800 Subject: [PATCH] fix: add Claude Haiku 4.5 model to MODEL_LIST and add defensive prefix stripping (#8908) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added `claude-haiku-4-5-20251001` and `claude-haiku-4-5-latest` to MODEL_LIST in anthropic.py to fix context window lookup for the newly released model - Added prefix stripping in anthropic_client.py to handle cases where the model name incorrectly includes the `anthropic/` provider prefix Fixes the production error: anthropic.NotFoundError: Error code: 404 - model: anthropic/claude-haiku-4-5-20251001 Fixes #8907 🤖 Generated with [Letta Code](https://letta.com) Co-authored-by: letta-code <248085862+letta-code@users.noreply.github.com> Co-authored-by: datadog-official[bot] Co-authored-by: Kian Jones <11655409+kianjones9@users.noreply.github.com> --- letta/llm_api/anthropic_client.py | 8 +++++++- letta/schemas/providers/anthropic.py | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/letta/llm_api/anthropic_client.py b/letta/llm_api/anthropic_client.py index 3f1b8aa0..8461167a 100644 --- a/letta/llm_api/anthropic_client.py +++ b/letta/llm_api/anthropic_client.py @@ -447,8 +447,14 @@ class AnthropicClient(LLMClientBase): else: max_output_tokens = llm_config.max_tokens + # Strip provider prefix from model name if present (e.g., "anthropic/claude-..." -> "claude-...") + # This handles cases where the handle format was incorrectly passed as the model name + model_name = llm_config.model + if "/" in model_name: + model_name = model_name.split("/", 1)[-1] + data = { - "model": llm_config.model, + "model": model_name, "max_tokens": max_output_tokens, "temperature": llm_config.temperature, } diff --git a/letta/schemas/providers/anthropic.py b/letta/schemas/providers/anthropic.py index a6e267c1..2e2faf6c 100644 --- a/letta/schemas/providers/anthropic.py +++ b/letta/schemas/providers/anthropic.py @@ -93,6 +93,16 @@ MODEL_LIST = [ "name": "claude-3-5-haiku-latest", "context_window": 200000, }, + # 4.5 + { + "name": "claude-haiku-4-5-20251001", + "context_window": 200000, + }, + # 4.5 latest + { + "name": "claude-haiku-4-5-latest", + "context_window": 200000, + }, ## Opus 4.5 { "name": "claude-opus-4-5-20251101",