Repository navigation
LiteLLM adapter — one file, ~100 providers #33
Description
Problem
AOBench ships four adapters — direct_qa, openai, anthropic, mcp
(src/aobench/adapters/). The openai adapter already reaches any OpenAI-compatible
endpoint, including Ollama via OLLAMA_BASE_URL. But anything that is not OpenAI-shaped
— Gemini, Bedrock, Vertex, Cohere, Mistral's native API — needs its own adapter today.
Nobody can benchmark a model AOBench cannot call, and every missing provider is a
result that never gets submitted.
A LiteLLM adapter is the highest-leverage single file in this repo: one adapter, ~100
providers, and it collapses the separate Gemini and Bedrock requests into configuration.
Desired result
aobench run task --task JOB_USR_001 --env env_01 --adapter litellm:<model>...works for any model LiteLLM supports.
Where to look
| Path | Why |
|---|---|
src/aobench/adapters/openai_adapter.py |
The closest existing shape — mirror it |
src/aobench/adapters/base.py |
The contract: BaseAdapter.run(context) -> Trace |
src/aobench/adapters/__init__.py |
Register the new adapter |
pyproject.toml |
Declare the optional extra, following how openai/anthropic are declared |
docs/guides/evaluating-your-own-agent.md |
Must be updated in the same PR |
Implementation hints
- Do not make
litellma hard dependency. Import it inside the function and raise a
clear "installaobench[litellm]" error, the way the existing adapters handle their
clients. - Tool calling is the part that will bite you. LiteLLM normalises tool-call schemas across
providers, but not perfectly. Get one provider fully green before broadening — a
working adapter for three providers beats a half-working one for ninety. - The
Tracemust carry token counts. The efficiency scorer and the CLEAR cost axis both
depend on them, and a trace without them scores wrongly rather than failing loudly.
Acceptance criteria
-
aobench run task --adapter litellm:<model> ...produces a scoreableTrace - Tool calls and tool results are recorded in the same shape as the
openaiadapter - Token usage is populated
- A missing dependency produces an actionable message, not an
ImportErrortraceback -
aobench list adaptersincludes it - Docs updated
Tests
tests/unit/ — a test with a mocked LiteLLM client asserting the Trace shape, following
the existing OpenAI adapter tests. No test may make a network call.
Difficulty
Roughly a day.
Getting started
Please comment before starting — the adapter-string format (litellm:<model> vs
litellm:<provider>/<model>) is worth agreeing on first, and I would rather spend five
minutes on that than have you redo it in review.
Activity
hoti-code commentedon Sep 1, 2026
Hi, I’m taking this one. I’ll follow the existing adapter patterns and start with the scope described in the issue. I’ll open a PR once I have the adapter and tests working.
hoti-code commentedon Sep 1, 2026
Quick scope check before I start: I plan to use
litellm:<model>and pass everything afterlitellm:directly to LiteLLM, including the provider prefix when needed—for example,litellm:anthropic/claude-sonnet-4-5. Does that match the intended format?MSKazemi commentedon Sep 8, 2026
Yes — that is exactly the right format, and thank you for checking before writing code
rather than after.
litellm:anthropic/claude-sonnet-4-5will work as written. The dispatch in_build_adapter(src/aobench/cli/run_cmd.py) splits the prefix off the first colononly and hands the remainder to the factory untouched:
So a provider prefix containing
/, and any further colons in the model tag, both passthrough intact. Register
"litellm": _make_litellmin_REGISTRYalongside the existingfour and you inherit the CLI surface for free.
Three things worth knowing before you start, none of them blocking:
_REGISTRYis not the only list.aobench list adaptersreads its own table insrc/aobench/cli/list_cmd.py, and the "Unknown adapter" error message inrun_cmd.pyspells the known prefixes out by hand in two places. A new adapter that updates only
_REGISTRYworks but is invisible and is missing from the error text. Please updateall of them — or, if you would rather fix the underlying duplication, that is welcome
too.
function, so that someone without
litellminstalled can still rundirect_qa.Please put it behind an optional extra in
pyproject.tomland raise a clear messagenaming the extra when the import fails.
verify an
anthropic/*route end-to-end. Please make the tests mock the LiteLLM callrather than requiring a live key, and mention in the PR which routes you actually
exercised against a real endpoint — I will take your word for it and say so in the
changelog.
Also worth a look:
openai_adapter.pyalready has an OpenAI-compatible base-URL path usedfor Ollama, so there is prior art for "one adapter, many providers" in the tree.
The issue is yours — thank you for taking it. Shout if anything in the trace or scoring
plumbing is unclear and I will answer quickly; a scope question like the one you just
asked is never a bother.
Optional, and no strings: if the project looks useful to you, a ⭐ helps it get found —
and when the adapter lands, do post about it under your own name. "Added ~100-provider
support to an HPC agent benchmark" reads well, and the credit should be yours.
MSKazemi commentedon Sep 9, 2026
A brief follow-up on credit rather than on the code — no action needed from you.
I audited every account that has ever interacted with this repository, looking for people
whose contribution was real but who appeared on none of the project's credit surfaces. Two
people fell through, and you were one of them.
You are now on the contributor
wall and in
AUTHORS.mdunder Work inflight, credited specifically for the thing that is easy to overlook: you asked whether
litellm:<model>with the provider prefix passed through was the intended format beforewriting any code. That is why this adapter will not need redoing in review, and it is a
better contribution than most first patches — it just does not look like one, because
nothing had to be fixed afterwards.
Two things that follow from it, and both are commitments rather than requests:
protected. It is in a live claims table on
#20, and the stated policy on both the
wall and that issue is now that nothing gets merged over a claim. That is written down
because it was broken once — a contributor claimed an issue and a parallel PR landed on
top of them four and a half hours later, and I never even replied. That will not happen
to you.
hit something awkward, just say so — that frees it for someone else and costs you
nothing. If you would rather not be listed on the wall at all, say the word and I will
remove the entry.
If any part of the trace plumbing, the token accounting or the scoring path is unclear, ask
here and I will answer quickly — the scope question you asked earlier was a good use of my
time, not an imposition, and so is the next one.
One optional aside and I will not raise it again: when the adapter lands, your wall entry
and the changelog line will both be public and linkable, and "added ~100-provider support
to an open HPC agent benchmark" reads well under your own name. Link your own pull request
rather than the repo — the credit is yours.