Skip to content

Screen Rendering Slows Down Towards the End of Streaming from LLM Server #1388

Open
@calycekr

Description

@calycekr

While the initial part of streaming from the LLM server is fine, the screen display speed slows down as time progresses, particularly towards the end of the streaming process. However, the LLM server has already finished sending the data, and only the screen display continues to be updated.

// Send the update to the client
controller.enqueue(JSON.stringify(event) + "\n");
// Send 4096 of spaces to make sure the browser doesn't blocking buffer that holding the response
if (event.type === "finalAnswer") {
controller.enqueue(" ".repeat(4096));
}

I suspect the above code section. Could it be a shortage of buffer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfrontThis issue is related to the front-end of the app.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions