lm-sys / lm-sys/RouteLLM

Portable format for router benchmark results (EvalPort) — worth exporting alongside the plots?

Open
#93 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
5.5k
Forks
433
PR merge metrics
No merged PRs in 30d

Description

Hi RouteLLM maintainers,

Read through `routellm/evals/evaluate.py` and the `Benchmark`/`Router` abstractions in the README. The evaluation loop is nice: for each router, `benchmark.evaluate(controller, router, num_results, ...)` yields `(threshold, accuracy, model_counts, total)` tuples, which `evaluate.py` turns into a `strong_percentage`/`accuracy` DataFrame per method, then derives `AUC` and `APGR` metrics and a matplotlib plot per benchmark (`{output}/{benchmark_name}.png`).

That's exactly the kind of result set that's useful outside the plot too — e.g. handing router-quality numbers to someone comparing RouteLLM against a different routing/eval setup, or archiving results across router versions in a diffable way, without re-parsing the printed "Model %:" lines or the cached per-benchmark pickle files.

I maintain EvalPort (https://github.com/adhabnr-ux/evalport), a small open spec — JSON Schemas under `spec/schemas/` (`resultset.json` in particular) plus Python/TS SDKs — for representing exactly this kind of scored-run output (test case id, score, grader/method metadata) in a form that isn't tied to one project's DataFrame layout.

A minimal adapter would just sit next to `generate_results()` and reshape the existing `all_results` rows:

```python
def to_resultset(df_router_result: pd.DataFrame, benchmark_name: str) -> evalport.ResultSet:
return evalport.ResultSet(
suite_id=benchmark_name,
results=[
evalport.Result(
test_case_id=f"{row.method}@{row.strong_percentage:.1f}",
score=row.accuracy,
grader=row.method, # e.g. "mf", "sw_ranking", "random"
)
for row in df_router_result.itertuples()
],
)
```

Spec: https://github.com/adhabnr-ux/evalport/blob/main/SPEC.md

Not proposing a dependency on RouteLLM's core — happy to build and maintain this as a small standalone script/adapter if it'd actually be useful to anyone comparing routers across tools. If not, feel free to close — no pressure. Thanks for RouteLLM, the `mf`/`sw_ranking`/`bert`/`causal_llm` router comparison setup is a clean piece of work.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with routellm/evals/evaluate.py, especially generate_results(), and review the Benchmark/Router abstractions in the README. Check EvalPort's resultset.json schema and determine whether the existing all_results rows can be exported by a standalone adapter. Done means the proposal's usefulness and output shape are agreed, with a portable result set that represents the benchmark results without changing RouteLLM core.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
analytics, data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
54/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.