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

+7
View File
@@ -3447,6 +3447,13 @@ int Engine::run_server() {
o.plugin_words = ranks_.empty() ? 0 : ranks_[0]->program.plugin_words;
o.model_id = !cfg_.served_model_name.empty() ? cfg_.served_model_name
: meta_.name && *meta_.name ? meta_.name : "radiance";
o.control_vector_variant = cfg_.control_vector_variant;
if (!o.control_vector_variant.empty() && o.control_vector_variant == o.model_id) {
RAD_ERR("--control-vector-variant '%s' is the served model's own name, so a request "
"naming it would run the default; rename it or give --served-model-name",
o.model_id.c_str());
return RAD_E_INVAL;
}
o.host = cfg_.host;
o.port = cfg_.port;
o.api_key = cfg_.api_key;