Skip to main content

tourney

PyPI Python CI License

Local-first benchmarking runner for AI models. Run your prompts against the field.

tourney runs your own prompts and datasets against multiple model APIs (your keys, your machine) and measures quality, latency, cost, and token usage — with the statistical rigor researchers expect: bootstrap confidence intervals, pinned model IDs, seeds, config hashes, and full run metadata in a local SQLite database. No hosted service, no telemetry.

Install

pip install "tourney[dashboard]"      # or plain `pip install tourney` for CLI/library only

Five-minute quickstart

tourney init            # scaffolds benchmark.yaml + cases.jsonl
tourney run benchmark.yaml
tourney show latest --failures
tourney serve           # local dashboard at http://127.0.0.1:8355

benchmark.yaml:

name: math-word-problems
models:
  - provider: openai
    model: gpt-4o-2024-08-06          # pin dated IDs for reproducibility
  - provider: anthropic
    model: claude-sonnet-5
  - provider: openai_compat           # anything OpenAI-compatible: Ollama, vLLM, OpenRouter...
    model: llama3.1:8b
    base_url: http://localhost:11434/v1
defaults: {temperature: 0, max_tokens: 256, seed: 42}
prompt:
  system: "Answer with only the final number."
  user: "{{ question }}"              # Jinja2 over each case's input
dataset: {path: cases.jsonl}
graders:
  - {type: numeric, tolerance: 0.001}
run: {concurrency: 8, retries: 3, timeout_s: 60}

API keys come from environment variables (OPENAI_API_KEY, ANTHROPIC_API_KEY, or a custom api_key_env) — never from config files.

math-word-problems · run 01J9X4… · $0.213
┌──────────────────────┬───────┬──────────────┬─────────┬─────────┬─────────┬────────┐
│ model                │ score │ 95% CI       │ p50 lat │ p99 lat │ cost    │ errors │
├──────────────────────┼───────┼──────────────┼─────────┼─────────┼─────────┼────────┤
│ claude-sonnet-5      │ 0.960 │ [0.89, 1.00] │   944ms │  2107ms │ $0.0920 │      0 │
│ gpt-4o-2024-08-06    │ 0.940 │ [0.86, 0.98] │   812ms │  2431ms │ $0.1210 │      0 │
└──────────────────────┴───────┴──────────────┴─────────┴─────────┴─────────┴────────┘

Why another eval tool?

  • Local-first. Results live in ./.tourney/results.db (SQLite). Copy it, query it, commit exports.
  • Reproducible. Config hash, tourney/Python versions, and git commit stored per run. Deterministic graders by default; stats are seeded.
  • Cheap to iterate. Responses are content-address cached — rerunning an unchanged benchmark costs $0.
  • CI-native. tourney run --json --fail-under 0.85 exits non-zero when a model regresses.
  • Honest statistics. Bootstrap CIs over cases; errors score 0 instead of being dropped.

Graders

type what it checks
exact_match normalized string equality (normalize: [strip, lowercase, collapse_whitespace])
contains substring presence
regex pattern match (pattern:)
numeric last number in the response vs expected, within tolerance
json_schema output is valid JSON, optionally conforming to schema:

Multiple graders per benchmark average into the case score. LLM-as-judge is planned as strictly opt-in.

Library

import tourney

result = tourney.run("benchmark.yaml")
result.summary()      # per-model dicts: score, CI, latency percentiles, cost
result.to_records()   # per-completion rows -> pd.DataFrame(result.to_records())

CLI reference

tourney init                     scaffold a new benchmark
tourney run <config>             run it (--model, --limit, --no-cache, --json, --fail-under)
tourney list                     recent runs
tourney show <run|latest>        summary table (--failures for the failing cases)
tourney export <run> --format    jsonl | csv | md
tourney serve                    local dashboard (requires tourney[dashboard])

Extending

Third-party providers and graders register via entry points (tourney.providers, tourney.graders) — publish a package with a Provider or Grader subclass and it becomes available by name in configs. A mock provider ships in the box for dry runs and tests.

Development

pip install -e ".[dev]"
pytest        # fully offline — network is disabled in the test suite

Apache-2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tourney-0.1.1.tar.gz (36.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tourney-0.1.1-py3-none-any.whl (40.1 kB view details)

Uploaded Python 3

File details

Details for the file tourney-0.1.1.tar.gz.

File metadata

  • Download URL: tourney-0.1.1.tar.gz
  • Upload date:
  • Size: 36.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tourney-0.1.1.tar.gz
Algorithm Hash digest
SHA256 021ad25cc2d6b0bcb6b8d204769f354800563321e93b26f9eb0c6bdcb567d7d5
MD5 47df453508ae388b36f7425a77bbd5be
BLAKE2b-256 b704076c61fc7cd3f6d44ef3cc4a90ea789cd3549040e1489f33f54dac3b2717

See more details on using hashes here.

Provenance

The following attestation bundles were made for tourney-0.1.1.tar.gz:

Publisher: release.yml on k-rthik/tourney

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tourney-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tourney-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for tourney-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c5ae09260e0190cc2181d95c89d4bb9698716368ff964909adfed3134645434
MD5 94f96746dfbcbdb4e60ae0b308599a6d
BLAKE2b-256 0ea0c093c0e5a11e2cb93c425ee01776e71cf955bb87bad544537a8b5488fd4a

See more details on using hashes here.

Provenance

The following attestation bundles were made for tourney-0.1.1-py3-none-any.whl:

Publisher: release.yml on k-rthik/tourney

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page