control vectors: load only when the deployment asks

The graph is declared once, so whether the projection op exists cannot follow a per-request
switch. It follows a startup flag instead:

  --control-vector off       load the vector found for this model, requests default off
  --control-vector on        the same, requests default on
  --control-vector disabled  load nothing (also the default with no flag)

`disabled` declares no op, so an unprojected request costs the stock model's launches rather
than 41 empty ones; a request that asks for the vector is refused by name and the admin route
answers 404. `off`/`on` keep the per-request switch and the dashboard default.

Measured four ways on one box (stock, disabled, off, on -- one boot each, six 4,096-token answers,
speculation off): decode 85.1 / 86.1 / 83.7 / 82.8 tok/s. `disabled` is the stock graph, so there
is nothing to pay; `off` pays the 41 launches, `on` pays the projection. KLD mode serves no
request to carry the switch, so `--control-vector on` is how the projection itself is scored;
config_test covers the three states and the absent default.
This commit is contained in:
C_Tamas authored and StillDeadcode committed 2026-10-21 09:26:17 +02:00
1 parent b15cbb546d
commit f9d80d6cac
6 files changed
+89 -20

No files matched your search

+4
View File
@@ -794,6 +794,10 @@ The mode changes these settings itself:
Everything else comes from the command line: run every candidate with the same flags, and the
reference with the exact wire and a bf16 KV cache.
The control vector's switch is per request, and KLD mode serves none, so a deployment that has one
loaded is scored with it **off**. `--control-vector on` starts the deployment default on, which is how
the projection itself is scored (the switch still decides per request, and a request's false wins).
`--kld-out FILE` writes the report as JSON, and every position's KL, both NLLs and the argmax
agreement to `FILE.rows` (`[positions, 4]` f32, reference row order), so two candidates can be
compared position by position.