Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(util.py/azure.py): Add OIDC support when running LiteLLM on Azure + Azure Upstream caching #3861

Merged
merged 7 commits into from
Jun 12, 2024

Conversation

Manouchehri
Copy link
Collaborator

@Manouchehri Manouchehri commented May 27, 2024

Title

This adds OIDC support for AKS (Managed Kubernetes Service).

Relevant issues

Resolves #1852.

Type

🆕 New Feature

Changes

TBD

[REQUIRED] Testing - Attach a screenshot of any new tests passing locally

TBD.

@RyoYang or @olad32, could you please try this config below and let me know what happens? (Feel free to use any Azure OpenAI model.)

model_list:
  - model_name: gpt-4-0125-preview
    litellm_params:
      model: azure/gpt-4-0125-preview
      api_version: "2024-05-01-preview"
      azure_ad_token: "oidc/azure/api://AzureADTokenExchange"
      api_base: "https://example.openai.azure.com"
    model_info:
      base_model: azure/gpt-4-0125-preview

Copy link

vercel bot commented May 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 11, 2024 3:57pm

@Manouchehri Manouchehri changed the title feat(util.py/azure.py): Add OIDC support when running LiteLLM on Azure feat(util.py/azure.py): Add OIDC support when running LiteLLM on Azure + Azure Upstream caching May 27, 2024
@RyoYang
Copy link

RyoYang commented May 28, 2024

@Manouchehri Thanks for the quick updates, the functionality looks good in my environments.

@Manouchehri
Copy link
Collaborator Author

You successfully ran it?

@RyoYang
Copy link

RyoYang commented May 28, 2024

Yea, it ran well in my AKS.

@Manouchehri
Copy link
Collaborator Author

Oh wow, that’s awesome I guessed it right on the first try. Thanks for confirming!

@Manouchehri Manouchehri marked this pull request as ready for review May 29, 2024 03:47
@RyoYang
Copy link

RyoYang commented May 29, 2024

Oh wow, that’s awesome I guessed it right on the first try. Thanks for confirming!

Great work! How long can you checkin the change into main branch?

@Manouchehri
Copy link
Collaborator Author

Manouchehri commented May 31, 2024

@RyoYang Could you help me get some more info so I can write a unit test as well?

Option 1: Could you share AZURE_AUTHORITY_HOST and the contents of AZURE_FEDERATED_TOKEN_FILE with me?

For AZURE_FEDERATED_TOKEN_FILE, make sure to remove the part after the last dot so you don't give me access to your real infrastructure.

e.g. if you have:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Please only shared with me:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SIGNATURE_REMOVED

Option 2: Run with --detailed_debug. You should see the JWT/OpenID token nearby a line that says oidc_token.

https://github.com/BerriAI/litellm/pull/3861/files#diff-fedcce684ff5b9a48140f0db2fb56e423c036e45a550c9f22c6ad3c20372862dR159-R164

Do the same thing (remove the last bit after the last .) as mentioned above.

@Manouchehri Manouchehri requested review from krrishdholakia and ishaan-jaff and removed request for krrishdholakia and ishaan-jaff June 1, 2024 16:18
@Manouchehri
Copy link
Collaborator Author

@krrishdholakia This is ready for merging. The CircleCI + Bedrock tests currently cover most of what this does too; that said, I don't have an easy way to test this myself (as it would require setting LiteLLM up on Azure Kubernetes Service).

@RyoYang
Copy link

RyoYang commented Jun 2, 2024

@RyoYang Could you help me get some more info so I can write a unit test as well?

Option 1: Could you share AZURE_AUTHORITY_HOST and the contents of AZURE_FEDERATED_TOKEN_FILE with me?

For AZURE_FEDERATED_TOKEN_FILE, make sure to remove the part after the last dot so you don't give me access to your real infrastructure.

e.g. if you have:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c

Please only shared with me:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SIGNATURE_REMOVED

Option 2: Run with --detailed_debug. You should see the JWT/OpenID token nearby a line that says oidc_token.

https://github.com/BerriAI/litellm/pull/3861/files#diff-fedcce684ff5b9a48140f0db2fb56e423c036e45a550c9f22c6ad3c20372862dR159-R164

Do the same thing (remove the last bit after the last .) as mentioned above.

Hey @Manouchehri Due to the security consideration, I cannot share those string to public repo. Do we have any other way for testing?

@RyoYang
Copy link

RyoYang commented Jun 3, 2024

Also, can we merge this PR at first, as we will make this repo as submodule with this change, without this PR, we can not move forward. @Manouchehri @krrishdholakia

@Manouchehri
Copy link
Collaborator Author

Bump?

@krrishdholakia krrishdholakia merged commit 821d32f into BerriAI:main Jun 12, 2024
3 checks passed
@Manouchehri Manouchehri mentioned this pull request Jul 19, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Support azure workload identities to create azure ad tokens on proxy
3 participants