Kong AI Gateway
Kong is not Envoy-based, so the ext_proc mode does not apply. Two shapes
work:
Option A: inline mode in front of Kong
Point clients at routeD and routeD at Kong's OpenAI-compatible route:
routed serve --mode inline --upstream http://kong:8000 \
--resources /etc/routed/resources
Kong's ai-proxy plugin then receives the rewritten model. Configure the
plugin with route_type: llm/v1/chat and model selection from the request
body so routeD's rewrite is honoured.
Option B: decision API from a plugin
Call POST /v1/decide from a custom plugin (Lua or the WASM plugin
runtime) in the access phase:
- Read the buffered request body and the caller's headers.
POSTthe body tohttp://routed:8080/v1/decidewith the original path inX-Routed-Path; forward anyX-Routed-*caller hints verbatim (routeD treats them as untrusted and only lets them tighten the decision, ADR-0007).- On
BLOCK, terminate with the returned 403 envelope. OnROUTE, setbody.model = decision.gatewayModel, mergedecision.parameters, and letai-proxycontinue. - Fail closed: terminate with 503 when routeD is unreachable, matching
failure_mode_allow: falsesemantics elsewhere.
Report outcomes to POST /v1/feedback (with the decision id) to feed the
phase 6 learning loop.