Description: Briefly describe the changes in this pull request.
Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
Documentation: Have you updated relevant documentation?
No need
Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
No
Description
Open WebUI doesn't work with Open Router as advertised in the Readme. When you try to do a chat completion, you can see errors on the front-end like:
Underlying reason is OpenRouter, when used in streaming mode sends heart beats in the stream like : OPENROUTER PROCESSING but front-end is not ignoring them.
According to MDN all events that starts with a colon should be ignored. I simply did that.
Changelog Entry
Fixed
Fixed OpenRouter heart beats breaking streaming
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/1773
**Author:** [@Rmaan](https://github.com/Rmaan)
**Created:** 4/26/2024
**Status:** ✅ Merged
**Merged:** 4/26/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `fix-openrouter-streaming`
---
### 📝 Commits (2)
- [`7449634`](https://github.com/open-webui/open-webui/commit/7449634290cc9b508067c0d1d843797328a0c4bc) Fix OpenRouter hearbeats breaking streaming
- [`4ad7ef8`](https://github.com/open-webui/open-webui/commit/4ad7ef84a4357e57232dd9a7db5a9e5be0335c74) add else
### 📊 Changes
**1 file changed** (+4 additions, -0 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/apis/streaming/index.ts` (+4 -0)
</details>
### 📄 Description
## Pull Request Checklist
- [X] **Description:** Briefly describe the changes in this pull request.
- [X] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description.
- [X] **Documentation:** Have you updated relevant documentation?
No need
- [X] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation?
No
---
## Description
Open WebUI doesn't work with Open Router as advertised in the Readme. When you try to do a chat completion, you can see errors on the front-end like:

Underlying reason is OpenRouter, when used in streaming mode sends heart beats in the stream like `: OPENROUTER PROCESSING` but front-end is not ignoring them.
According to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format) all events that starts with a colon should be ignored. I simply did that.
---
### Changelog Entry
### Fixed
- Fixed OpenRouter heart beats breaking streaming
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/1773
Author: @Rmaan
Created: 4/26/2024
Status: ✅ Merged
Merged: 4/26/2024
Merged by: @tjbck
Base:
dev← Head:fix-openrouter-streaming📝 Commits (2)
7449634Fix OpenRouter hearbeats breaking streaming4ad7ef8add else📊 Changes
1 file changed (+4 additions, -0 deletions)
View changed files
📝
src/lib/apis/streaming/index.ts(+4 -0)📄 Description
Pull Request Checklist
No need
No
Description
Open WebUI doesn't work with Open Router as advertised in the Readme. When you try to do a chat completion, you can see errors on the front-end like:

Underlying reason is OpenRouter, when used in streaming mode sends heart beats in the stream like
: OPENROUTER PROCESSINGbut front-end is not ignoring them.According to MDN all events that starts with a colon should be ignored. I simply did that.
Changelog Entry
Fixed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.