mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
bug: Streamed responses from OpenAI external source fall behind, then suddenly catch up when stream ends #248
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bjj on GitHub (Feb 1, 2024).
Bug Report
Description
Bug Summary:
When using a model via the external OpenAI connection, the text streams into the webui a bit slower than the model is streaming. Then, when the input stream is done, the last chunk of the response appears suddenly.
Steps to Reproduce:
Choose an OpenAI compatible external server. One widely available one is OpenRouter.
Choose a model that will stream relatively slowly (e.g. 10t/s).
Use a prompt with a long answer.
Expected Behavior:
The webui streams the response at the same speed as the source, ending at the same time as the source.
Actual Behavior:
The webui streams slightly slower than the source, dumping the backlog suddenly when the OpenAI connection closes.
Environment
Reproduction Details
Confirmation:
Logs and Screenshots
Browser Console Logs:
Docker Container Logs:
Screenshots (if applicable):
Skip forward to about 57 seconds:
https://github.com/ollama-webui/ollama-webui/assets/62541/6956b482-72ab-4da4-b493-bdb39ca80358
Installation Method
Docker container on Windows
Additional Information
I've verified multiple ways that the output of the OpenAI endpoint is smooth for the entire time. It just streams for the same period of time, slightly faster, and when it ends, the webui suddenly catches up.
@tjbck commented on GitHub (Feb 1, 2024):
Hmm, is the webui being served over proxy of some sort? My guess is that internet speed/connection is the culprit here.
@justinh-rahb commented on GitHub (Feb 1, 2024):
Can confirm that if you put proxies in between ollama-webui and your ollama or other external APIs, you're going to notice things like this issue happening. It's kind of annoying but I don't believe there's much that could be done about it, certainly not from ollama-webui anyhow.
@bjj commented on GitHub (Feb 1, 2024):
Thanks. There's definitely a difference in behavior here between curl and ollama-webui, but I can work around it elsewhere. If I figure out what option is slightly different there I'll come back and add it to the issue.