Files
litellm/tests/test_litellm/llms
Cesar GarciaandGitHub c892c2c83d fix(anthropic): use dynamic max_tokens based on model (#17900)
* fix(anthropic): use dynamic max_tokens based on model

When users don't specify max_tokens in requests to Anthropic models,
LiteLLM now uses the correct max_output_tokens value from the model
pricing JSON instead of a hardcoded 4096.

This fixes truncated responses for Claude 3.5+ models which support
higher output limits (8192 for Claude 3.5, 128k for Claude 3.7, etc.)

Fixes #8835

* fix(anthropic): restore env var support for backwards compatibility

Keep DEFAULT_ANTHROPIC_CHAT_MAX_TOKENS as fallback when model is not
found in JSON, allowing users to configure via environment variable.
2025-12-14 08:31:27 +05:30
..
2025-12-08 20:29:50 +05:30
2025-09-27 10:01:48 -07:00
2025-12-06 00:04:04 +05:30
2025-10-17 17:52:25 -07:00
2025-11-24 11:44:20 -08:00