Additional Resources

NVIDIA Request Extensions (nvext)

View as Markdown

nvext is a top-level JSON object on the request body that provides NVIDIA-specific extensions to the OpenAI-compatible API. nvext fields are consumed by the Dynamo frontend, preprocessor, router, and backend workers to control routing, preprocessing, response metadata, scheduling, and engine-level priority.

Usage

Include nvext as a top-level field alongside standard OpenAI-compatible fields:

1{
2 "model": "my-model",
3 "messages": [{"role": "user", "content": "Hello"}],
4 "nvext": {
5 "greed_sampling": true,
6 "extra_fields": ["worker_id", "timing"],
7 "agent_hints": {
8 "osl": 1024,
9 "priority": 5,
10 "strict_priority": 1
11 }
12 }
13}

Field Reference

FieldTypeDefaultConsumed ByDescription
greed_samplingboolNonePreprocessorForces greedy sampling regardless of other sampling parameters.
use_raw_promptboolNonePreprocessorBypasses the prompt template and passes the prompt directly to the tokenizer.
annotationsstring[]NonePreprocessorTriggers out-of-band information in the SSE stream via the event: field.
backend_instance_idu64NoneRouterRoutes the request to a specific backend instance.
token_datau32[]NonePreprocessorPre-tokenized prompt tokens. When provided with backend_instance_id, tokenization is skipped.
max_thinking_tokensu32NoneBackendMaximum thinking tokens allowed (passed through to backends).
extra_fieldsstring[]NoneResponse builderFields to include in the response nvext. Supported: "worker_id", "timing", "routed_experts", "engine_data", "stop_reason".
prefill_worker_idu64NoneRouterRoutes the request to a specific prefill worker (disaggregated serving).
decode_worker_idu64NoneRouterRoutes the request to a specific decode worker (disaggregated serving).
dp_ranku32NoneRouter/backendData-parallel rank for the decode worker. Typically set by EPP routing headers.
prefill_dp_ranku32NoneRouter/backendData-parallel rank for the prefill worker in disaggregated serving. Typically set by EPP routing headers.
agent_hintsobjectNoneRouterPer-request hints for scheduling and load balancing. See Agent Hints.

Related root-level Dynamo output option:

FieldTypeDefaultConsumed ByDescription
return_tokens_as_token_idsboolfalseResponse builderFormats logprob token strings as token_id:<id> instead of decoded text.

return_tokens_as_token_ids only changes returned logprob token display. To stop on token IDs, pass integer IDs in the normal stop array, for example "stop": [576]. Strings such as "token_id:576" remain literal string stop sequences and are not parsed as token IDs.

Header overrides

Routing fields can also be set via HTTP headers, which take priority over nvext values:

HeaderOverrides
x-dynamo-worker-instance-idbackend_instance_id and decode_worker_id
x-dynamo-prefill-instance-idprefill_worker_id
x-dynamo-dp-rankdp_rank
x-dynamo-prefill-dp-rankprefill_dp_rank

The unprefixed forms (x-worker-instance-id, x-prefill-instance-id, x-dp-rank, x-data-parallel-rank, and x-prefill-dp-rank) are compatibility aliases planned for future deprecation. Use the x-dynamo-* headers for new integrations.

Session identity is header-only. Use the coding-agent headers or Dynamo session headers described in Session IDs; nvext does not accept session identity fields.

When session affinity is enabled with --router-session-affinity-ttl-secs, the router uses X-Dynamo-Session-ID for immutable endpoint- and phase-scoped affinity. On etcd and shared FileStore, replicas coordinate through a distributed claim while the request hot path uses a process-local cache. Existing local or shared bindings override routing headers; the headers above are proposals only when no binding exists. Memory and Kubernetes discovery do not provide cross-process affinity. See Configuration and Tuning for claim lifetime, cache TTL, terminal close, and failure behavior.

For trace sink configuration and JSONL schema details, see Agent Tracing.

Agent Hints

The agent_hints sub-object carries per-request hints that the router uses for scheduling, load balancing, and KV cache optimization.

FieldTypeDefaultDescription
priorityi32NoneUnified soft request priority. Used for router policy scoring and backend scheduling/eviction.
strict_priorityu32NoneRouter pending-queue tier. Higher values always precede lower values. Unset is equivalent to 0.
oslu32NoneExpected output sequence length (tokens). Used for output block tracking and resource estimation.
speculative_prefillboolfalseWhen true, speculatively prefills the predicted next-turn prompt after the current turn completes to warm the KV cache.

