diff --git a/dev/ai-gateway-kustomization.yaml b/dev/ai-gateway-kustomization.yaml index 68ca314..3d13303 100644 --- a/dev/ai-gateway-kustomization.yaml +++ b/dev/ai-gateway-kustomization.yaml @@ -18,6 +18,16 @@ spec: substitute: NAME: llm-dev NAMESPACE: llm + # 256k, against the 8k the other domains keep. Prompts here carry the + # conversation and the MCP tool definitions and already run to 30 KB; + # below this nginx spills the body to a temp file and + # kong.request.get_raw_body() returns nil, which is what left ai-proxy's + # log_payloads and log_statistics producing nothing at all. + # + # Affordable precisely because this gateway is low-traffic — the buffer is + # per connection carrying a body. Do not copy it to the domain gateways + # without doing that arithmetic for their volume. + CLIENT_BODY_BUFFER_SIZE: 256k HOSTNAME: llm-dev.sttlab.local substituteFrom: - kind: ConfigMap diff --git a/kong/ai-proxy-advanced.yaml b/kong/ai-proxy-advanced.yaml index c36a483..0d92067 100644 --- a/kong/ai-proxy-advanced.yaml +++ b/kong/ai-proxy-advanced.yaml @@ -5,6 +5,10 @@ metadata: namespace: ${NAMESPACE} plugin: ai-proxy-advanced config: + # The plugin's own ceiling on what it will introspect, distinct from nginx's + # client_body_buffer_size — both have to clear 30 KB prompts or the payload + # and usage logging stay empty. Raised together; neither alone is enough. + max_request_body_size: 262144 targets: - route_type: llm/v1/chat auth: