Skip to content

Rebase/inference usage on meta eval - #118

Merged
kargibora merged 13 commits into
rebase/meta-eval-on-metricsfrom
rebase/inference-usage-on-meta-eval
Sep 15, 2026
Merged

kargibora merged 13 commits into
rebase/meta-eval-on-metricsfrom
rebase/inference-usage-on-meta-eval

Conversation

@kargibora

@kargibora kargibora commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Problem

JudgeArena discards token and cost information returned by model providers. Benchmark results therefore do not show the reported usage from generation and judging separately.

Changes

  • Collect input, output, total, reasoning, and cached token counts when available.
  • Collect provider-reported costs without estimating missing prices.
  • Count local vLLM input and output token IDs directly.
  • Report totals and coverage by stage and model.
  • Save a usage section in run-metadata.v1.json.
  • Print per-stage and total usage summaries.
  • Preserve existing text/structured outputs and synchronous/asynchronous inference behavior.

How it works

Model response
    -> RequestUsage
    -> active UsageTracker
    -> RunUsage snapshot
    -> console summary and run-metadata.v1.json

The benchmark runner starts one tracking scope. Nested scopes share the same tracker, and the scope is reset when the run finishes or raises an error.

Generation calls use the generation stage and judge calls use judging. Meta-evaluation judges stored completions, so it normally reports only judging usage.

Missing fields remain unknown. Coverage counts distinguish complete, partial, and unavailable usage. Malformed optional metadata does not prevent valid model responses from being returned.

Tracking scope

The tracker records successful responses returned by completed inference calls. These summaries describe observed usage, not a complete billing record. No benchmark scoring policy changes.

Tests

Tests cover canonical and fallback provider metadata, partial reporting, nested tracking, metadata output, failure cleanup, text/structured and sync/async compatibility, and local token counts.

.venv/bin/ruff check judgearena tests
.venv/bin/pytest -q

Result: 395 passed locally.

Raw diff

Relative to #117 at f30aac0. Parent changes are excluded. Pre-existing tests are restored; remaining test reductions apply only to stack-added coverage.

File type Added Deleted Changed
Production Python 438 21 459
Tests 135 1 136
README 4 0 4
Total 577 22 599

@kargibora
kargibora changed the base branch from main to rebase/meta-eval-on-metrics September 8, 2026 13:35
@kargibora
kargibora force-pushed the rebase/inference-usage-on-meta-eval branch from 58d6791 to d1ca639 Compare September 10, 2026 09:55
@kargibora
kargibora merged commit 97103d2 into main Sep 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants