feat: add LiteLLM as AI gateway provider#2427
Open
RheagalFire wants to merge 2 commits intoarc53:mainfrom
Open
feat: add LiteLLM as AI gateway provider#2427RheagalFire wants to merge 2 commits intoarc53:mainfrom
RheagalFire wants to merge 2 commits intoarc53:mainfrom
Conversation
|
@RheagalFire is attempting to deploy a commit to the Arc53 Team on Vercel. A member of the Team first needs to authorize it. |
Author
Contributor
|
I noticed that in your docstring you mention openai format. What difference does it make rather then using custom openai base url that will simply redirect to litellm? |
Author
This requires user to specifically run a separate proxy server for litellm. |
Author
|
@dartpain Any update here? |
52f2dfc to
48af9e2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What kind of change does this PR introduce? Feature adds LiteLLM as a new LLM provider
Why was this change needed? DocsGPT supports individual LLM providers (OpenAI, Anthropic, Google, Groq, etc.) each with separate integration code. LiteLLM provides a unified interface to 100+ LLM providers
through a single
completion()call. Users switch providers by changing a model string. This was requested across PRs Add support for Llama2, Palm, Cohere, Anthropic, Replicate Models - using litellm #305, Add Llama2, AI21, Aleph Alpha, Palm, Cohere, TogetherAI, Huggingface, etc. streaming #310, Add Bedrock, Ollama, Claude2, Cohere, Replicate [100+ LLMs] - using LiteLLM #394, Support Anthropic, Palm, Huggingface, Ollama, TogetherAI, Replicate, etc. #572.Other information: See sections below.
What Changed
application/llm/litellm.pyLiteLLMprovider extendingBaseLLMnon-streaming, streaming, tool calling, structured output, reasoning tokensapplication/llm/llm_creator.py"litellm": LiteLLMinLLMCreator.llmsapplication/core/model_settings.pyModelProvider.LITELLMenum +_add_litellm_models()for dynamic model registration fromLLM_NAMEapplication/core/model_utils.py"litellm"toprovider_key_mapapplication/requirements.txtlitellm>=1.60.0,<2.0.0tests/llm/test_litellm.pyUsage
Quick Start
Testing
Unit Tests (10/10 Passing)
Live Tests (Azure AI Foundry → Claude Sonnet via LiteLLM)
Model: azure_ai/claude-sonnet-4-6
Non-streaming _raw_gen → "4"
Streaming _raw_gen_stream → "1, 2, 3, 4, 5"
Full pipeline gen() → "OK"
Full pipeline gen_stream() → "Hello! 👋 How are you doing"
Risk / Compatibility