feat(anthropic): add Claude Fable 5.1 - #39151
Closed
mateo-berri wants to merge 2 commits into
Closed
Conversation
Registers claude-fable-5-1 in the cost maps so the model prices, reports its 1M/128K limits, and advertises adaptive always-on thinking instead of falling through the generalization rules at zero cost. Pricing matches Fable 5 at $10/$50 per MTok except cache reads, which Anthropic prices at 0.025x base input ($0.25/MTok) on this model instead of 0.1x. Fable 5.1 rejects forced tool use (tool_choice type any/tool) with a 400 because thinking is always on and a forced call would skip it. A new supports_forced_tool_use flag on the entry drives the Anthropic chat transformation to downgrade such a tool_choice to auto when drop_params is set, and otherwise raise a clean client-side UnsupportedParamsError that explains the workaround. Anthropic API only for now. Adds the model to the setup wizard and the reasoning effort e2e grid, and moves the tests that used claude-fable-5-1 as an unmapped placeholder id onto claude-fable-5-2.
Contributor
Contributor
Greptile SummaryAdds Claude Fable 5.1 support for Anthropic, including pricing, capabilities, reasoning-effort coverage, and model discovery.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| litellm/llms/anthropic/common_utils.py | Adds a model-capability-driven guard that rejects or downgrades unsupported forced tool choices. |
| litellm/llms/anthropic/chat/transformation.py | Applies the forced-tool-choice guard after normalizing OpenAI tool-choice inputs. |
| model_prices_and_context_window.json | Registers Claude Fable 5.1 pricing, limits, and Anthropic capability metadata. |
| litellm/model_prices_and_context_window_backup.json | Keeps the bundled backup cost map synchronized with the primary model registry. |
| model_prices_and_context_window.schema.json | Adds schema validation for the forced-tool-use capability flag. |
| litellm/setup_wizard.py | Adds Claude Fable 5.1 to the established hand-maintained Anthropic model list. |
| tests/test_litellm/llms/anthropic/chat/test_anthropic_chat_transformation.py | Covers forced-tool rejection, downgrade behavior, parallel-tool preservation, and unaffected models. |
| tests/test_litellm/test_claude_fable_5_1_config.py | Validates Fable 5.1 pricing, caching, capabilities, bundled-map synchronization, and provider resolution. |
Reviews (2): Last reviewed commit: "chore(model-prices): register supports_f..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This was referenced Sep 1, 2026
Contributor
Author
Contributor
Author
|
Superceded by #39148 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
claude-fable-5-1) is unknown to LiteLLMreasoning_effortget rejected with a 400How it solves it:
supports_forced_tool_use: falseflag gatestool_choiceany/tooldrop_paramsthat is a clear client-side 400, with it a downgrade toautoUser Flow
Before: a developer pointing their app at Fable 5.1 gets 400s and $0 spend
anthropic/claude-fable-5-1to the proxy model list and send POST http://localhost:4000/v1/chat/completions with"reasoning_effort": "low"anthropic does not support parameters: ['reasoning_effort']reasoning_effortand resend with a cached system prompt: HTTP 200, butx-litellm-response-costis 0 and https://litellm-domain/ui/?page=logs shows the request at $0 spend"tool_choice": "required": HTTP 400 quoting the raw provider errortool_choice: type "tool" and "any" are not supported for this modelAfter: the same requests are priced and the forced tool call fails clearly or downgrades
anthropic/claude-fable-5-1to the proxy model list and send POST http://localhost:4000/v1/chat/completions with"reasoning_effort": "low"x-litellm-response-costset (input $10/MTok, output $50/MTok)"tool_choice": "required": HTTP 400 sayingclaude-fable-5-1 does not support forced tool useand pointing them attool_choice="auto"ordrop_paramsdrop_params: true, the same request gets HTTP 200 with aget_weathertool call andfinish_reason: tool_callsRelevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
uv run pytest tests/test_litellm/<your_test_file>.py -v. Leave the suites (make test-unit-*,make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Shared setup, real Anthropic API calls through a local proxy:
cache_body.jsonused by the prompt caching case (system prompt is 89 "Rule N: ..." sentences, about 3.4k tokens, prefixed with a fresh nonce per run so the first call is a cache write):{ "model": "claude-fable-5-1", "max_tokens": 50, "messages": [ {"role": "system", "content": [{"type": "text", "text": "Session 3b46abb9. Rule 1: ... Rule 89: ...", "cache_control": {"type": "ephemeral"}}]}, {"role": "user", "content": "Reply with the single word OK."} ] }Before (f2a4172)
Chat completion with reasoning_effort
Forced tool_choice without drop_params
Forced tool_choice with drop_params
drop_paramsdoes not help because nothing knows the param is unsupported:Prompt caching cost
After (40cd92d)
Chat completion with reasoning_effort
Forced tool_choice without drop_params
Forced tool_choice with drop_params
tool_choicedowngraded toautoand the model still calls the tool:Prompt caching cost
Type
🆕 New Feature
Caveats (if any)
Medium
/v1/chat/completionsonly/v1/messagesrequests withtool_choiceany/tool still get the provider's own 400Low
supports_forced_tool_useis a new cost map flag, only Fable 5.1 sets it so farclaude-fable-5-2as the placeholderFinal Attestation