BerriAI / litellm

Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
14.16k stars 1.67k forks source link

[Bug]: Azure ad token provider does not work #6790

Open bahtman opened 1 week ago

bahtman commented 1 week ago

What happened?

Using the Python SDK following the example of: https://docs.litellm.ai/docs/providers/azure#azure-ad-token-refresh---defaultazurecredential

Using this code:

from litellm import completion as Comp
Comp(model="azure/gpt4o-mini-rag",
        api_base=api_base,
        api_version=api_version,
        azure_ad_token_provider=ad_token_provider,
        input="Hey")

Returns the following error:

APIError: litellm.APIError: AzureException APIError - Missing credentials. Please pass one of `api_key`, `azure_ad_token`, `azure_ad_token_provider`, or the `AZURE_OPENAI_API_KEY` or `AZURE_OPENAI_AD_TOKEN` environment variables.

Relevant log output

No response

Twitter / LinkedIn details

No response