mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-28 00:00:38 +00:00
* fix(anthropic): update rate-limit gauges for streamed /v1/messages and Foundry Claude Streamed /v1/messages and /anthropic pass-through logging now reads the provider response headers into hidden params, so the Prometheus remaining tokens and requests gauges update like they do for non-streamed calls. process_anthropic_headers also keeps a provider's own x-ratelimit-* headers (Azure AI Foundry Claude), with the mapped anthropic-ratelimit-* value winning on conflict. * test(anthropic): wait on a typed queue for the logged rate-limit headers * fix(anthropic): log only the rate-limit headers on streamed /v1/messages The streamed Messages log stamp passed every upstream response header to logging callbacks, so headers like set-cookie and anthropic-organization-id reached Langfuse, Datadog and S3. It now keeps only anthropic-ratelimit-* and x-ratelimit-* headers, matched case-insensitively, which still feed the remaining-tokens and remaining-requests gauges for Anthropic and Azure AI Foundry --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| batches | ||
| chat | ||
| files | ||
| messages | ||
| pass_through | ||
| __init__.py | ||
| anthropic_docs_refusal.py | ||
| test_anthropic_common_utils.py | ||
| test_anthropic_count_tokens_transformation.py | ||
| test_anthropic_files_and_batches.py | ||
| test_anthropic_output_format_filter.py | ||
| test_anthropic_prompt_cache_prediction.py | ||
| test_anthropic_prompt_cache_pricing.py | ||
| test_anthropic_reasoning_effort.py | ||
| test_anthropic_schema_filter.py | ||
| test_anthropic_structured_output.py | ||
| test_anthropic_wif.py | ||
| test_azure_ai_cache_pricing.py | ||
| test_cost_calculation_dict_safety.py | ||
| test_count_tokens_oauth.py | ||
| test_message_sanitization.py | ||
| test_messages_http_error_retry_cases.py | ||