feat: add LiteLLM as AI gateway provider#18
Open
RheagalFire wants to merge 1 commit into
Open
Conversation
Author
|
cc @molly554 |
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.
Summary
Adds LiteLLM as a third provider alongside DeepSeek and OpenRouter, giving users access to 100+ LLM providers (Anthropic, OpenAI, Bedrock, Vertex AI, Groq, etc.) through a single
provider = "litellm"config change.Motivation
The current provider system supports DeepSeek and OpenRouter. LiteLLM adds 100+ providers via its SDK without needing a separate proxy. Users set
provider = "litellm"inconfig.toml, pick any model string (e.g.anthropic/claude-sonnet-4-6), and LiteLLM routes to the right provider using standard env vars (ANTHROPIC_API_KEY,OPENAI_API_KEY, etc.).drop_params=Truehandles cross-provider kwarg incompatibilities automatically.Changes
src/standard/llm_client.py-- added"litellm"toPROVIDER_DEFAULTS, new_litellm_chat_completions()function usinglitellm.completion()withdrop_params=True,providerkwarg threaded throughchat_completions()src/standard/llm_rewriter.py-- forwardsproviderkwargsrc/standard/pipeline.py-- forwardsproviderkwarg to both rewrite stepssrc/methodologies/llm_rewriter.py-- forwardsproviderkwargTests
Existing tests (12/12 pass):
Live E2E (LiteLLM SDK -> Azure Foundry -> Claude Sonnet 4.6):
Example usage
Any LiteLLM-supported model string works:
openai/gpt-4o,groq/llama-3.3-70b-versatile,deepseek/deepseek-chat,bedrock/anthropic.claude-v2, etc.