litellm/tests/test_litellm/llms
Mateo Wang 96a2e8b16d
fix(azure): preserve AD token refresh in v1 OpenAI client path (#28627)
* fix(azure): preserve AD token refresh in v1 OpenAI client path

The /openai/v1/ code path (api_version in {"v1", "latest", "preview"})
constructs a plain OpenAI/AsyncOpenAI client, but only forwarded
`api_key` from `azure_client_params`. When `enable_azure_ad_token_refresh`
is set (or any AD-only auth), `api_key` is None and the client
constructor raised "The api_key client option must be set...", breaking
every Azure call with a v1 api_version.

The OpenAI SDK (>=2.20.0) accepts a callable for `api_key` and re-invokes
it on every request via `_refresh_api_key`, so we now forward
`azure_ad_token_provider` directly — preserving the per-request token
refresh behavior of the regular AzureOpenAI client and avoiding the
expiry hole that resolving the token once at client-creation time would
introduce. Static `azure_ad_token` strings fall through to `api_key`.

For the async path we wrap the sync provider returned by azure-identity
in an async function since AsyncOpenAI expects `Callable[[], Awaitable[str]]`.

Fixes #27945

https://claude.ai/code/session_01UnzrDSFUUgp5T2wRoPMxq5

* fix(azure): offload sync token provider to thread in v1 async wrapper

* fix(azure): include AD credential identity in v1 client cache key

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-05-25 21:08:52 -07:00
..
amazon_nova/chat
anthropic perf: reduce per-request and per-chunk overhead across Anthropic streaming hot paths (#28289) 2026-05-23 12:15:59 -07:00
azure fix(azure): preserve AD token refresh in v1 OpenAI client path (#28627) 2026-05-25 21:08:52 -07:00
azure_ai refactor: remove unnecessary comments from #27074 2026-05-04 19:34:56 +00:00
base_llm fix(team): keep team_alias cache in sync on _cache_team_object writes (#28737) 2026-05-25 19:16:36 -07:00
baseten/chat
bedrock chore(tests): migrate Bedrock CI to AWS account 941277531214 (#28728) 2026-05-25 12:03:17 -07:00
bedrock_mantle
black_forest_labs
bytez/chat
chat
chatgpt Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
cloudflare
cohere
cometapi/chat
compactifai
crusoe
custom_httpx perf: reduce per-request and per-chunk overhead across Anthropic streaming hot paths (#28289) 2026-05-23 12:15:59 -07:00
dashscope Litellm oss staging (#28161) 2026-05-18 16:27:44 -07:00
databricks
datarobot
deepgram
deepinfra
deepseek fix(deepseek): use native /anthropic/v1/messages endpoint and sanitize tools (#28200) 2026-05-18 18:14:13 -07:00
docker_model_runner
elevenlabs
featherless_ai/chat
fireworks_ai Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
gemini
github_copilot fix black and github mock test 2026-05-11 20:41:10 +05:30
heroku
hosted_vllm fix(hosted_vllm): normalize custom tools for chat completions (#25763) 2026-05-05 17:27:02 -07:00
huggingface
jina_ai/embedding
lemonade
litellm_proxy chore: simplify ownership tracking — drop thin stores, in-memory fallback, hand-rolled cache 2026-05-05 00:23:32 +00:00
llamafile/chat
lm_studio
manus
meta_llama
minimax
mistral
moonshot
nebius
novita/chat
nscale/chat
nvidia_riva feat(audio_transcription): add NVIDIA Riva STT provider (#27185) 2026-05-05 17:17:51 -07:00
oci CI: copy of #25177 (OCI GenAI: embeddings, streaming/reasoning fixes, model catalog) (#28223) 2026-05-23 12:15:41 -07:00
ocr
ollama Litellm agent oss staging 05 11 2026 (#27733) 2026-05-13 14:09:12 -07:00
openai feat(openai): apply regional-processing cost uplift for EU/US data residency (#28626) 2026-05-25 20:36:14 -07:00
openai_like
openrouter
ovhcloud
perplexity
pg_vector/vector_stores
publicai
ragflow/chat
recraft
reducto Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
runwayml
s3_vectors
sagemaker fix(sagemaker): send native Cohere embed payload to Cohere SageMaker endpoints (#28613) 2026-05-22 12:00:42 -07:00
sambanova
sap
scaleway
snowflake
stability
vercel_ai_gateway
vertex_ai fix(vertex_gemma): strip context_management from request body (#28438) 2026-05-21 23:10:33 +05:30
volcengine
voyage/rerank
wandb
watsonx
xai Litellm oss staging 04 21 2026 2 (#26569) 2026-05-20 21:25:19 -07:00
zai
test_cache_control_and_reasoning.py
test_file_content_block.py Litellm oss staging (#28161) 2026-05-18 16:27:44 -07:00
test_file_search_responses.py fix(tests): use canonical litellm_enterprise import path (#27699) 2026-05-12 12:32:57 -07:00
test_lifecycle_fix.py
test_oom_fixes.py
test_polling_url_origin_match.py
test_predibase_transformation.py