Files
litellm/tests
Cesar Garcia 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-13 16:10:48 -08:00
2025-12-13 16:38:11 -08:00
2025-12-05 12:40:58 -08:00

In total litellm runs 1000+ tests

[02/20/2025] Update:

To make it easier to contribute and map what behavior is tested,

we've started mapping the litellm directory in tests/test_litellm

This folder can only run mock tests.