Is this endpoint really serving the model it claims?
When you call "Qwen3.8-27B" or "gpt-oss-20b" through an API, you are trusting the provider. They might serve a harsher quantization, a smaller model, skip part of the computation, inject a system prompt, or have a bug in their output path. This repo checks, as rigorously as the evidence allows, and is explicit about where the checks stop.
Two modes, the second with a stricter exact tier:
- Black-box audits of any OpenAI-compatible endpoint (e.g. every provider of a model on OpenRouter). A referee running the true weights replays each reply and measures how well the tokens (and logprobs, when offered) fit the real model. Results are published per provider as distances with confidence intervals, a 0-100 fidelity score, and integrity flags.
- Cooperative mode (the llmverify protocol) for providers that opt in by running the llmverify provider (or implementing the receipt spec in their own engine). Every reply comes with a signed receipt over the exact prompt tokens, output tokens and top-20 logprobs, sampled with a public seeded rule the client controls. Tampering, hidden prompts, laundered logprobs and grinding become exact failures, not statistics, and any reply can be re-checked by any referee later.
- Exact tier, for cooperative providers on vLLM in batch-invariant mode: a referee on any GPU of the same group (Ampere/Ada: RTX 3090/4090, A6000, A100, L40S; Blackwell: RTX 5090, RTX PRO 6000, DGX Spark) reproduces every committed number to the last digit in one scoring pass. Measured: 0 false alarms in over 300,000 honest tokens, every edited reply caught at the edited token. See docs/exact-tier.md and docs/vllm.md.
What this can and cannot prove is the most important document here. Results so far:
experiments/README.md, and as a website at
zoan.space/llm-verification — including our
21-Provider + Big Tech (Apple PCC & Google Oak) Confidential AI Scorecard,
4-Engine Silent Log-Leak Study (SGLang, vLLM, llama.cpp, Ollama),
Chart-Vision Token Ceilings & max_images Study, and
4-of-4 Offline Browser WebCrypto TEE Verifier (AMD SEV-SNP + Intel TDX DCAP v4/v5 + NVIDIA Hopper/Blackwell SPDM/RIMs + AWS Nitro COSE_Sign1).
Guides: black-box method, cooperative mode, receipt spec, vLLM integration, SGLang integration, Apple Silicon MLX integration, running an exact tier, deployment readiness.
At every step a language model assigns probabilities to every possible next token. A referee running the claimed
weights can compute those probabilities for an existing reply in one forward pass (much cheaper than generating
it), then ask: are these the tokens this model would choose (regret)? Do the provider's reported probabilities
match (wgap)? Is sampled text distributed like this model's samples (PIT and likelihood tests, which need no
calibration)? Different hardware usually computes slightly different numbers (floating-point order differs), so
these verdicts compare against measured honest noise and known cheats run through the same pipeline. Where provider
and referee run batch-invariant kernels on GPUs of one group, the numbers agree exactly and any difference is proof.
| Path | What |
|---|---|
llmverify/sampling.py |
public decoding rule: greedy or seeded Gumbel-max |
llmverify/metrics.py, stats.py, power.py |
per-token metrics; bootstrap CIs, PIT/likelihood tests, anytime-valid e-process triad (EProcess, ChangepointEProcess, TailSpikeEProcess, CombinedEProcess), power & audit-cost calculator |
llmverify/receipt.py, provider.py, server.py, client.py |
cooperative mode: signed receipts, generation, OpenAI-compatible server, verifying client |
llmverify/merkle.py, guard.py |
compact binary Merkle span proofs (LVM1+zlib) and VerifyBeforeActGuard (RiskPolicy) for pre-execution tool-call verification |
llmverify/tee.py, gpu_attest.py, tdx_attest.py, nitro_attest.py |
zero-KMS ephemeral E2EE SEV-SNP demo server + 4-of-4 offline zero-oracle silicon verifiers: AMD SEV-SNP, Intel TDX DCAP v4/v5 (TDX 1.5), NVIDIA Hopper/Blackwell SPDM + XML-DSig CoRIM/SWID RIMs, and AWS Nitro Enclaves CBOR/COSE_Sign1 P-384 |
llmverify/xray.py, gauntlet.py, measure.py |
Universal 4-Root Confidential AI X-Ray (llmverify xray, auto-detecting all 4 silicon roots + CPU↔GPU splice binding + fresh-nonce replay defense + reproducible --manifest pinning + HTML passport), Reproducible Enclave Measurement Engine (llmverify measure + enclave/ for SEV-SNP LAUNCH_DIGEST, TDX MRTD/RTMR, Nitro PCR0..2), 42-Vector TEE Verifier Gauntlet (llmverify gauntlet), and llmverify privacy CLI |
llmverify/consensus.py, vision_canary.py |
Zero-GPU Referee-Free Multi-Provider Consensus & Shared-Backend Forensics (llmverify eval-model, llmverify diff, standalone HTML scorecard with explicit epistemic caveat) + Pure-Stdlib Vision Token-Ceiling & max_images Canary (llmverify vision-canary) |
llmverify/vllm_rule.py, sglang_rule.py, mlx_rule.py, upstream.py |
the sampling rule for vLLM, SGLang (CustomLogitProcessor), and Apple Silicon MLX (MlxRuleSampler + MlxEngine); signing front end for vLLM, SGLang, llama-server, or MLX |
llmverify/audit.py |
challenges, referee audits, multi-referee corroboration, honeypots, per-provider evidence ledger |
llmverify/attacks.py |
cheating providers (swap, laundering, confident draft, KV/context truncation, sampler skew, lossy vs lossless speculative decoding, multi-turn tool-history tamper, prompt injection, grinding, tie steering, covert channel, part-time) |
llmverify/openrouter.py, blackbox.py, localgen.py, report.py |
black-box audits of OpenRouter endpoints |
llmverify/toy.py |
tiny synthetic LM with the engine interface, for tests |
engine/lv_engine.cpp |
llama.cpp front end: one-pass scoring with full-vocabulary statistics, step-wise generation |
experiments/ |
collection/scoring/report scripts and results per model; vllm_exact_receipts.py, calibration_probe.py for the exact tier; experiments/vision_charts/ for high-res chart-vision token ceilings, 39-endpoint GLM-5.3 Flash sweep, and undocumented per-endpoint max_images / multi-image scaling audits |
calibration/ |
canonical answers per model and GPU group, for admitting nodes to an exact tier |
site/ |
static results site generated from results/ |
docs/ |
soundness and threat model, receipt spec |
# Install directly (exposes the `llmverify` CLI)
uv venv && uv pip install -e ".[dev]"
# or from GitHub: pip install git+https://github.com/zoan37/llm-verification
llmverify demo --html demo.html # 1-second zero-GPU showcase + standalone HTML scorecard
llmverify doctor # check Python deps, GPU, lv-engine binary, API keys
llmverify replay bundle.json --key HEX # offline verification of a signed receipt + Merkle SpanProof
pytest -q # full test suite on the toy model, no GPU needed
# build the C++ referee engine against a llama.cpp checkout
cmake -S engine -B engine/build -DLLAMA_CPP_DIR=/path/to/llama.cpp -DCMAKE_BUILD_TYPE=Release
cmake --build engine/build -j
# audit every OpenRouter provider of a model (needs ~/.config/openrouter/api-key)
python experiments/collect.py --model openai/gpt-oss-20b --reasoning-effort low --budget-usd 5
python experiments/score_model.py --model openai/gpt-oss-20b --chat harmony --reasoning \
--engine "engine/build/lv-engine -m gpt-oss-20b-MXFP4.gguf -c 8192"
python experiments/build_results.py --model openai/gpt-oss-20b --referee "..." --anchor "..."
# or vet all OpenRouter providers of any model with ZERO GPU (consensus + shared backends + invariants + HTML scorecard)
llmverify eval-model --model deepseek/deepseek-v4.1-flash --n 16 --budget-usd 1.5 --out ds.json --html ds.html
llmverify diff old.json new.json --fail-on-regression # on-demand drift diff
llmverify vision-canary --base-url https://openrouter.ai/api/v1 --model z-ai/glm-5.3-flash # vision ceiling & max_images canary
# or audit one OpenAI-compatible endpoint directly against a referee (zero C++ build needed with llama-server or vLLM!)
llmverify audit --base-url https://host/v1 --model NAME --logprobs \
--referee http://127.0.0.1:8080 --html audit_report.html
# or wrap any untrusted / confidential OpenAI API with a drop-in Verify-Before-Act + TEE X-Ray guard proxy!
llmverify proxy --upstream https://host/v1 --referee http://127.0.0.1:8080 --port 8099 \
--tee-attestation-url https://host/v1/attestation/report --require-gpu-binding
# blocks unattested/DEBUG/GPU-spliced upstreams pre-forward (HTTP 503) & hijacked tool calls (HTTP 409)
llmverify measure tdx --firmware OVMF_TDVF.fd --weights model.gguf --manifest-out manifest.json # reproducible enclave manifest
llmverify xray https://host/v1/attestation/report --manifest manifest.json --require-gpu-binding --html passport.html
llmverify gauntlet --html gauntlet.html # 42-vector adversarial TEE verifier gauntlet
llmverify privacy --engine sglang -- --disable-radix-cache # 4-engine silent log-leak & KV-bleed CI gateUsing a coding agent (Claude Code, Codex, Cursor, etc.)? Point it at this repo — AGENTS.md gives it the exact setup, auditing, and VerifyBeforeActGuard recipes.
Early and moving fast. Results are snapshots (providers change deployments without notice), prompt sets are small, and honest baselines cover a handful of machines. Contributions of honest baselines on more hardware, new attacks, and counterexamples to any claim are especially welcome.
MIT; see LICENSE.