Merge pull request #2216 from BerriAI/litellm_fix_using_mistral_azure_ai

[FIX] using mistral on azure ai studio
This commit is contained in:
Ishaan Jaff
2024-02-27 08:37:20 -08:00
committed by GitHub
2 changed files with 15 additions and 2 deletions
+14 -1
View File
@@ -18,4 +18,17 @@ def test_get_llm_provider():
assert response == "bedrock"
test_get_llm_provider()
# test_get_llm_provider()
def test_get_llm_provider_mistral_custom_api_base():
model, custom_llm_provider, dynamic_api_key, api_base = litellm.get_llm_provider(
model="mistral/mistral-large-fr",
api_base="https://mistral-large-fr-ishaan.francecentral.inference.ai.azure.com/v1",
)
assert custom_llm_provider == "mistral"
assert model == "mistral-large-fr"
assert (
api_base
== "https://mistral-large-fr-ishaan.francecentral.inference.ai.azure.com/v1"
)
+1 -1
View File
@@ -4926,7 +4926,7 @@ def get_llm_provider(
dynamic_api_key = get_secret("GROQ_API_KEY")
elif custom_llm_provider == "mistral":
# mistral is openai compatible, we just need to set this to custom_openai and have the api_base be https://api.mistral.ai
api_base = "https://api.mistral.ai/v1"
api_base = api_base or "https://api.mistral.ai/v1"
dynamic_api_key = get_secret("MISTRAL_API_KEY")
elif custom_llm_provider == "voyage":
# voyage is openai compatible, we just need to set this to custom_openai and have the api_base be https://api.voyageai.com/v1