Every Layer← All lessons

BNK and gateways

Wiring a pool to its picker

What the BNK controller builds from three resources, the five steps inside the picker, and what TMM does when it is gone

Other lessons show the endpoint picker at work: TMM holds a request, asks the picker which GPU should serve it and forwards it there. This lesson is about everything around that question. It starts before any request exists, with the three resources an operator applies and what the BNK controller builds from them. It then follows one request through the side call, through the five steps the picker runs inside, and through the report TMM sends back once a worker has answered. It covers the case operators have to plan for, a picker that answers late or is gone, and it ends with a pool served by NVIDIA Dynamo, with two optional resources that attach to a pool for priorities and model names, and with what F5 measured when cache memory runs short.

Chapter 1 of 12

From the load of a pool to a decision per request

An inference gateway is a gateway plus an endpoint picker

F5 names four ways in which ordinary load balancing fails a pool of model servers. Prompts that share an opening are sent to different GPUs, so the same prefix is computed again although its result sits in another worker's KV cache. Network algorithms cannot weigh cache locality, queue depth, GPU load and health together. Reading a prompt and writing an answer compete for the same GPU. And every serving platform brings its own routing model, so an operator ends up running several. The outcome is a longer wait for the first token, fewer tokens per second and GPUs that idle beside overloaded ones.

BNK's first answer was a balancer fed by an analyzer. It balanced at the level of pool members, from three readings per GPU: requests running, requests waiting and memory in use. That is one view for the whole pool, and it knows nothing about the request in hand. The endpoint picker decides per request. It ranks every worker for this prompt, and it knows about KV cache and prefixes as well as load.

The frame for it is the Gateway API Inference Extension, a Kubernetes project that F5 shortens to GAIE. It defines an inference gateway as two parts. The gateway data plane matches a route and forwards. The endpoint picker, EPP for short, decides which endpoint is best for each request. On BNK the data plane is TMM and the picker is the F5 EPP, and they speak a standard protocol, so each could also work with another vendor's counterpart.

Chapter 2 of 12

One small resource starts it

An F5EPP names a pool and an engine, and nothing else is required

A picker used to mean a Deployment, a Service, a ConfigMap, a ServiceAccount and two RBAC objects, written by hand for every pool. On BIG-IP Next for Kubernetes one resource replaces them. Its kind is F5EPP, in the API group inference.k8s.f5.com, and it has two required fields. spec.poolRef.name is the InferencePool it will serve. spec.engine is vllm, dynamo or sglang, and it selects which metrics the picker reads, how KV cache events reach it and which port it scrapes on the model Pods.

There is one picker per pool. F5's documentation calls this strict per-pool isolation, with dedicated picker instances and scheduling profiles for each InferencePool. F5's Tech Summit session gives the reason: each model may need a different tokenizer and different picker parameters. The binding is strictly one to one. A second F5EPP for the same pool fails validation, and poolRef cannot be changed after creation.

Two rules about namespaces catch people. The F5EPP, its InferencePool and the model Pods must all be in the same namespace. And the controller only looks for F5EPP resources in namespaces listed under spec.eppNamespaces of the CNEInstance, the resource that describes the BNK installation. Listing a namespace also makes the controller create the Role and RoleBinding the picker needs there. Leaving the list empty switches picker reconciliation off for the whole cluster.

Chapter 3 of 12

The controller builds the picker

Six objects, named after the pool, and four conditions that report progress

From the F5EPP the controller renders everything the picker needs and keeps it in step from then on. The names follow the pool. For a pool called qwen3 the Deployment, the Service and the ServiceAccount are all qwen3-epp, and the ConfigMap is qwen3-epp-config. The ConfigMap carries two files. pool.yaml holds the picker's decision steps and scoring profiles, and epp.yaml holds the settings of the picker process itself.

The Service has three fixed ports: 9002 for the ext_proc calls from TMM, 9003 for health and 9090 for Prometheus metrics. You can shape the Pod through spec.podTemplate, a patch laid over the generated template, for node affinity, tolerations or resource limits. Some fields are reserved and a change to them is rejected: the container's args, command, ports, readiness probe and lifecycle, the service account, and the mount of the configuration.

The F5EPP reports progress in four conditions that depend on each other in order: Accepted, ResolvedRefs, Programmed and Available. Each needs the one before it to be True. The columns READY and PROGRAMMED of kubectl get f5-epps show the last two. The picker reads its configuration once, when it starts. That matters if you replace the generated ConfigMap with your own through spec.eppConfig.configMapRef: an edit then has no effect until you restart the Deployment yourself.

Chapter 4 of 12

The pool names its picker, the route names the pool

Two more resources, and the controller programs TMM

Two standard resources finish the wiring. The InferencePool, which reached version v1 in the Gateway API Inference Extension, selects the model Pods by label, gives their port in targetPorts and points endpointPickerRef at the Service the controller rendered, on port 9002. The HTTPRoute attaches to a Gateway and lists the pool as its backend, with kind InferencePool where a Service would normally stand. The Gateway must already show PROGRAMMED True, because TMM cannot attach an inference profile to a Gateway that is not programmed.

The controller resolves the reference and programs TMM with two things. One is the route's inference profile, which F5 describes as a table from pool to picker. The other is an internal virtual server through which TMM reaches the picker. Its name is the namespace, the pool and the suffix epp-ivs. Until a route points at the pool, the pool's own status can stay empty, and that is normal.

BNK is stricter than the standard in one respect. Each route rule must reference exactly one InferencePool and must not mix it with another kind of backend such as a Service. A rule that breaks this is refused programming. Two pools behind one name therefore need two rules or two routes. The port written on the backend reference is ignored, as the standard asks, since the pool's targetPorts already says where the Pods listen.

Chapter 5 of 12

One side call per request

TMM holds the request and asks over a pooled gRPC channel

Back in the factory, a request arrives. TMM matches it to the route and finds that the backend is an InferencePool. Its inference filter, which F5 calls a hudfilter, intercepts the request and sends one consult to the pool's picker through the internal virtual server. A filter in TMM is a stage that every request of a virtual server passes through.

The protocol is ext_proc, the external processing protocol that Envoy defined. It is a gRPC stream in both directions. The proxy sends ProcessingRequest messages, each carrying one part of the HTTP exchange: request headers, a piece of the request body, later the response headers and pieces of the response body. The processor answers each with a ProcessingResponse, which can change headers, change the body or end the exchange with a response of its own. The inference extension requires its pickers to implement this service and to support streaming, so that tokens can flow to the caller while the exchange is still open.

The picker only ever answers. No byte of the request travels through it on the way to a GPU, which is why F5 calls it a side-band call. TMM keeps its gRPC connections to the picker open and reuses them, so a new request does not pay for a new connection. A request the filter cannot consult on, for example one whose body is larger than the configured maximum, is passed through without a consult and counted separately.

Chapter 6 of 12

Inside the picker: admit and prepare

A full pool is refused before any scoring, and the prompt becomes token ids

F5 describes the picker's work on one request as a pipeline of five steps: Admission, PrepareData, Score, Pick and PreRequest. The first two decide whether the request is scored at all and in what form.

Admission is a saturation check. The picker keeps a current picture of every worker from two feeds. It scrapes each model Pod's metrics endpoint, by default every 50 milliseconds, on the port the engine uses. And it receives KV cache events, over ZMQ from vLLM and SGLang Pods and over NATS for Dynamo. If every worker in the pool is at capacity, the request is rejected at this step. F5's documentation calls it a saturation backstop: incoming requests are dropped so that saturated Pods are not pushed further. The thresholds belong to a plugin named utilization-detector.

PrepareData turns the prompt into token ids with the model's tokenizer. Everything after it depends on that. The amount of work in a request is a token count, and a prefix can only be matched against a worker's cache block by block, in blocks of spec.blockSize tokens, 16 by default. The tokenizer must be the one the workers use and the block size must be theirs. If either differs, the picker still runs and still answers, and its prefix matching is wrong without any error. F5 words this as silent degradation of cache-hit accuracy.

Chapter 7 of 12

Inside the picker: score, pick, reserve

Thirteen scorers, a hot and cold ranking, and a note for the next request

Score runs a set of scorers. Each one looks at one signal and gives every worker a value between 0 and 1. The values are multiplied by weights and added, so each worker ends with one sum. F5 counts thirteen scorers in two families. Ten are about distribution, the load and pressure on a worker: KV cache use, queue, running requests, GPU utilization, memory utilization, framebuffer, power, temperature, a token-weighted load and a hot classifier. Three are about affinity, the reuse of state a worker already holds: prefix cache, loaded LoRA adapters and active blocks. The second family is what a pool-level balancer cannot see.

Pick chooses from the sums. F5's picker first ranks workers as hot or cold, a scheme its metrics name Hot-Cold Lexicographic, HCL for short. A hot worker is set aside however well it scored, which is how a full GPU is kept from attracting more work by being warm. F5's tuning page describes the limits in the picker's hot_thresholds map as candidate exclusion limits. It does not say what the picker does when every worker is hot. Among the rest the picker takes the highest score, or draws at random with the scores as weights.

PreRequest runs after the choice. It reserves the prefix blocks this request will fill on the chosen worker and, for Dynamo, adds a header naming the worker. The reservation is what F5's documentation calls in-flight request tracking. The next request, a millisecond later, already sees this one on gpu-2, although no metric and no cache event has reported it yet. Without it a burst would be placed on one stale picture.

Chapter 8 of 12

The answer, and the report afterwards

An address comes back, and later TMM says which worker really served

The picker's answer is a header mutation. It sets x-gateway-destination-endpoint to the address and port of the chosen Pod, and puts the same value into the response's dynamic metadata under the namespace envoy.lb. Both are required, because a data plane may read either one. The protocol allows a list: several addresses separated by commas, in order of preference. The proxy uses the first valid one and, if retries are configured, goes down the list in order.

The question can also be narrowed from the other side. A data plane may pass the picker a subset of endpoints to choose from, in request metadata under envoy.lb.subset_hint with the key x-gateway-destination-endpoint-subset. The picker must then choose inside that list, and answer 503 if nothing in it is eligible.

TMM applies the mutation and forwards the request straight to the Pod. No Service and no second balancer sits in between. The exchange is not over, though. When the response comes back, the data plane must tell the picker which endpoint served it, in metadata named x-gateway-destination-endpoint-served. With a list of candidates and retries, the picker cannot know that by itself. TMM also relays the response headers and body pieces to the picker and signals the end of the stream. F5 lists this among the conformance behaviours of its gateway: it sends traffic only to the endpoints the picker selected, and it reports correctly which one served each request.

Chapter 9 of 12

When the picker is slow or gone

One field on the pool decides between refusing and spreading blind

A consult can fail in two ways: the picker returns an error, or no answer comes within TMM's timeout. What happens next is set by endpointPickerRef.failureMode on the InferencePool. FailClose is the default in the standard. The request is aborted and the caller gets a failure response. FailOpen forwards the request to a member of the pool by what F5's overview calls standard round-robin or fallback routing, without any knowledge of caches or queues.

Neither is free. FailClose turns a picker outage into an outage of the model. FailOpen keeps answers coming and loses the cache hits, and it also loses the protection of full workers. Two picker replicas shorten the gap. spec.replicas accepts 1 or 2, and two Pods run as active and standby with leader election. The protocol's readiness service reports SERVING only on the elected leader, once its view of the pool has synced.

A refusal by a working picker is a different thing and should not be confused with an outage. The protocol gives the picker two immediate responses. It answers 503 when the pool has no ready endpoint, and 429 when this request should be dropped, for instance a low-priority request while the servers are under heavy load. TMM counts those as immediate responses. A missing picker shows up elsewhere: as timeouts and gRPC errors on the internal virtual server's row, as fallbacks in the consult table, and on the F5EPP as Available turning False.

Chapter 10 of 12

A pool served by Dynamo

The same picker, a different engine, and a header that names the worker

NVIDIA Dynamo is a serving framework that runs in front of an engine such as vLLM, SGLang or TensorRT-LLM. To the picker it is one more value of spec.engine, and F5 states that every engine gets the same picker and the same scoring. Only the plumbing differs. With engine dynamo the picker scrapes port 9090, where Dynamo Pods expose metrics in vLLM's format with labels of their own, and it takes KV cache events from NATS, a message broker. spec.natsURL is then required, and it is rejected for the other two engines.

The pool comes from somewhere else in this setup. With Dynamo's operator the owner of the model writes a DynamoGraphDeployment, and the operator creates the InferencePool from it, named after the graph with the suffix pool. So the order of work is: Dynamo and its worker pools first, then the InferencePool that the graph produces, then the F5EPP, then requests. The pool and the picker can belong to different teams.

