control-plane wire.rs builds GEN/GENI lines through RequestSampling::gen_keys plus strata_tune and the per-request cvec switch (golden-tested against the real StrataEngine.generate); Responses, Chat Completions and Messages accept and validate top_k, min_p, repetition/frequency/presence penalties, penalty_last_n, seed and the engine knobs with the Original's defaults and ranges; server-wide defaults (config sampling block plus POST /settings shared values) merge under the request. The desktop runtime gRPC contract carries the full sampling set and the gateway no longer refuses temperature != 0. New crate leleka-serving-policy holds the pure Original policies (shared settings, reasoning budget tracker, fixed-point sampling conversion) with fixtures generated by running the Python handlers. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
632 lines
9.4 KiB
JSON
632 lines
9.4 KiB
JSON
{
|
|
"source": "serve/server.py clean_shared_defaults / sampling_defaults_from_config (real code)",
|
|
"clean": [
|
|
{
|
|
"input": null,
|
|
"ok": {}
|
|
},
|
|
{
|
|
"input": {},
|
|
"ok": {}
|
|
},
|
|
{
|
|
"input": [],
|
|
"error": "defaults must be an object"
|
|
},
|
|
{
|
|
"input": "x",
|
|
"error": "defaults must be an object"
|
|
},
|
|
{
|
|
"input": 5,
|
|
"error": "defaults must be an object"
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 0.7
|
|
},
|
|
"ok": {
|
|
"temperature": 0.7
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 1
|
|
},
|
|
"ok": {
|
|
"temperature": 1.0
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 0
|
|
},
|
|
"ok": {
|
|
"temperature": 0.0
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 2
|
|
},
|
|
"ok": {
|
|
"temperature": 2.0
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 2.5
|
|
},
|
|
"error": "temperature: 0..2"
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": -0.1
|
|
},
|
|
"error": "temperature: 0..2"
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": true
|
|
},
|
|
"error": "temperature: 0..2"
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": "0.5"
|
|
},
|
|
"error": "temperature: 0..2"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_p": 0.9
|
|
},
|
|
"ok": {
|
|
"top_p": 0.9
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"top_p": 1
|
|
},
|
|
"ok": {
|
|
"top_p": 1.0
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"top_p": 0
|
|
},
|
|
"error": "top_p: 0 < top_p <= 1"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_p": 1.5
|
|
},
|
|
"error": "top_p: 0 < top_p <= 1"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_p": false
|
|
},
|
|
"error": "top_p: 0 < top_p <= 1"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 40
|
|
},
|
|
"ok": {
|
|
"top_k": 40
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 40.0
|
|
},
|
|
"ok": {
|
|
"top_k": 40
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 40.5
|
|
},
|
|
"error": "top_k: an integer 1..64"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 0
|
|
},
|
|
"error": "top_k: an integer 1..64"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 64
|
|
},
|
|
"ok": {
|
|
"top_k": 64
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 65
|
|
},
|
|
"error": "top_k: an integer 1..64"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": "40"
|
|
},
|
|
"error": "top_k: an integer 1..64"
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": 7
|
|
},
|
|
"ok": {
|
|
"seed": 7
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": 7.0
|
|
},
|
|
"ok": {
|
|
"seed": 7
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": 0
|
|
},
|
|
"error": "seed: a positive integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": -3
|
|
},
|
|
"error": "seed: a positive integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": 1.5
|
|
},
|
|
"error": "seed: a positive integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": 18446744073709551615
|
|
},
|
|
"ok": {
|
|
"seed": 18446744073709551615
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"max_tokens": 512
|
|
},
|
|
"ok": {
|
|
"max_tokens": 512
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"max_tokens": 0
|
|
},
|
|
"error": "max_tokens: a positive integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"max_tokens": "10"
|
|
},
|
|
"error": "max_tokens: a positive integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"reasoning_effort": "none"
|
|
},
|
|
"ok": {
|
|
"reasoning_effort": "none"
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"reasoning_effort": "low"
|
|
},
|
|
"ok": {
|
|
"reasoning_effort": "low"
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"reasoning_effort": "medium"
|
|
},
|
|
"ok": {
|
|
"reasoning_effort": "medium"
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"reasoning_effort": "high"
|
|
},
|
|
"ok": {
|
|
"reasoning_effort": "high"
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"reasoning_effort": "xhigh"
|
|
},
|
|
"error": "reasoning_effort: none, low, medium or high"
|
|
},
|
|
{
|
|
"input": {
|
|
"reasoning_effort": 3
|
|
},
|
|
"error": "reasoning_effort: none, low, medium or high"
|
|
},
|
|
{
|
|
"input": {
|
|
"experimental_speed_projection": true
|
|
},
|
|
"ok": {
|
|
"experimental_speed_projection": true
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"experimental_speed_projection": false
|
|
},
|
|
"ok": {
|
|
"experimental_speed_projection": false
|
|
}
|
|
},
|
|
{
|
|
"input": {
|
|
"experimental_speed_projection": 1
|
|
},
|
|
"error": "experimental_speed_projection: true or false"
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": null,
|
|
"top_p": "",
|
|
"top_k": null
|
|
},
|
|
"ok": {}
|
|
},
|
|
{
|
|
"input": {
|
|
"unknown": 1
|
|
},
|
|
"error": "unknown setting 'unknown'"
|
|
},
|
|
{
|
|
"input": {
|
|
"unknown": null
|
|
},
|
|
"ok": {}
|
|
},
|
|
{
|
|
"input": {
|
|
"min_p": 0.1
|
|
},
|
|
"error": "unknown setting 'min_p'"
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 0.7,
|
|
"top_p": 0.9,
|
|
"top_k": 20,
|
|
"seed": 11,
|
|
"max_tokens": 100,
|
|
"reasoning_effort": "medium",
|
|
"experimental_speed_projection": false
|
|
},
|
|
"ok": {
|
|
"temperature": 0.7,
|
|
"top_p": 0.9,
|
|
"top_k": 20,
|
|
"seed": 11,
|
|
"max_tokens": 100,
|
|
"reasoning_effort": "medium",
|
|
"experimental_speed_projection": false
|
|
}
|
|
}
|
|
],
|
|
"config": [
|
|
{
|
|
"input": null,
|
|
"ok": {},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {},
|
|
"ok": {},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 0.7
|
|
},
|
|
"ok": {
|
|
"temperature": 0.7
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 0
|
|
},
|
|
"ok": {
|
|
"temperature": 0.0
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": -1
|
|
},
|
|
"error": "[strata] config sampling.temperature=-1: expected a number >= 0 (0 = greedy)"
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": true
|
|
},
|
|
"error": "[strata] config sampling.temperature=True: expected a number >= 0 (0 = greedy)"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_p": 0.95
|
|
},
|
|
"ok": {
|
|
"top_p": 0.95
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"top_p": 0
|
|
},
|
|
"error": "[strata] config sampling.top_p=0: expected 0 < top_p <= 1"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_p": 1.01
|
|
},
|
|
"error": "[strata] config sampling.top_p=1.01: expected 0 < top_p <= 1"
|
|
},
|
|
{
|
|
"input": {
|
|
"min_p": 0.05
|
|
},
|
|
"ok": {
|
|
"min_p": 0.05
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"min_p": 0
|
|
},
|
|
"ok": {
|
|
"min_p": 0.0
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"min_p": 2
|
|
},
|
|
"error": "[strata] config sampling.min_p=2: expected 0 <= min_p <= 1"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 40
|
|
},
|
|
"ok": {
|
|
"top_k": 40
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 0
|
|
},
|
|
"error": "[strata] config sampling.top_k=0: the sampled path takes an integer 1..64"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 65
|
|
},
|
|
"error": "[strata] config sampling.top_k=65: the sampled path takes an integer 1..64"
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 20.0
|
|
},
|
|
"ok": {
|
|
"top_k": 20
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"top_k": 1.5
|
|
},
|
|
"error": "[strata] config sampling.top_k=1.5: the sampled path takes an integer 1..64"
|
|
},
|
|
{
|
|
"input": {
|
|
"presence_penalty": 0.5
|
|
},
|
|
"ok": {
|
|
"presence_penalty": 0.5
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"presence_penalty": -0.5
|
|
},
|
|
"error": "[strata] config sampling.presence_penalty=-0.5: expected a number >= 0"
|
|
},
|
|
{
|
|
"input": {
|
|
"frequency_penalty": 0.25
|
|
},
|
|
"ok": {
|
|
"frequency_penalty": 0.25
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"frequency_penalty": -1
|
|
},
|
|
"error": "[strata] config sampling.frequency_penalty=-1: expected a number >= 0"
|
|
},
|
|
{
|
|
"input": {
|
|
"repetition_penalty": 1.1
|
|
},
|
|
"ok": {
|
|
"repetition_penalty": 1.1
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"repetition_penalty": 0
|
|
},
|
|
"error": "[strata] config sampling.repetition_penalty=0: expected a number > 0 (1 = off)"
|
|
},
|
|
{
|
|
"input": {
|
|
"penalty_last_n": 128
|
|
},
|
|
"ok": {
|
|
"penalty_last_n": 128
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"penalty_last_n": 0
|
|
},
|
|
"ok": {
|
|
"penalty_last_n": 0
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"penalty_last_n": -2
|
|
},
|
|
"error": "[strata] config sampling.penalty_last_n=-2: expected a non-negative integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"penalty_last_n": 1.5
|
|
},
|
|
"error": "[strata] config sampling.penalty_last_n=1.5: expected a non-negative integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": 5
|
|
},
|
|
"ok": {
|
|
"seed": 5
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": 0
|
|
},
|
|
"error": "[strata] config sampling.seed=0: expected a positive integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": 5.5
|
|
},
|
|
"error": "[strata] config sampling.seed=5.5: expected a positive integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"seed": "5"
|
|
},
|
|
"error": "[strata] config sampling.seed='5': expected a positive integer"
|
|
},
|
|
{
|
|
"input": {
|
|
"experimental_speed_projection": true
|
|
},
|
|
"ok": {
|
|
"experimental_speed_projection": true
|
|
},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"experimental_speed_projection": "yes"
|
|
},
|
|
"error": "[strata] config sampling.experimental_speed_projection='yes': expected true or false (the default for requests that leave it out, when the engine has the vector)"
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": null,
|
|
"top_p": null
|
|
},
|
|
"ok": {},
|
|
"ignored": []
|
|
},
|
|
{
|
|
"input": {
|
|
"nonsense": 3
|
|
},
|
|
"ok": {},
|
|
"ignored": [
|
|
"[strata] config sampling.nonsense=3: unknown key, ignored"
|
|
]
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 0.6,
|
|
"nonsense": 3
|
|
},
|
|
"ok": {
|
|
"temperature": 0.6
|
|
},
|
|
"ignored": [
|
|
"[strata] config sampling.nonsense=3: unknown key, ignored"
|
|
]
|
|
},
|
|
{
|
|
"input": {
|
|
"temperature": 0.6,
|
|
"top_p": 0.9,
|
|
"top_k": 30,
|
|
"min_p": 0.02,
|
|
"presence_penalty": 0.1,
|
|
"frequency_penalty": 0.1,
|
|
"repetition_penalty": 1.05,
|
|
"penalty_last_n": 64,
|
|
"seed": 9
|
|
},
|
|
"ok": {
|
|
"temperature": 0.6,
|
|
"top_p": 0.9,
|
|
"top_k": 30,
|
|
"min_p": 0.02,
|
|
"presence_penalty": 0.1,
|
|
"frequency_penalty": 0.1,
|
|
"repetition_penalty": 1.05,
|
|
"penalty_last_n": 64,
|
|
"seed": 9
|
|
},
|
|
"ignored": []
|
|
}
|
|
]
|
|
}
|