Skip to content

Stream LLM responses token-by-token #6

Description

@rowlandelisha

The widget currently waits for the full answer before showing anything (server/src/llm.js calls the LLM non-streaming, widget/widget.js awaits the full JSON response). Wire up streaming (SSE from the backend, or fetch streaming) so answers appear incrementally, which will feel much more responsive.

Suggested scope:

Add a streaming code path in llm.js for both OpenAI and Anthropic
Switch POST /api/chat to stream chunks (SSE) when the client requests it
Update widget.js to append tokens as they arrive instead of waiting for the full response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions