feat: add LiteLLM AI gateway integration#803
Open
RheagalFire wants to merge 1 commit into
Open
Conversation
Author
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.
Adds LiteLLM AI gateway integration, giving Burr users access to 100+ LLM providers (OpenAI, Anthropic, Google, Azure, AWS Bedrock, Ollama, Groq, Mistral, and more) through a single Action class.
Changes
burr/integrations/litellm.py- NewLiteLLMAction(non-streaming) andLiteLLMStreamingAction(streaming) following the same_Core+_Base+ Action pattern asburr/integrations/bedrock.py. Useslitellm.completion()withdrop_params=Truefor cross-provider compatibility.pyproject.toml- Added[litellm]optional dependency group (burr[litellm])The codebase already references LiteLLM in TODO comments (
core/parallelism.py,docs/concepts/parallelism.rst) and uses LiteLLM pricing data for cost tracking (telemetry/ui/scripts/token_costs.py). This PR ships the actual integration.How I tested this
Live E2E via Anthropic Claude:
Pin resolution verified:
pip install -e '.[litellm]'resolves cleanly.Notes
_BedrockCore/_BedrockBase/BedrockAction/BedrockStreamingAction)litellmis an optional extra, base install unaffecteddrop_params=Truesilently drops provider-unsupported kwargs so the same action works across OpenAI, Anthropic, Gemini, etc.Checklist