mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-26 22:30:11 +00:00
* fix(azure_ai): count Grok reasoning tokens in completion_tokens Grok on Azure AI Foundry reports reasoning_tokens outside completion_tokens, like xAI does, so azure_ai/grok-* calls billed only max(visible, reasoning) output tokens. Fold them with XAIChatConfig.fold_reasoning_tokens_into_completion in transform_response and in a new streaming iterator, matching the xai provider. Split out of #46377. * fix(azure_ai): fold reasoning tokens for every deployment name, streaming or not Non-streaming checked the deployment name for grok while streaming checked the chunk model field, so a Grok deployment named without grok was only folded when streaming. The fold already only fires when total_tokens equals prompt plus completion plus reasoning, so it now runs on every azure_ai response. |
||
|---|---|---|
| .. | ||
| agents | ||
| anthropic | ||
| chat | ||
| claude | ||
| embed | ||
| image_edit | ||
| image_generation | ||
| passthrough | ||
| rerank | ||
| responses | ||
| vector_stores | ||
| __init__.py | ||
| test_azure_ai_agents_handler.py | ||
| test_azure_ai_cost_calculator.py | ||
| test_azure_ai_entra_auth.py | ||
| test_azure_ai_foundry_catalog_model_metadata.py | ||
| test_azure_ai_fw_models_metadata.py | ||
| test_azure_ai_kimi_k26_metadata.py | ||