Describe the solution you'd like
It is necessary to pass all headers from the original ollama service. Well, or at least the correct Content-Type: application/x-ndjson.
Describe alternatives you've considered
I tried to use openAI compatible API through /v1/chat/completions and this work correctly, i get Content-Type: application/json.
Originally created by @unixshaman on GitHub (Aug 26, 2024).
**Is your feature request related to a problem? Please describe.**
When I send request to original ollama service, like this:
```
POST http://127.0.0.1:11434/api/chat HTTP/1.1
Cache-Control: no-cache
Accept: text/event-stream
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:11434
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/4.12.0
{"model":"llama3.1:8b","messages":[{"role":"system","content":""},{"role":"user","content":"Привет"}],"options":{"temperature":0.10000000149011612,"num_predict":2048},"stream":true}
```
get next response:
```
HTTP/1.1 200 OK
Content-Type: application/x-ndjson
Date: Mon, 26 Aug 2024 13:14:53 GMT
Content-Length: 25933
{"model":"llama3.1:8b","created_at":"2024-08-26T13:14:53.7962491Z","message":{"role":"assistant","content":"H"},"done":false}
{"model":"llama3.1:8b","created_at":"2024-08-26T13:14:53.9117733Z","message":{"role":"assistant","content":"e"},"done":false}
{"model":"llama3.1:8b","created_at":"2024-08-26T13:14:53.9882669Z","message":{"role":"assistant","content":"ll"},"done":false}
{"model":"llama3.1:8b","created_at":"2024-08-26T13:14:54.0081587Z","message":{"role":"assistant","content":"o"},"done":false}
```
When I send equal request to ollama through topen-webui
```
POST https://host.com:443/ollama/api/chat HTTP/1.1
Cache-Control: no-cache
Accept: text/event-stream
Authorization: Bearer sk-*****
Content-Type: application/json; charset=utf-8
Host: host.com:443
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/4.12.0
{"model":"llama3.1:8b","messages":[{"role":"system","content":""},{"role":"user","content":"Hello"}],"options":{"temperature":0.10000000149011612,"num_predict":2048},"stream":true}
```
get next response:
```
HTTP/1.1 200 OK
Server: nginx/1.18.0 (Ubuntu)
Date: Mon, 26 Aug 2024 13:18:11 GMT
Connection: keep-alive
x-process-time: 5
Content-Length: 22054
{"model":"llama3.1:8b","created_at":"2024-08-26T13:18:11.678360742Z","message":{"role":"assistant","content":"H"},"done":false}
{"model":"llama3.1:8b","created_at":"2024-08-26T13:18:11.705184821Z","message":{"role":"assistant","content":"e"},"done":false}
{"model":"llama3.1:8b","created_at":"2024-08-26T13:18:11.731536581Z","message":{"role":"assistant","content":"ll"},"done":false}
{"model":"llama3.1:8b","created_at":"2024-08-26T13:18:11.75741211Z","message":{"role":"assistant","content":"o"},"done":false}
```
**Describe the solution you'd like**
It is necessary to pass all headers from the original ollama service. Well, or at least the correct Content-Type: application/x-ndjson.
**Describe alternatives you've considered**
I tried to use openAI compatible API through /v1/chat/completions and this work correctly, i get Content-Type: application/json.
@unixshaman Ignore the comment above that tells you to download something at all costs. These are bot accounts attempting to spread some form of unwanted malware. Our GitHub Updates channel on Discord has made us aware today that newly opened posts on the repository are being targeted by an unknown actor.
@silentoplayz commented on GitHub (Aug 26, 2024):
@unixshaman Ignore the comment above that tells you to download something at all costs. These are bot accounts attempting to spread some form of unwanted malware. Our GitHub Updates channel on Discord has made us aware today that newly opened posts on the repository are being targeted by an unknown actor.
@unixshaman commented on GitHub (Aug 26, 2024):
By the way, I need this modification so that the GhatGPT plugin for IntelliJ IDEA works correctly: https://github.com/carlrobertoh/CodeGPT/issues/674
@unixshaman commented on GitHub (Aug 28, 2024):
Hello @tjbck !
Thank you very much for working on the feature.
I saw commit https://github.com/open-webui/open-webui/commit/689b05a73df2f12858d798ce90cdbde500cc0747, and it into release https://github.com/open-webui/open-webui/releases/tag/v0.3.16 , if I'm not mistaken.
I update my service and check this again, but result is same, no header in response.
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.
Originally created by @unixshaman on GitHub (Aug 26, 2024).
Is your feature request related to a problem? Please describe.
When I send request to original ollama service, like this:
get next response:
When I send equal request to ollama through topen-webui
get next response:
Describe the solution you'd like
It is necessary to pass all headers from the original ollama service. Well, or at least the correct Content-Type: application/x-ndjson.
Describe alternatives you've considered
I tried to use openAI compatible API through /v1/chat/completions and this work correctly, i get Content-Type: application/json.
@silentoplayz commented on GitHub (Aug 26, 2024):
@unixshaman Ignore the comment above that tells you to download something at all costs. These are bot accounts attempting to spread some form of unwanted malware. Our GitHub Updates channel on Discord has made us aware today that newly opened posts on the repository are being targeted by an unknown actor.
@unixshaman commented on GitHub (Aug 26, 2024):
Thank you very much for the explanation! I understood it as soon as I saw it.
@unixshaman commented on GitHub (Aug 26, 2024):
By the way, I need this modification so that the GhatGPT plugin for IntelliJ IDEA works correctly: https://github.com/carlrobertoh/CodeGPT/issues/674
@tjbck commented on GitHub (Aug 27, 2024):
Should be fixed on dev, testing wanted here!
@unixshaman commented on GitHub (Aug 28, 2024):
Hello @tjbck !
Thank you very much for working on the feature.
I saw commit https://github.com/open-webui/open-webui/commit/689b05a73df2f12858d798ce90cdbde500cc0747, and it into release https://github.com/open-webui/open-webui/releases/tag/v0.3.16 , if I'm not mistaken.
I update my service and check this again, but result is same, no header in response.
@Peter-De-Ath commented on GitHub (Sep 5, 2024):
It looks okay to me
@unixshaman commented on GitHub (Sep 6, 2024):
Yes, now it's works! Many many thanks!