Skip to content

About

This repo hosts code for Pie CI & Performance Benchmark infrastructure.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Pie Bench is an open, apples-to-apples benchmark for LLM inference. vLLM, SGLang, TensorRT-LLM, llama.cpp, MLX, Ollama, MLC, pie and friends: same weights, same prompts, same silicon, pinned versions. Datacenter GPUs, TPUs, Apple Silicon, browsers and phones. Ship a kernel, watch it land. Spot a gap, go close it.

Reproducible by default. One command sizes up the box, picks the models that fit in memory, installs every engine at its pinned version, runs the sweep, and uploads a signed submission to benchmarks.pie-project.org.

Every gap over 25% is re-measured under an end-to-end GPU profiler on fresh prompts. It's marked verified only if the profile agrees with the benchmark within 10%; otherwise it's rerun. Details in the Bench Book.

Install

pip install pie-bench
pie-bench doctor

Needs Python 3.11+, git, Rust and uv: Apple Silicon on a Mac, NVIDIA or AMD GPUs on Linux, or a Cloud TPU. Or run it in the Docker image for your cloud; see docker/.

Run a benchmark

pie-bench plan                                   # what would run here
pie-bench run                                    # measure and upload
pie-bench run --models qwen3.6-35b               # only some models
pie-bench run --engines pie,llamacpp             # only some engines
pie-bench run --pie 0.6.0                        # a pie release, branch or commit
pie-bench run --no-upload                        # keep the results local
pie-bench upload ~/.pie-bench/runs/<time>        # upload later
pie-bench quality --models <artifact id>         # model accuracy on question sets

Nothing is sent while a run measures. Each run writes one folder under ~/.pie-bench/runs/:

  • records.jsonl: one line per measured cell
  • run.log: the full log, for audit and debugging
  • submission.json.gz: both, with machine specs and versions; this is what gets uploaded

Uploads need a token, made the first time (pie-bench login) and kept in ~/.config/pie-bench/token.

Results and the API

The site is a static page that reads the API. Reads are public JSON, rebuilt after each upload; writes need a token with an upload quota.

Method Path What
GET /healthz service health
GET /v1/machines every machine, with its chip, memory and bandwidth
GET /v1/models every model
GET /v1/engines every engine, with its pinned version
GET /v1/workloads every workload
GET /v1/releases the published releases
GET /v1/suites the models each suite measures
GET /v1/quality accuracy scores, with /v1/quality-tasks, -parity, -kernels and -gaps
GET /v1/no-fit, /v1/speed-gaps, /v1/parity, /v1/install, /v1/totals models that don't fit each machine, open gaps, parity, install sizes per engine, run totals
GET /v1/results the newest release: its results and quality scores
GET /v1/releases/latest the same as /v1/results
GET /v1/head-to-head pie against each engine, per platform
GET /v1/footprint download size of pie, vLLM and SGLang
GET /v1/profiles each grid cell's forward-pass profile of its two fastest engines
POST /v1/tokens a signed upload token
POST /v1/submissions upload a submission.json.gz
POST /v1/profiles upload the profiles a pie-bench run made

Run the API locally against Postgres:

uv venv && uv pip install -e ".[dev,server]"
docker run -d -p 5432:5432 -e POSTGRES_PASSWORD=pie postgres:16-alpine
DATABASE_URL=postgresql://postgres:pie@localhost/postgres JWT_SECRET=$(openssl rand -hex 32) \
  .venv/bin/uvicorn server.app:app --port 8790
PIE_BENCH_API=http://localhost:8790 pie-bench run

render.yaml deploys the API and its database on Render.

Phones

The phone app runs the phone workloads on iPhone and Android with pie, llama.cpp, LiteRT-LM, MLC LLM and MLX Swift, on the same prompts as the Macs. pie-bench import-phone turns its shared records.jsonl into a submission, shown on the site's Mobile page. The import computes every number with the harness's own code, as for a Mac run, and keeps the median round; it trusts nothing the phone derived. A phone not listed in src/pie_bench/matrix/phones.yaml is stored as <os>-<model>.

Repository layout

src/pie_bench/       the pie-bench package and CLI
  matrix/            what exists: engines and their pins, machines, models, workloads
  plan/              the cells a machine runs, grouped into jobs
  engines/           one driver per engine, with its recipes
  clients/           the bench scripts, run in each engine's own interpreter
  runner/            boots an engine, runs the rounds and checks them
  installers/        builds pie and installs every other engine at its pin
  checkpoints/       model snapshots, slices and format conversions
  accuracy/          checks each engine's output against a reference
  metrics/           stats and fairness checks on the raw timings
  quality/           model accuracy on question sets
  profiler/          reruns a cell's two fastest engines under a device profiler
  schema/ results/   the record format, and local or Postgres storage
server/              the results API, deployed by render.yaml
web/                 the site at benchmarks.pie-project.org
mobile/              the phone app: ios/, android/ and the shared workloads
docker/              one image per cloud

Develop

uv venv && uv pip install -e ".[dev,server]"
.venv/bin/ruff check src server
.venv/bin/ruff format --check src server

src/pie_bench/matrix declares what exists: engines and their pins, machines, models and workloads. To add an engine, add its driver under src/pie_bench/engines, its client under src/pie_bench/clients, and its entry in matrix/engines.yaml. A version tag (git tag v0.1.4 && git push --tags) runs the release workflow, which builds the wheel and sdist for PyPI and a GitHub release.

Community & License

Discord · Issues · Discussions · Contributing

Apache License 2.0 (NOTICE).

About

This repo hosts code for Pie CI & Performance Benchmark infrastructure.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages