feat(utils.py): Add github as a provider

Closes https://github.com/BerriAI/litellm/issues/4922#issuecomment-2266564469
This commit is contained in:
Krrish Dholakia 2024-08-03 09:11:22 -07:00
parent 57644be857
commit 4258295a07
3 changed files with 36 additions and 0 deletions

View file

@ -4513,6 +4513,10 @@ def get_llm_provider(
elif custom_llm_provider == "azure_ai":
api_base = api_base or get_secret("AZURE_AI_API_BASE") # type: ignore
dynamic_api_key = api_key or get_secret("AZURE_AI_API_KEY")
elif custom_llm_provider == "github":
api_base = api_base or get_secret("GITHUB_API_BASE") or "https://models.inference.ai.azure.com" # type: ignore
dynamic_api_key = api_key or get_secret("GITHUB_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 = (