Repository navigation
Conversation
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Status follow-up: I checked and resolved the CodeQL locals() review thread with an explanation of the actual cache-key data flow and an isolated source-level verification; no code change was needed for that warning. The remaining red OSV job reports braces@3.0.3 in ui/litellm-dashboard/package-lock.json (GHSA-vfj7-8cjw-p6xm). This PR changes only the Azure utility and its unit tests, not that lockfile, so this appears unrelated to the retry-cache fix: https://github.com/BerriAI/litellm/actions/runs/37091816018/job/111113566449 The PR remains a draft because real Azure service validation and the remaining repository requirements are still outstanding. I have not rerun the SDK suite or claimed a live Azure pass in this follow-up. |
TLDR
Problem this solves:
How it solves it:
User Flow
Before: an Azure chat request retries more often than configured
num_retries=3RateLimitErrorafter 16 upstream requestsAfter: the same request follows the retry behavior of the OpenAI route
num_retries=3RateLimitErrorafter 7 upstream requestsRelevant issues
Fixes #44180
Pre-Submission checklist
This remains a draft pending real Azure validation and current CI and automated review results
Local validation
Validated on Windows with Python 3.12, OpenAI SDK 2.54.0 and httpx 0.28.1 at
eeef7c77b88b8c5e26d2c102a470df1f07ebf9e0, after mergingmainat98465fe2. The diff against that main still changes only the Azure utility and its existing unit test fileThe regression constructs real SDK clients and uses the real client cache. It covers synchronous and asynchronous clients with dated Azure API versions and
v1, switching retries from 3 to 0 and back, the reverse order, and reuse for omitted,None, and explicit default valuesThe failure is the existing
test_default_max_retries_env_var_reaches_azure_sdk_client. The shared host-environment fixture removes Windows system variables, causing its child process to fail while importing asyncio with WinError 10106, before any Azure code runs. The same test passes when run separately without the parent fixture:All 12 new cases pass with the normal shared fixtures:
Mutation check: removing the four production lines makes the eight retry-switching cases fail on the SDK clients' actual
max_retriesvalues, while the four equivalent-default controls still pass. Restoring the lines returns all 12 cases to passingRuff 0.16.10 reports no added diagnostics against the matching files on main. The production file passes formatting; the existing test file has formatting differences outside this change.
git diff --checkpasses. Full lint and the Linux suite remain for current CIThe previously failing OSV check reported an unchanged frontend dependency. Upstream #44347 already added its policy exception for the unfixed advisory. This branch now includes that upstream change through the main merge; this PR adds no security exception of its own. The current-tip OSV scan now passes: https://github.com/BerriAI/litellm/actions/runs/37807038030/job/113413912259
Local HTTP 429 reproduction
Fresh runs use the local scripted HTTP 429 server from #44180 with real LiteLLM and SDK HTTP requests. These are integration evidence only. No Azure deployment is available, so they do not satisfy the template's real-provider proof requirement
For each checkout, run the issue's server and completion loop with
num_retries=3, recordingx-stainless-retry-count. Include an OpenAI control, dated Azure API2025-04-01-preview, and Azurev1. The v1 case uses the same server root andapi_version="v1"Before (98465fe)
After (eeef7c7)
Type
Bug Fix
Caveats
Low
Final Attestation