Skip to main content
Version: Latest (main)

Request Parameters

Overview​

request_params is a route-local plugin that validates and trims OpenAI Chat Completions request bodies before they are forwarded to backends.

Key Advantages​

  • Caps expensive parameters (max_tokens, n) per route.
  • Blocks sensitive parameters such as logprobs / top_logprobs for tiers that should not expose token distributions.
  • Can remove a client prompt_cache_key with blocked_params: [prompt_cache_key] before backend dispatch.
  • Can remove min_p and logit_bias with blocked_params: [min_p, logit_bias] when every backend of a route rejects them, as vLLM does with speculative decoding. To remove them for one model only, list them in its unsupported_capabilities.

What Problem Does It Solve?​

Model routing can restrict which backend serves a request, but clients can still amplify cost or extract logits via request parameters. This plugin enforces per-decision limits on the request body after a decision matches.

When to Use​

  • a tier or route must not request logprobs or multiple completions
  • you need a hard ceiling on max_tokens or n independent of client input

Configuration​

Add the plugin under recipes[].decisions[].plugins:

plugins:
- type: request_params
configuration:
blocked_params:
- logprobs
- top_logprobs
max_tokens_limit: 500
max_n: 1

In DSL, the same plugin can appear as:

PLUGIN request_params {
blocked_params: ["logprobs", "top_logprobs"]
max_tokens_limit: 500
max_n: 1
}

max_tokens_limit bounds the whole output, thinking included. When it lowers max_tokens to or below an Anthropic thinking.budget_tokens, the budget drops to one token below the cap. Anthropic needs a budget of at least 1024, so an Anthropic route capped at 1024 or less still refuses a thinking budget.

blocked_params cannot include stream. The Router streams the answer exactly when the client asks for a stream, so a configuration that lists it fails at load.

This plugin enforces a bounded set of OpenAI Chat Completions fields. It is not a general JSON-schema firewall and does not authorize a caller. The Router already refuses a request field the client's wire format does not declare, so the plugin has no strip_unknown: a configuration that still sets it fails at load with a one-line hint, and vllm-sr config migrate deletes it. See a complete example: config/fragments/plugin/request-params/budget-tier.yaml.