Feat/add litellm provider#137
Merged
JDOxygen merged 5 commits intoJun 5, 2026
Merged
Conversation
Contributor
Author
|
cc @JDOxygen |
Contributor
Author
|
@JDOxygen do you have any update on this PR? |
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 new LLM provider (
oxy.LiteLLM), enabling access to 100+ LLM backends (OpenAI, Anthropic, Google, Azure, AWS Bedrock, Ollama, etc.) through a single unified interface.Changes
Feature:
oxy.LiteLLMprovider addedNew files:
oxygent/oxy/llms/litellm_llm.py--LiteLLM(BaseLLM)class usinglitellm.acompletion()tests/unittest/test_litellm_llm.py-- 8 unit testsexamples/llms/demo_litellm.py-- usage exampleModified files:
oxygent/oxy/llms/__init__.py-- exportLiteLLMoxygent/oxy/__init__.py-- exportLiteLLMoxygent/oxy_factory.py-- register inOxyFactory._creatorsdocs/docs_en/introduction/agents/select-llm.md-- added LiteLLM to provider table + usage sectionDesign decisions:
BaseLLMdirectly (notRemoteLLM) becauseRemoteLLM's validator requires non-emptybase_url, but LiteLLM routes by model prefix and doesn't always need onedrop_params=Trueby default -- silently drops provider-unsupported kwargs (e.g.strict:trueon Anthropic,seedon Gemini)api_keyis optional -- when unset, LiteLLM falls back to provider-specific env vars (ANTHROPIC_API_KEY,OPENAI_API_KEY, etc.)litellminside_execute()so the package stays optionalreasoning_content(<think>tags) handled identically toOpenAILLMTests
Unit tests (8 passing):
Existing tests -- no regressions (38 passed):
Live e2e against Anthropic via LiteLLM:
Format check:
ruff formatclean on all new/modified files.Example usage
Checklist