> ## Documentation Index
> Fetch the complete documentation index at: https://docs.infercrane.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prove a change between two endpoints

> Put your current setup and a new one, each on a server you run, through InferCrane's proof on your own machine: paired measurement, answer check, a verdict, and a signed document that says what it could not control.

`infercrane proof compare` runs InferCrane's proof on two OpenAI-compatible endpoints you already
run: your current setup and a new one. The new setup can be anything a server can serve: an engine
flag, a newer engine release, a quantized checkpoint, a custom kernel, or a checkpoint trained
elsewhere. It runs on this machine. It needs no InferCrane account, no sign-in, and no control
plane, and it starts nothing on your GPUs.

```bash theme={"theme":"css-variables"}
infercrane evaluation keygen --file proof.key
infercrane proof compare \
  --baseline http://gpu-a:8000 --candidate http://gpu-b:8000 --model Qwen/Qwen3-8B \
  --key proof.key --out proof.json
infercrane proof verify proof.json
```

> [!NOTE]
>
> The speed part needs [AIPerf](https://github.com/ai-dynamo/aiperf) **exactly 0.12.0** on this
> machine. A plain `pip install aiperf` installs a newer version, which the command refuses.
> Install the pinned one with `pip install aiperf==0.12.0` or
> `uv tool install --python 3.12 aiperf==0.12.0` (AIPerf 0.12.0 needs Python 3.11 to 3.13).
> `--skip-speed` checks answers alone without AIPerf. See [What you need](#what-you-need).

> [!WARNING]
>
> The command sends load to both servers: by default five runs of 100 requests to the current setup
> and four to the new one, plus a warm-up for each, and then every item of the eval set to both.
> Point it only at servers you run, and not at a server that serves production traffic unless that
> load is acceptable there.

## What it does

The same code an [optimization run](https://docs.infercrane.com/features/optimization.md#how-a-campaign-measures-candidates) uses,
called on your URLs instead of on servers InferCrane started:

1. **Asks each server what it serves.** `GET /v1/models`, and the engine version where the server
   reports one (`GET /version` on vLLM). Each answer is recorded as the server reported it.
2. **Measures them side by side.** After a warm-up of each, AIPerf runs the current setup, then the
   new setup, then the current setup again, and so on: four runs of the new setup, each between two
   runs of the current one (`--pairs`), every run with its own seed. The run's judge reads the window:
   each run of the new setup against the mean of the two runs around it, with a 95% interval that
   always allows 0.75% for two servers differing. A failed run, or current-setup runs that drift
   more than 15% apart, void the window.
3. **Applies the guards.** A new setup whose answers are more than 5% shorter is blocked, whatever
   it gained: shorter answers finish sooner. A limit you set (`--ttft-limit-ms`, `--tpot-limit-ms`)
   that the new setup's p95 misses blocks it too.
4. **Checks the answers.** Both servers answer the eval set with greedy decoding. Without
   `--eval-set` it is the built-in prompts, scored by agreement with the current setup's answers
   (`PASS` for a drop up to 5%, `WATCH` to 10%, `BLOCK` above). A
   [task set](https://docs.infercrane.com/features/semantic-quality.md#task-sets) is scored right or wrong on each item and
   compared item by item. With `--changes-answers` (other weights or precision), the new setup passes
   only when its answers are shown to hold within 1 point.
5. **Gives a verdict** by rules fixed before anything was measured. The document records the rules
   and their digest.

## The verdict

| Verdict | When | Exit status |
| - | - | - |
| `BLOCK` | The objective got worse, a guard fired, a limit was missed, or the answers got worse. | Non-zero |
| `UNKNOWN` | The window was void, the answers could not be compared or were not shown to hold, or a part was skipped. | Non-zero |
| `WATCH` | The answers drifted 5% to 10% on the agreement check. | Zero, or non-zero with `--on-watch fail` |
| `PASS` | Everything else, including no measurable difference: this is a regression check, so a gain is reported but not required. | Zero |

Unknown never passes, and a measured regression outranks unknown. The objective is output
throughput unless `--objective` names another measured metric: `ttft_p95_ms`, `tpot_p95_ms`,
`latency_p95_ms`, `request_throughput`, `goodput`, or `useful_output_throughput`.

## Measure how far two servers differ

Two servers of one setup do not run at exactly the same speed. With long prompts the difference has
been under 1%; with short prompts at high load, 3% to 15%. Start a second server of your current
setup and pass it as `--copy`:

```bash theme={"theme":"css-variables"}
infercrane proof compare --baseline http://gpu-a:8000 --candidate http://gpu-b:8000 \
  --copy http://gpu-c:8000 --model Qwen/Qwen3-8B --require-copy
```

The copy is measured against the current setup in a window of its own. How far it measured from the
current setup is the allowance for two servers in every decision, when it is larger than 0.75%. A
gain smaller than what two servers of one setup differ by becomes no measurable difference.
`--require-copy` refuses to run without one.

## A new checkpoint or precision

For a setup that serves other weights or another precision, a quantized checkpoint or a checkpoint
trained elsewhere, pass `--changes-answers` with a task set. The repository ships two ready ones in
[`examples/evaluation`](https://github.com/infercrane/infercrane/tree/main/examples/evaluation):
`gsm8k-mmlu-1000.task-set.json`, 500 GSM8K math problems and 500 MMLU multiple-choice questions
(both MIT; sources and licences in that folder's README), and `gsm8k-mmlu-200.task-set.json`, its
first 200 items for a quicker first run. Each item asks for worked answers of up to 1,024 tokens, so
a run takes longer than the built-in check. Download one and pass it:

```bash theme={"theme":"css-variables"}
curl -fsSLO https://raw.githubusercontent.com/infercrane/infercrane/main/examples/evaluation/gsm8k-mmlu-1000.task-set.json
infercrane proof compare --baseline http://gpu-a:8000 --candidate http://gpu-b:8000 \
  --model Qwen/Qwen3-8B --candidate-model Qwen/Qwen3-8B-FP8 \
  --eval-set gsm8k-mmlu-1000.task-set.json --changes-answers --divergence
```

Two quantizations of one GGUF model in two `llama-server` processes, each started with the same
`--alias`:

```bash theme={"theme":"css-variables"}
infercrane proof compare --baseline http://127.0.0.1:8080 --candidate http://127.0.0.1:8081 \
  --model my-model --eval-set gsm8k-mmlu-1000.task-set.json --changes-answers
```

One pair of servers answering 1,000 items gives an interval about ±1.5 points wide, and 200 items
a wider one, so answers held within 1 point often cannot be shown either way; the verdict is then
`UNKNOWN`, never a pass.

`--divergence` also reads the [KL divergence](https://docs.infercrane.com/features/semantic-quality.md#divergence-of-a-precision-change)
of the new setup's next-token distribution from the current setup's. It is evidence and decides
nothing. It is read only when both endpoints serve the same model name, because only then are they
known to read text with the same tokenizer; otherwise the document says it is unknown and why. Build
a task set from your own requests with
[`infercrane evaluation set build`](https://docs.infercrane.com/features/evals-from-your-traffic).

## What a proof on your endpoints cannot control

An optimization run starts each setup on a fresh server of its own and measures a gain again on new
servers before it counts. A proof on servers you run cannot do either. Every document lists what it
could not control, in a section the text output prints too:

* **Each setup on its own server** is your declaration. The command refuses two URLs that name the
  same host and port, but one URL can front a shared server or several replicas.
* **Hardware** behind each URL is not observed.
* **What the new setup changes** is your declaration: engine flags, image, and weights are not read.
* **Fresh servers** are not measured: each server is measured once.
* **Other traffic** on the servers is not excluded beyond the 15% drift check.
* **Latency** includes the network path from this machine.
* **Cost** is not measured, so the document states no cost and no saving.
* **The machine difference** is not measured without `--copy`.

The document's `attestation` is `self_measured`: InferCrane's code measured on your machine, against
servers you started, signed with your key. The signature shows the document was not changed after it
was signed. It does not show an independent measurement.

## The document

`--out FILE` writes the document as JSON, and `--output json` prints it.
It never holds an API key, a prompt, or an answer: answers are compared in memory and the document
keeps scores and a digest of them. It holds:

| Part | What it holds |
| - | - |
| `baseline`, `candidate`, `copy` | Each URL without credentials, the model name, the models and engine version the server reported. |
| `rules`, `rules_digest` | The objective and the rules, fixed before measuring. |
| `load` | Requests, requests at once, input and output tokens, pairs, and limits. |
| `speed` | Every run, the paired comparison of each metric (change, noise floor, decision), the copy's window, the allowance and where it came from, the guards, and any limit missed. |
| `answers` | The eval set and its digest, the rule, the verdict with its message, the task comparison, tool-call scores, the divergence, and `reasoning_only`: how many of each side's answers were reasoning with no text although the server was asked to turn reasoning off. With any, the answers are not compared and the verdict is `UNKNOWN`. |
| `verdict`, `reasons` | The verdict and every finding, blocking ones first. |
| `not_controlled` | What the proof could not control. |
| `rerun` | The command that measures the same plan again, without the key or the output file. |
| `report_digest`, `signature` | SHA-256 of the report's compact JSON with the digest emptied, and the Ed25519 signature over it. |

`infercrane proof verify FILE` recomputes the digest from the file's bytes and checks the signature,
offline. `--public-key KEY` also checks that a key you trust signed it; the signature carries the
signer's public key. Whitespace does not matter; any other change fails.

## What you need

* Two OpenAI-compatible servers (vLLM, SGLang, llama.cpp's `llama-server`, Ollama, or another
  server with `/v1/chat/completions`) that you run, each serving its setup.
* [AIPerf](https://github.com/ai-dynamo/aiperf) 0.12.0 on this machine, as `aiperf` or named by
  `--aiperf`, for the speed part. Install exactly that version with `pip install aiperf==0.12.0`
  or `uv tool install --python 3.12 aiperf==0.12.0` (Python 3.11 to 3.13); a plain
  `pip install aiperf` gets a newer one, which the command refuses.
  `--skip-speed` checks answers alone, and the verdict is then `UNKNOWN`.
* A key both servers accept in a variable named by `--api-key-env`, or one per server with
  `--baseline-key-env` and `--candidate-key-env`. Keys go to the servers only.

Each AIPerf run is cut off after `--run-timeout` (15 minutes); a run that does not finish voids the
window.

## Next

* [Semantic quality evidence](https://docs.infercrane.com/features/semantic-quality.md): eval sets, task sets, and the divergence
* [How a run measures setups](https://docs.infercrane.com/features/optimization.md#how-a-campaign-measures-candidates)
* [Proof Report](https://docs.infercrane.com/features/proof-report.md): the document of runs InferCrane measured on servers it started


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.