priority

priority is the cross-layer scheduling hint. Higher values mean “more important” across Dynamo.

When --router-queue-threshold is set and the queue is active, higher-priority requests are shifted earlier in the router queue. Once dispatched, Dynamo forwards the same semantic priority to the backend engine for queue ordering, preemption, and KV cache eviction. Dynamo normalizes backend-specific polarity internally, including vLLM’s lower-is-higher convention.

For layer-by-layer behavior and backend requirements, see Priority Scheduling.

1{
2 "nvext": {
3 "agent_hints": {
4 "priority": 5
5 }
6 }
7}

strict_priority

strict_priority is an unsigned router-only tier for requests waiting in a router scheduler queue. The queue orders requests by (strict_priority, configured_policy_key), so FCFS, LCFS, or WSPT still orders requests within the same tier.

This field does not change backend engine priority, preempt running work, or provide ordering across router replicas. It also does not prevent an eligible new arrival from being admitted directly while other requests are parked.

1{
2 "nvext": {
3 "agent_hints": {
4 "strict_priority": 2
5 }
6 }
7}

osl

Expected output sequence length — the estimated number of output tokens the request will generate. The router uses this hint in two ways:

  1. Output block tracking: When --router-track-output-blocks is enabled, the router adds placeholder blocks during generation and applies fractional decay based on progress toward osl.
  2. Resource estimation: Helps the router estimate total resource requirements when making routing decisions.
1{
2 "nvext": {
3 "agent_hints": {
4 "osl": 1024
5 }
6 }
7}

speculative_prefill

When set to true, the system speculatively prefills the predicted next-turn prompt after the current assistant turn completes. This is designed for multi-turn agentic workloads where the next request’s prefix is predictable.

How it works:

  1. As the assistant response streams, the system accumulates the full response text.
  2. Once the response finishes, a background task constructs the next-turn prompt by appending the assistant response to the conversation history (with thinking content stripped for non-last turns).
  3. The constructed prompt is tokenized and sent as a max_tokens=1 request to warm the KV cache on a worker.
  4. When the actual next request arrives, it benefits from the already-warm KV cache, reducing TTFT.
1{
2 "nvext": {
3 "agent_hints": {
4 "speculative_prefill": true
5 }
6 }
7}

Backend details:

1{
2 "nvext": {
3 "agent_hints": {
4 "priority": 5
5 }
6 }
7}

Response Extensions

When the client requests response metadata via extra_fields, the response includes an nvext object with the requested fields:

FieldRequested ViaDescription
worker_idextra_fields: ["worker_id"]Prefill/decode worker IDs and data parallel ranks that processed the request.
timingextra_fields: ["timing"]Per-request timing information (TTFT, ITL, queue time, etc.).
routed_expertsextra_fields: ["routed_experts"]Routed expert capture payload returned by SGLang-backed requests.
engine_dataextra_fields: ["engine_data"]Opaque backend-provided engine metadata.
stop_reasonextra_fields: ["stop_reason"]Backend-specific matched stop condition, returned under nvext because it is not part of the OpenAI completions schema. Dynamo currently serves this as a response-level field for single-choice requests; supporting n > 1 will require an indexed per-choice shape.
token_idsAutomatic (GAIE Stage 1)Tokenized prompt for reuse in Stage 2 query-only mode.

Example response nvext

1{
2 "nvext": {
3 "worker_id": {
4 "prefill_worker_id": 1,
5 "prefill_dp_rank": 0,
6 "decode_worker_id": 2,
7 "decode_dp_rank": 0
8 },
9 "timing": {
10 "ttft_ms": 45.2,
11 "itl_ms": 12.1
12 }
13 }
14}

See Also

DocumentDescription
Frontend GuideKServe gRPC configuration and integration
Configuration and TuningFull router configuration and CLI arguments
Session IDsPassive session identity
Agent TracingJSONL request traces, inferred tool-call metadata, and harness tool-event ingestion
Agent HintsPer-request serving hints for routing, scheduling, and cache behavior
SGLang for Agentic WorkloadsSGLang engine flags for priority scheduling, eviction policies, and session-aware radix tagging