One point needs care. In Dynamo's own guide the pool comes with a component of type epp, and the operator then also creates Dynamo's own picker, a Deployment and a Service. TMM consults whichever Service the pool's endpointPickerRef names. For the F5 picker to serve the pool, endpointPickerRef must name the Service rendered from the F5EPP, and Dynamo's own picker is then not needed. F5's Dynamo walk-through writes the InferencePool itself: it selects the Dynamo worker Pods by label, gives port 8000 and points endpointPickerRef at the F5 picker's Service.

Two more differences show at request time. The picker adds a header, x-worker-instance-id, next to the destination address. It names the Dynamo worker, and for vLLM pools the plugin that writes it is simply not loaded. And Dynamo can split a pool into workers that only read prompts and workers that only write answers. spec.mode: disaggregated tells the picker to route across those two labelled groups. Set on an ordinary pool, it makes the picker look for groups that do not exist, and routing fails.

Chapter 11 of 12

Priorities and model names, checked and left alone

Two optional resources that attach to the pool

Release v1.4.0 of the inference extension has two more resources, and neither is needed for the path described so far. Both have since left the extension's main branch, and F5's session labels them llm-d-router, alpha. An InferenceObjective attaches a service objective such as a priority or a criticality to a pool, so requests can be told apart by importance. The lesson Premium and standard on the same GPUs builds on that idea. An InferenceModelRewrite changes the model name on a request before it reaches the backend. F5's documentation names two uses: routing to alias names and splitting traffic across model versions. A split by weight between two versions is how a canary release is done. F5's session slide adds fallback to the list.

Both are in the API group inference.networking.x-k8s.io at version v1alpha2, both point at a pool through spec.poolRef, and both must be in the pool's namespace. Their definitions are not part of the BNK bundle. F5 asks for the ones from release v1.4.0 of the extension, the release BNK 2.4 was built against. Applying a resource whose definition is missing gets the usual answer from the API server: no matches for kind.

The BNK controller's part is narrow. It creates nothing from these resources and does not change them. It validates each one and writes an Accepted condition with a reason. For an objective it checks that the pool reference has a supported group and kind and that the pool exists. For a rewrite it also checks the rules, for example that one rule does not mix weighted and unweighted target models.

Chapter 12 of 12

What it comes to as the cache fills

Inside the cache two gateways are close, and past it they part

F5 measured its gateway against an open source AI gateway it had tested, on the same hardware: eight H100 GPUs serving Qwen3-32B in 8-bit floating point, vLLM 0.17.1 on both sides, and windows of exactly 240 seconds. The only thing that changed between the two arms was the inference gateway. The quantity on the horizontal axis is cache pressure: how much KV cache the prompts in play would need, as a multiple of what the fleet of GPUs can hold.

At 0.46 times the fleet's cache, everything fits, and BNK completed 13 percent more work. At 0.93, the point F5 calls the cache knee, the lead was 30 percent. At 1.24, where blocks must be evicted to make room, it was 102 percent, a little over double. At that last level the mean wait for the first token was 61 percent lower and the mean gap between tokens 38 percent lower. Over all twelve load points of the benchmark, BNK completed 1.32 times the total work. The highest single ratio was 3.24, at 1.24 times the cache with prompts that share no prefix.

The shape matters more than any one figure. While the working set fits in memory, almost any sensible placement works, and F5 says so itself: results vary with the working set and the traffic pattern. Once the cache overflows, each misplaced request evicts blocks another request was about to reuse, and the choice of worker decides how much of the fleet keeps doing useful work.

What to keep

Three resources, one side call, one field for the bad day

An inference path on BNK is declared in three resources. The F5EPP makes the controller build and maintain a picker for one pool. The InferencePool names that picker and the model Pods. The HTTPRoute sends traffic to the pool, and the controller programs TMM with the route and with an internal virtual server that reaches the picker. Each request then costs one ext_proc exchange. The picker admits, tokenizes, scores, picks and reserves, returns an address, and later hears which worker served. When the picker cannot be asked, failureMode on the pool decides whether callers get errors or unadvised placement. TMM's tables show which of these happened, and the picker's metrics show whether its map of the cache is alive.