mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
fix: add verbose_logger.debug when max_tokens is capped
Emit a debug log when the adapter silently reduces max_tokens to the model's output limit, consistent with the get_modified_max_tokens pattern in token_counter.py. Aids debugging when users observe shorter completions than expected.
This commit is contained in:
parent
0b65e0a2b2
commit
19e85ea067
1 changed files with 8 additions and 0 deletions
|
|
@ -141,6 +141,14 @@ class LiteLLMMessagesToCompletionTransformationHandler:
|
|||
)
|
||||
model_max_output = model_info.get("max_output_tokens")
|
||||
if model_max_output is not None and max_tokens > model_max_output:
|
||||
from litellm._logging import verbose_logger
|
||||
|
||||
verbose_logger.debug(
|
||||
"Anthropic adapter: capping max_tokens from %d to %d for model=%s",
|
||||
max_tokens,
|
||||
model_max_output,
|
||||
model,
|
||||
)
|
||||
max_tokens = model_max_output
|
||||
except Exception:
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue