Merge pull request #2861 from BerriAI/litellm_add_azure_command_r_plust

[FEAT] add azure command-r-plus
This commit is contained in:
Ishaan Jaff 2024-04-05 15:13:35 -07:00 committed by GitHub
commit 2174b240d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 76 additions and 35 deletions

View file

@ -5588,6 +5588,18 @@ def get_llm_provider(
dynamic_api_key = None
# check if llm provider provided
# AZURE AI-Studio Logic - Azure AI Studio supports AZURE/Cohere
# If User passes azure/command-r-plus -> we should send it to cohere_chat/command-r-plus
if model.split("/", 1)[0] == "azure":
model_name = model.split("/", 1)[1]
if (
model_name in litellm.cohere_chat_models
or f"mistral/{model_name}" in litellm.mistral_chat_models
):
custom_llm_provider = "openai"
model = model_name
return model, custom_llm_provider, dynamic_api_key, api_base
if custom_llm_provider:
return model, custom_llm_provider, dynamic_api_key, api_base