server: a control-vector variant, MODEL:NAME, that runs with the vector on

A request turns the control vector on with the `control_vector` body field, or the deployment's
default applies. A client that can only choose a model cannot send the field, and a gateway can
allow or refuse a model by its name but not a field. --control-vector-variant NAME lists
MODEL:NAME as a child of the model, the way an adapter is listed, and a request naming it runs
with the vector on whatever the default; the model's own name keeps the default. Unset, the
default, lists nothing.

The key needs --control-vector off or on. NAME keeps the rule model names keep (no ':' or
whitespace), and may not be a --lora adapter's name or the served model's own. The variant's
name with "control_vector": false is refused, since the request asks for both. With adapters
enabled the variant takes no adapter lookup, and /v1/load_lora_adapter refuses its name.

config_test 68, fleet_config_test 18 and server_test 191 cases pass, and the host suite
(ctest -LE 'gpu|oot') passes. On two R9700s at TP2 (Qwen3.8-Flash-Next IQR-V4 with the shipped
vector), through the front: /v1/models lists MODEL:uncensored and GET /v1/models/MODEL:uncensored
answers; a policy prompt to the variant is answered and to the model's own name refused; the
variant with "control_vector": false is a 400.
This commit is contained in:
keptn42 authored and StillDeadcode committed 2026-11-16 17:57:46 +01:00
1 parent aadabde0de
commit 157959fd80
10 files changed
+250 -10

No files matched your search

+6
View File
@@ -943,6 +943,12 @@ struct Config {
* default on. The graph is declared once, so this flag is the deployment's only decision about
* whether the op exists at all; the value names the startup switch. */
std::string control_vector = "disabled";
/* --control-vector-variant NAME: a second name for this model, listed as MODEL:NAME the way an
* adapter is, whose requests run with the vector on whatever the default; the model's own name
* keeps the default. Empty -- the default -- lists nothing, so a deployment that does not pick
* the vector by name sees no extra entry. A client that can only choose a model sends nothing
* else, and a gateway can allow or refuse the name. Needs --control-vector off or on. */
std::string control_vector_variant;
int64_t checkpoint_interval = 2048; /* linear-state checkpoints (spec §7.3) */
/* Checkpoint intervals one step may carry of a prefill alone in its step, from an interval
* boundary past the first (--prefill-span; 1 splits at every interval). The step's rows stay