feat: add LiteLLM client and agent - #202
Open
Prodman Devokadev (prodmanpd) wants to merge 1 commit into
Open
Prodman Devokadev (prodmanpd) wants to merge 1 commit into
Prodman Devokadev (prodmanpd) wants to merge 1 commit into
Conversation
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
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 a LiteLLM client and agent, so a problem can be evaluated against models the registry has no dedicated client for.
LiteLLM gives one interface to 100+ providers. The same model name works two ways: directly, where LiteLLM routes each model to its own provider using that provider's key (
LITELLM_MODEL=anthropic/claude-opus-4-7plusANTHROPIC_API_KEYis the whole setup); or through a self-hosted gateway whenLITELLM_API_BASEis set, keeping provider keys server-side and adding centralized cost tracking, budgets, rate limiting and fallbacks across a long benchmark run.LiteLLMClientneeds no endpoint at all. For a benchmark whose value is comparing agents across models, removing the infrastructure prerequisite for multi-vendor evaluation is the point.Changes
clients/utils/llm.py: newLiteLLMClient, matching the existing client contract exactly (Cache,inference(),run()), appended alongside its siblings.clients/litellm_agent.py(new):LiteLLMAgent, mirroringgeneric_openai.pyincluding the__main__runner.clients/registry.py: one row,"litellm": LiteLLMAgent.pyproject.toml:litellmin the existingclientsgroup, sopoetry install --without clientsis unaffected.tests/clients/test_litellm_client.py(new): 19 tests.drop_params=Trueis set on every call: the sharedtemperature/top_p/nsettings are not accepted by every provider, and dropping the unsupported ones lets one configuration serve every model.Tests
Live, through the real
LiteLLMAgent.get_action(), against a self-hosted gateway on an SRE prompt:Two upstream vendors answer correctly through one code path and one key. The last case has no vendor key here, so it demonstrates routing: the error proves the SDK went to Anthropic rather than to a gateway.
Example