mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-21 21:41:33 +00:00
039c8a922c
* fix(azure/chat/gpt_transformation.py): support api_version="preview" Fixes https://github.com/BerriAI/litellm/issues/12945 * Fix anthropic passthrough logging handler model fallback for streaming requests (#13022) * fix: anthropic passthrough logging handler model fallback for streaming requests - Add fallback logic to retrieve model from logging_obj.model_call_details when request_body.model is empty - Fixes issue #12933 where streaming requests to anthropic passthrough endpoints would crash due to missing model field - Ensures downstream logging and cost calculation work correctly for all streaming scenarios - Maintains backwards compatibility with existing non-streaming requests * test: add minimal tests for anthropic passthrough logging handler model fallback - Add unit tests for the model fallback logic in _handle_logging_anthropic_collected_chunks - Test existing behavior when request_body.model is present - Test fallback logic when request_body.model is empty but logging_obj.model_call_details has model - Test edge cases where both sources are empty or missing - Ensure backwards compatibility and graceful degradation * fix(anthropic_passthrough_logging_handler.py): add provider to model name (accurate cost tracking) * fix(anthropic_passthrough_logging_handler.py): don't reset custom llm provider, if already set * fix: fix check --------- Co-authored-by: Haggai Shachar <haggai.shachar@backline.ai>