You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The client opens a single connection to the coordinator. Behind it, the coordinator
125
-
issues several requests to the Inference Gateway and consumes each response before issuing
126
-
the next: it is an active client of the Gateway, not a one-shot proxy. A single step
128
+
The client opens a single connection through the Inference Gateway to the coordinator
129
+
(the gateway's default route, taken when a request carries no `EPP-Phase` header).
130
+
Behind it, the coordinator issues several requests back to that same Gateway and
131
+
consumes each response before issuing the next: it is an active client of the Gateway,
132
+
not a one-shot proxy. A single step
127
133
can also fan out into several parallel requests: `replace-media-urls` downloads media
128
134
concurrently (to the source URLs), and `encode` issues one Gateway request per
129
135
multimodal item in parallel. The number and shape of these requests depend on the input
@@ -134,6 +140,87 @@ download or encode at all. Across phases the coordinator sequences the round-tri
134
140
request. Each Gateway call routes it by the `EPP-Phase` header to the EPP, which runs
135
141
the matching scheduling profile and picks a pod from that phase's pool.
136
142
143
+
Every call the Coordinator makes for a phase (`conditional-decode`, `encode`, `prefill`,
144
+
`decode`) goes through the same Gateway and the same EPP, which picks the pod for that
145
+
phase via the [Endpoint Picker protocol](https://github.com/kubernetes-sigs/gateway-api-inference-extension/tree/main/docs/proposals/004-endpoint-picker-protocol)
146
+
(`ext_proc`). `conditional-decode` tries decode first, optimistically, before running
147
+
encode or prefill at all: if the chosen decode pod already has what it needs (e.g. the
148
+
prompt is already cached), it serves the request directly and the full pipeline never
149
+
runs. Only if decode responds `412 Precondition Failed` does the Coordinator fall back
150
+
to the full `encode → prefill → decode` cascade — which is also how a request with
151
+
multiple multimedia entries fans encode out in parallel, one call per entry.
152
+
153
+
```mermaid
154
+
sequenceDiagram
155
+
participant Client
156
+
participant Gateway
157
+
participant Coordinator
158
+
participant EPP
159
+
participant Media as External Media Service
160
+
participant Render as Render (side service)
161
+
participant Encode as Encode pool
162
+
participant Prefill as Prefill pool
163
+
participant Decode as Decode pool
164
+
165
+
Client->>Gateway: Request
166
+
Gateway->>Coordinator: Forward request
167
+
168
+
opt replace-media-urls step configured and request has media entries
169
+
par one call per media entry
170
+
Coordinator->>Media: Fetch / cache media URL
171
+
Media-->>Coordinator: Resolved reference
172
+
end
173
+
end
174
+
175
+
opt render step configured
176
+
Coordinator->>Render: Normalize multimodal input
177
+
Render-->>Coordinator: Normalized tensors
178
+
end
179
+
180
+
Note over Coordinator,Decode: conditional-decode — try decode alone first
181
+
Coordinator->>Gateway: Call (EPP-Phase: decode)
182
+
Gateway->>EPP: ext_proc: pick pod (profile=decode)
183
+
EPP-->>Gateway: Chosen decode pod
184
+
Gateway->>Decode: Forward request
185
+
186
+
alt Decode can serve the request
187
+
Decode-->>Gateway: 200 OK (tokens)
188
+
Gateway-->>Coordinator: Response
189
+
Coordinator-->>Client: Final response
190
+
else Decode cannot serve it (e.g. no KV cache for this prompt)
191
+
Decode-->>Gateway: 412 Precondition Failed
192
+
Gateway-->>Coordinator: 412
193
+
Note over Coordinator: Fall back to the full pipeline
194
+
195
+
opt request has multimodal entries
196
+
par one call per media entry
197
+
Coordinator->>Gateway: Call (EPP-Phase: encode)
198
+
Gateway->>EPP: ext_proc: pick pod (profile=encode)
199
+
EPP-->>Gateway: Chosen encode pod
200
+
Gateway->>Encode: Forward request
201
+
Encode-->>Gateway: Embeddings
202
+
Gateway-->>Coordinator: Embeddings
203
+
end
204
+
end
205
+
206
+
Note over Prefill,Decode: Shown here: kv-nixl. Other KV connectors (kv-shared-storage,<br/>kv-sglang) transfer KV differently - see KV and EC transfer protocols.
207
+
Coordinator->>Gateway: Call (EPP-Phase: prefill)
208
+
Gateway->>EPP: ext_proc: pick pod (profile=prefill)
209
+
EPP-->>Gateway: Chosen prefill pod
210
+
Gateway->>Prefill: Forward request
211
+
Prefill-->>Gateway: KV transfer descriptor
212
+
Gateway-->>Coordinator: Response
213
+
214
+
Coordinator->>Gateway: Call (EPP-Phase: decode)
215
+
Gateway->>EPP: ext_proc: pick pod (profile=decode)
216
+
EPP-->>Gateway: Chosen decode pod
217
+
Gateway->>Decode: Forward request (pulls KV via NIXL)
218
+
Decode-->>Gateway: 200 OK (tokens)
219
+
Gateway-->>Coordinator: Response
220
+
Coordinator-->>Client: Final response
221
+
end
222
+
```
223
+
137
224
Steps are skipped at runtime when they do not apply (for example, `encode` is a no-op
138
225
when the request has no multimodal entries, and `render` short-circuits when the
0 commit comments