mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-14 11:08:37 +00:00
4860cdbfd5
* Fix Azure GPT-5 incorrectly routing to O-series config GPT-5 models support reasoning but are NOT O-series models and DO support temperature parameter. The previous routing logic in get_provider_responses_api_config() was incorrectly sending Azure GPT-5 requests to AzureOpenAIOSeriesResponsesAPIConfig which removes temperature from supported params. This fix explicitly excludes GPT-5 models from O-series routing, ensuring they use the standard AzureOpenAIResponsesAPIConfig which properly supports temperature. Fixes: Azure GPT-5 throwing UnsupportedParamsError for temperature parameter Tested: Added comprehensive unit tests for GPT-5 and O-series routing * Apply suggestion from @xingyaoww * Apply suggestion from @xingyaoww * Improve Azure routing logic to use broader 'gpt' check for temperature support Based on feedback from @krrishdholakia, updated the routing logic to check for 'gpt' in model name instead of specifically 'gpt-5'. This approach is: - More future-proof: covers all GPT models (gpt-3.5, gpt-4, gpt-5, future models) - Simpler: single check for all GPT variants - More maintainable: won't need updates for each new GPT model Changes: - litellm/utils.py: Changed from is_gpt5 to is_gpt_model check - tests: Added comprehensive test for all GPT model variants (gpt-3.5 through gpt-5) All tests pass: - GPT models (gpt-3.5-turbo, gpt-4, gpt-4o, gpt-5) -> AzureOpenAIResponsesAPIConfig (supports temperature) - O-series models (o1, o3) -> AzureOpenAIOSeriesResponsesAPIConfig (no temperature) Co-authored-by: openhands <openhands@all-hands.dev> --------- Co-authored-by: openhands <openhands@all-hands.dev>
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.