llm-d API reference¶
A short map of llm-d's Kubernetes resources, router configuration, request headers and supported request APIs, as of llm-d 1.0. It lists the fields you set most often; the full schemas, with every validation rule, are upstream at https://llm-d.ai/docs/api-reference. Chapter 20 explains how the pieces fit together and chapter 21 how to operate them.
Resources at a glance¶
| Resource | API group and version | Kind of object | What it defines | Taught in |
|---|---|---|---|---|
InferencePool |
inference.networking.k8s.io/v1 |
Kubernetes CRD (from GAIE) | The model-server pods a Gateway and the EPP route to | 20 |
InferenceObjective |
llm-d.ai/v1 (v1alpha2 deprecated) |
Kubernetes CRD (from llm-d Router) | Priority of a workload across pools | 20, 21 |
InferenceModelRewrite |
llm-d.ai/v1alpha2 |
Kubernetes CRD (from llm-d Router) | Rules that rewrite the model name in request bodies, for traffic splits and canaries | 21 |
EndpointPickerConfig |
llm-d.ai/v1 (v1alpha1 deprecated) |
Configuration file or ConfigMap, not a Kubernetes object | The EPP's plugins, scheduling profiles, data layer and flow control | 20, 25 |
GAIE is the Gateway API Inference Extension (kubernetes-sigs/gateway-api-inference-extension).
InferencePool¶
| Field | Required | Meaning |
|---|---|---|
spec.selector.matchLabels |
Yes | Pods in the same namespace that belong to the pool; no cross-namespace selection; at most 64 labels, all must match |
spec.targetPorts[].number |
Yes | Ports exposed by the pool; each podIP:port is a separate endpoint to the EPP. At most 8, unique |
spec.appProtocol |
No | http (HTTP/1.1, the default) or kubernetes.io/h2c (HTTP/2 cleartext, for gRPC) |
spec.endpointPickerRef.name |
Yes | The EPP Service (or other referent) |
spec.endpointPickerRef.port.number |
When kind is Service |
The EPP's port |
spec.endpointPickerRef.kind, .group |
No | Default Service in the core group; ExternalName Services are not supported |
spec.endpointPickerRef.failureMode |
No | What the parent does when the EPP does not respond: FailClose (default) or FailOpen |
status.parents[] |
Set by controllers | Per parent Gateway: conditions Accepted and ResolvedRefs, the parentRef and the controller name; at most 32 |
Condition reasons: Accepted is false with NotSupportedByParent or HTTPRouteNotAccepted; ResolvedRefs is false with InvalidExtensionRef; an Exported condition reports multi-cluster export (NotRequested, NotSupported).
InferenceObjective¶
Served as llm-d.ai/v1 by llm-d Router 1.0.0 and later. v1alpha2 is deprecated and scheduled for removal in 1.2; Router 0.11.0 and earlier serve only v1alpha2.
| Field | Required | Meaning |
|---|---|---|
spec.priority |
No | Integer; higher is served first when resources are scarce. Negative values mark requests as sheddable. Unset means 0. Fairness applies only within one priority |
spec.poolRefs[] |
One of these two | 1 to 16 pools in the same namespace, unique by name (group defaults to inference.networking.k8s.io, kind to InferencePool) |
spec.poolSelector |
One of these two | A non-empty label selector over pools in the same namespace; {} is rejected. With both set, the objective applies to the union |
status.conditions |
Set by controllers | Type Accepted: Accepted or Pending |
Migrating from v1alpha2: change apiVersion to llm-d.ai/v1 and replace spec.poolRef with spec.poolRefs (a one-element list) or spec.poolSelector. While both versions are served, the EPP evaluates v1 first and logs a deprecation warning for v1alpha2 objects.
A request names its objective with the x-llm-d-inference-objective header, looked up in the InferencePool's namespace.
InferenceModelRewrite¶
| Field | Required | Meaning |
|---|---|---|
spec.poolRef.name |
Yes | The target InferencePool |
spec.rules[] |
Yes | Ordered rules; the first that matches a request is used |
rules[].matches[].model.value |
Yes, per match | Model name to match in the JSON body; type is Exact (the only value). Several matches are ORed; no matches means all requests |
rules[].targets[].modelRewrite |
Yes, per target | The model name to rewrite to |
rules[].targets[].weight |
No | Share of requests, weight / sum of weights, 1 to 1,000,000; set on all targets or none |
Precedence: an Exact match beats an empty match; between resources targeting the same pool with identical matches, the oldest wins; within a resource, the first matching rule wins. The x-llm-d-model-name-rewrite header overrides the model name per request instead.
EndpointPickerConfig¶
apiVersion: llm-d.ai/v1, kind: EndpointPickerConfig. The EPP still accepts v1alpha1, converts it at startup and logs a deprecation warning.
| Top-level field | Meaning |
|---|---|
featureGates |
Experimental features to enable, for example flowControl |
plugins[] |
Plugin instances: type (required, for example max-score-picker, openai-parser), optional name and parameters. Default picker, profile handler, parsers and saturation detector are injected when absent |
schedulingProfiles[] |
Named profiles listing pluginRefs, with a weight for scorers. Without profiles, one default profile gets every listed filter, scorer and picker; a profile with no picker gets max-score-picker |
dataLayer |
sources (with extractors), injectDefaults (default true), discovery (endpoint and peer discovery plugins; an endpoint discovery plugin lets the EPP run without Kubernetes) and crossReplica (state sharing between EPP replicas) |
flowControl |
Admission control: global maxBytes, maxRequests, defaultRequestTTL, noEndpointRequestTTL; priorityBands[] and default band templates (fairness default global-strict-fairness-policy, ordering default fcfs-ordering-policy); saturationDetector (default utilization-detector); enableEviction (default false). Most fields apply only with the flowControl feature gate; saturationDetector applies regardless |
requestHandler |
parsers (default openai-parser, anthropic-parser, vllmhttp-parser) and propagatePriority (default false) |
HTTP headers the EPP reads and sets¶
All header lookups are case-insensitive. Strip x-llm-d-* headers at your edge so clients cannot set their own priority (chapter 21).
| Header | Direction | Meaning |
|---|---|---|
x-llm-d-inference-objective |
Request | Name of the InferenceObjective to apply |
x-llm-d-inference-fairness-id |
Request | Groups requests that share capacity under the fairness policy; default default-flow |
x-llm-d-model-name-rewrite |
Request | Per-request model name override, used for the body and for metrics |
x-llm-d-slo-ttft-ms |
Request | Target time to first token in ms, for admission and SLO-aware plugins |
x-llm-d-slo-tpot-ms |
Request | Target time per output token in ms |
x-llm-d-request-dropped-reason |
Response | Why the EPP dropped a request (table below) |
Deprecated aliases, accepted by Router 0.9.0 and later; the canonical name wins if both are sent, and no removal date is announced: x-gateway-inference-fairness-id, x-gateway-inference-objective, x-gateway-model-name-rewrite, x-slo-ttft-ms, x-slo-tpot-ms. GAIE protocol headers such as x-gateway-destination-endpoint* are unchanged.
x-llm-d-request-dropped-reason |
Status | Meaning |
|---|---|---|
rejected-saturated |
429 | Pool or priority band at capacity |
evicted |
429 | Dispatched, then terminated to make room for a higher priority |
rejected-ttl-expired |
429 | Queued past its TTL while the pool had endpoints |
rejected-no-endpoints |
503 | No serving endpoints, or TTL expired while the pool was empty |
rejected-context-cancelled |
503 | Client disconnected while queued |
rejected-shutting-down |
503 | Flow controller draining during graceful shutdown |
rejected-internal |
500 | Internal error in the flow controller or scheduler |
rejected-* means no inference work was done, so a retry is cheap; evicted means accelerator time was spent.
Request APIs¶
HTTP, parsed by default:
| Endpoint | Source API |
|---|---|
/v1/completions |
OpenAI Completions |
/v1/chat/completions |
OpenAI Chat Completions |
/v1/responses |
OpenAI Responses |
/v1/embeddings |
OpenAI Embeddings |
/v1/messages |
Anthropic Messages |
/inference/v1/generate |
vLLM Generate |
gRPC, not parsed by default: add the vllmgrpc-parser plugin under requestHandler.parsers, and set the pool's appProtocol: kubernetes.io/h2c (the llm-d-router Helm charts do this with router.modelServers.protocol=grpc). Headers are sent as gRPC metadata.
| Method | Parser plugin | Note |
|---|---|---|
vllm.grpc.engine.VllmEngine/Generate |
vllmgrpc-parser |
Token-out only: responses carry token IDs and the client detokenizes |
vllm.grpc.engine.VllmEngine/Embed |
vllmgrpc-parser |
Artifacts¶
| Artifact | Where | Note |
|---|---|---|
| GAIE CRDs | kubernetes-sigs/gateway-api-inference-extension/config/crd |
Versions pinned in the llm-d repository's guides/env.sh |
| Router, Standalone mode | oci://ghcr.io/llm-d/charts/llm-d-router-standalone |
InferencePool plus EPP with a sidecar proxy (Envoy by default, agentgateway optional) |
| Router, Gateway mode | oci://ghcr.io/llm-d/charts/llm-d-router-gateway |
InferencePool plus EPP behind an existing Gateway (Istio, AgentGateway, Envoy AI Gateway, GKE) |
| EPP image | ghcr.io/llm-d/llm-d-router-endpoint-picker |
Renamed from llm-d-inference-scheduler in 0.8.0 |
| P/D sidecar image | ghcr.io/llm-d/llm-d-router-disagg-sidecar |
KV transfer for prefill and decode |
| Async processor | oci://ghcr.io/llm-d/charts/llm-d-async, image ghcr.io/llm-d/llm-d-async |
v1.0.0; renamed from async-processor in 0.8.0 |
| vLLM TPU engine image (artifacts page) | docker.io/vllm/vllm-tpu:v0.29.0 |
The llm-d TPU guides instead pin vllm/vllm-torchtpu:v0.29.0 through the torch-tpu-vllm image component (chapter 20) |
The artifacts page lists tested Gateway versions for the v0.10.0 release: Gateway API CRDs v1.5.x, Istio 1.29.x (default), AgentGateway v1.4.x (preferred for new deployments).
Glossary pointers¶
llm-d's own glossary (https://llm-d.ai/docs/api-reference/glossary) defines its terms in GPU language. This book's glossary covers the ones you need on TPU: EPP, flow control, InferencePool, prefix-cache aware routing, P/D disaggregation, well-lit path. Where llm-d's glossary names NIXL for KV transfer, the TPU paths use TPU Sync instead (chapter 20).
See also¶
These guides use the resources above on TPU:
- llm-d quickstart on GKE TPU: a first
InferencePoolwith its router and a GKE Gateway. - Manage llm-d traffic and tenants and Predicted-latency routing on TPU:
InferenceObjectivepriorities and the headers that select them. - Roll out changes to an llm-d pool:
InferenceModelRewritefor adapter versions behind a stable model name, and a changedEndpointPickerConfig. - Stateful Responses API on TPU: the
/v1/responsesrequest API. - Observe an llm-d deployment on TPU: the router's and model servers' metrics in Prometheus.
References¶
- API Reference: llm-d's resource and schema index
- InferencePool
- InferenceObjective: including deprecation and migration
- InferenceModelRewrite
- EndpointPickerConfig (EPP Configuration)
- EPP HTTP Headers Reference
- EPP HTTP APIs Reference
- EPP gRPC APIs Reference
- Artifacts
- Glossary
- Google Cloud TPU: the
vllm/vllm-torchtpu:v0.29.0image and itstorch-tpu-vllmcomponent