feat: add LiteLLM as AI gateway provider#196
Merged
tsingfei merged 4 commits intoJun 4, 2026
Merged
Conversation
Contributor
Author
tsingfei
reviewed
May 28, 2026
| readme = "README.md" | ||
| requires-python = ">=3.9" | ||
| authors = [ | ||
| { name = "Tielei Zhang", email = "zhangtl04@gmail.com" }, |
Contributor
There was a problem hiding this comment.
You can change the package author to your name, and the same goes for the email address.
Contributor
|
@RheagalFire Thank you for your contribution! Here are two points for your consideration in improving:
To meet the CI/CD requirements, I changed the target branch to the |
Contributor
Author
|
@tsingfei Addressed both items:
|
Removed redundant markdown cells and code examples to streamline the tutorial on LLM integration.
tsingfei
approved these changes
Jun 4, 2026
NiceCode666
approved these changes
Jun 4, 2026
Contributor
|
@RheagalFire Have released your integration: https://pypi.org/project/bridgic-llms-litellm/ |
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
bridgic-llms-litellm), giving Bridgic users access to 100+ LLM providers (OpenAI, Anthropic, Google, Groq, Together AI, AWS Bedrock, Azure, Mistral, etc.) through a single unified interfacepackages/bridgic-integration/llms/implementingBaseLlmMotivation
Bridgic currently supports OpenAI (native), OpenAI-compatible endpoints, and vLLM. Users who want to use Anthropic, Google, Groq, Together AI, AWS Bedrock, or other providers need to either:
LiteLLM solves this by providing a single
litellm.completion()/litellm.acompletion()interface that routes to any of 100+ providers using provider-prefixed model strings (e.g.openai/gpt-4o,anthropic/claude-sonnet-4-6,groq/llama-3.3-70b-versatile). This PR ships it as a first-class Bridgic provider.Changes
packages/bridgic-integration/llms/bridgic-llms-litellm/— new LiteLLM provider packagebridgic/llms/litellm/_litellm_llm.py—LiteLLM(BaseLlm)withchat,stream,achat,astream, serializationbridgic/llms/litellm/__init__.py— public exportspyproject.toml— package config withlitellm>=1.80.0,<1.87pinned dependencyMakefile— matches existing sub-package patterntests/test_litellm.py— 24 unit tests + 4 integration testspyproject.toml(root) — registeredbridgic-llms-litellmas workspace member + dependencyKey design decisions
drop_params=Truealways set — LiteLLM silently drops per-provider-unsupported kwargs (e.g.frequency_penaltyon Anthropic,strict:trueon non-OpenAI). This prevents cross-provider errors when users switch modelsimport litellminside method bodies so users who don't installbridgic-llms-litellmaren't affectedapi_key=None, LiteLLM reads from provider env vars (OPENAI_API_KEY,ANTHROPIC_API_KEY, etc.)OpenAILikeLlm._convert_message_normalpattern — plain dict format compatible with LiteLLMlitellm>=1.80.0,<1.87(tight range, not unpinned)Tests
1. Unit + edge case tests (24 passed):
Edge cases covered:
ModelUnrecoverableError, not retried (1 call)ModelRetryLimitErrorModelRetryLimitErrorusage=None, no crashRuntimeWarningemitted2. Import + smoke test:
3. Pin resolution verified:
Risk / Compatibility
litellmis a regular dependency of the new package, not the root — users who don't installbridgic-llms-litellmare unaffectedpackages/bridgic-integration/llms/*automatically picks up the new packageExample usage