Routing
model_to_header
Promotes the JSON "model" field from the request body to a request header.
On this page
Promotes the JSON "model" field from the request body to a request header.
Configuration Notes
The promoted value is also published to model_to_header.model metadata for downstream consumers (e.g. the llm_metrics model label), so those readers use the server-validated value instead of a client-supplied request header.
Promotion is deferred until end-of-stream so a later body-writing filter (for example llmisvc_model_provider_resolver) can observe the pending header in the same StreamBuffer pre-read pass.
Body inspection inherits the pipeline’s body_limits.max_buffer_bytes and body_limits.max_request_bytes; the smaller bound applies. To accept requests above the default 10 MiB request limit, raise max_request_bytes and ensure max_buffer_bytes is at least as large (its default is 64 MiB). These bounds govern the shared pipeline buffer even when another filter declares a smaller buffer. Filters can still enforce separate validation limits while processing the body.
Configuration
| Field | Type | Required | Description |
|---|---|---|---|
header | string | no | Header name for the promoted model value. Must not be a hop-by-hop, framing, Host, credential, API-key, or internal x-praxis-* header. Defaults to X-Model. |
Example
filter: model_to_header
header: X-Model # optional, defaults to X-Model