Feat/add litellm provider#329
Merged
huangyz0918 merged 2 commits intoJul 10, 2026
Merged
Conversation
Contributor
Author
huangyz0918
approved these changes
Jul 7, 2026
huangyz0918
left a comment
Member
There was a problem hiding this comment.
LGTM, thank you @RheagalFire
leeeizhang
approved these changes
Jul 8, 2026
Collaborator
|
many thanks! @RheagalFire |
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 has been done to verify that this works as intended?
15 unit tests pass:
Covers: init with explicit params / env vars / defaults, missing openai import, query, streaming, None content, auth error (401), rate limit (429), timeout, empty choices, tool-to-function conversion.
6 live E2E tests pass (LiteLLM proxy -> Azure Foundry / Anthropic Claude Sonnet 4.6):
"4""Your name is Alice.""1, 2, 3, 4, 5"(streamed in chunks)"Tokyo"both times"Vast, blue, deep."""Why is this the best possible solution? Were any other approaches considered?
Follows the exact same pattern as the existing DeepSeek and vLLM providers - uses the
openaiSDK pointed at a LiteLLM proxy URL. Zero new dependencies. The alternative was addinglitellmas a direct Python SDK dependency, but since MLE-agent already uses theopenaiSDK for multiple providers, pointing it at a LiteLLM proxy is simpler, lighter, and consistent with the vLLM provider pattern.How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?
Additive only - no existing code modified except registering the new provider in
__init__.py. Existing providers and workflows are completely unaffected. Users opt in by settingplatform: LiteLLMin.mle/project.yml.Changes:
mle/model/litellm.py- newLiteLLMModelclass extendingModelwithquery()andstream()mle/model/__init__.py- addedMODEL_LITELLM = 'LiteLLM', import, andload_model()branchtests/test_litellm_model.py- 15 unit testsUsage:
Do we need any specific form for testing your changes? If so, please attach one.
No. A running LiteLLM proxy is needed for live testing. Unit tests run without one (fully mocked).
Does this change require updates to documentation? If so, please file an issue here and include the link below.
No external documentation updates required. The provider follows the same configuration pattern as all existing providers.
Before submitting this PR, please make sure you have:
the credit file.