langflow icon indicating copy to clipboard operation
langflow copied to clipboard

OpenAI API Doesn't Stream

Open ilkersigirci opened this issue 1 year ago • 9 comments

Bug Description

Openai responses api was added to langflow in the PR #9069. Even though the official langflow docs says the streaming is supported, but the /v1/responses API endpoint doesn't return the streaming tokens.

Reproduction

curl -X POST "http://localhost:7860/api/v1/responses" \  
--no-buffer \
-H "Content-Type: application/json" \
-H "x-api-key: my-api-key" \
-d '{
    "model": "my-flow-id",
    "input": "Write a poem about the human",
    "stream": true
}'

Only returns start and end, not the llm tokens

data: {"id":"dc627efe-e2cb-4d27-9e51-f71246b68a8d","object":"response.chunk","created":1760613822,"model":"my-flow-id","delta":{"content":""},"status":null}

data: {"id":"dc627efe-e2cb-4d27-9e51-f71246b68a8d","object":"response.chunk","created":1760613822,"model":"my-flow-id","delta":{},"status":"completed"}

data: [DONE]

The langflow debug logs shows consumed events like below but those events doesn't return as curl response

Image

Expected behavior

I would expect the OpenAI compatible api endpoint to stream back all llm tokens like in the /v1/run endpoint. If I request http://localhost:7860/api/v1/run/{flow_id}?stream=true endpoint which doesn't support OpenAI api, I can successfully stream back the llm tokens. But I want to utilize OpenAI client which needs an OpenAI API endpoint.

Who can help?

No response

Operating System

Ubuntu 24.04

Langflow Version

1.6.4

Python Version

3.11

Screenshot

No response

Flow File

No response

ilkersigirci avatar Oct 16 '25 11:10 ilkersigirci

Any update on this @Empreiteiro ?

ilkersigirci avatar Nov 03 '25 06:11 ilkersigirci

please fix this.

FILM6912 avatar Nov 04 '25 06:11 FILM6912

same here.....

MikaHollander avatar Nov 13 '25 12:11 MikaHollander

same here..

onghuisheng avatar Nov 21 '25 03:11 onghuisheng

@ilkersigirci @FILM6912 I've already tried and managed to reproduce the error. The problem has been forwarded to the technical team and will be fixed soon.

Empreiteiro avatar Nov 26 '25 17:11 Empreiteiro

still encountering the same bug

Yasser87887 avatar Dec 15 '25 05:12 Yasser87887

LFOSS-3081

Empreiteiro avatar Dec 17 '25 15:12 Empreiteiro

Please, could you share the progress updates for this? @Empreiteiro

ilkersigirci avatar Jan 20 '26 09:01 ilkersigirci

Fixed, but we still have another problem with this endpoint: https://github.com/langflow-ai/langflow/issues/10719.

Empreiteiro avatar May 07 '26 22:05 Empreiteiro