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
When using kong with the ai-proxy, streaming responses are "buffered" in kong 3.9.0 but are working with the same configuration in 3.8.0. See below for a fully reproducible example.
Expected Behavior
When requesting streaming, kong should correctly serve each SSE as soon as those are received.
Steps To Reproduce
You can use this docker-compose.yaml, you may need to comment/uncomment the kong migrations bootstrap/up piece:
curl -X POST http://localhost:8000/openai/v1/chat/completions \
-H 'Content-Type: application/json' \
--data-raw '{"model": "gpt-4o", "messages": [{"role": "user", "content": "What is deep learning?"}], "temperature": 0.7, "stream": true, "max_tokens": 100}'
change the kong image to 3.9.0, run the migrations and then docker compose up
re-run the same of point 3, kong will return all SSE at once, and also log (note that 3.8.0 does not have this warning):
kong-1 | 2025/04/18 17:52:53 [warn] 1405#0: *5218 an upstream response is buffered to a temporary file /usr/local/kong/proxy_temp/4/00/0000000004 while reading upstream, client: 172.19.0.1
disable the ai-proxy plugin and add the open key as bearer: -H "Authorization: Bearer $OPEN_AI_KEY"
re-run the same of point 3, streaming will work.
Anything else?
While the steps are for openai, I verified the same behavior with multiple providers (including bedrock and self-hosted).
The text was updated successfully, but these errors were encountered:
Is there an existing issue for this?
Kong version (
$ kong version
)3.8.0, 3.9.0
Current Behavior
When using
kong
with theai-proxy
, streaming responses are "buffered" in kong3.9.0
but are working with the same configuration in3.8.0
. See below for a fully reproducible example.Expected Behavior
When requesting streaming, kong should correctly serve each SSE as soon as those are received.
Steps To Reproduce
You can use this
docker-compose.yaml
, you may need to comment/uncomment thekong migrations bootstrap/up
piece:Steps:
docker compose up
kong
image to3.9.0
, run themigrations
and thendocker compose up
3.8.0
does not have this warning):ai-proxy
plugin and add the open key as bearer:-H "Authorization: Bearer $OPEN_AI_KEY"
Anything else?
While the steps are for
openai
, I verified the same behavior with multiple providers (includingbedrock
andself-hosted
).The text was updated successfully, but these errors were encountered: