Skip to content

Online calibration

Online calibration observes the activations of a live model quantized with ISQ (in-situ quantization), builds an importance matrix from that traffic, and requantizes the tracked layers. The layers are replaced without restarting the server. The model continues serving while statistics are collected; requests received during the apply step wait until it finishes.

Serve any model with ISQ:

Terminal window
mistralrs serve -m <model> --isq q4k

Online calibration also accepts an exact compatible GGUF source:

Terminal window
mistralrs serve -f /path/model-BF16.gguf --isq q4k

Then drive the lifecycle on the surface of your choice. There is no CLI command for the lifecycle itself; it is driven over HTTP or from an SDK against the running server.

Terminal window
# begin observing live traffic; collection adds some decode overhead while on
curl -X POST localhost:1234/calibration/start
# check per-layer collection progress
curl localhost:1234/calibration/status
# requantize from the source weights with the collected statistics and hot-swap
curl -X POST localhost:1234/calibration/apply \
-H "Content-Type: application/json" \
-d '{"save_cimatrix": "traffic.cimatrix"}'

status reports how many layers are collecting and the token rows seen per layer. apply harvests the statistics, requantizes, and returns the pre-apply status. The optional save_cimatrix writes the collected importance matrix for reuse with --imatrix.

Activation collection is inactive until start and stops after apply.

  • The model must have been loaded with --isq from a supported safetensors or GGUF source; start errors otherwise, including models loaded --from-uqff.
  • Importance weighting applies to the K-quant types (Q2K-Q6K). Other Q types and AFQ collect and requantize without using importance weights. HQQ, FP8, F8Q8, and MXFP4 do not support collection, so start returns an error.
  • Safetensors layers are reloaded from the source checkpoint when possible. GGUF layers are reloaded from the selected GGUF artifact. Layers that cannot be reloaded fall back to their resident quantized weights; apply logs the fallback count.
  • Requantizing an already quantized GGUF or a resident quantized layer can compound quantization loss. Use a high-precision source when output quality is the priority.