Serverless models endpoint setting wrong "Content-Type" header
in progress
A
Aleksey
The serverless models endpoint is returning the wrong "Content-Type" value in the HTTP header for streaming responses.
Currently it returns: 'Content-Type': 'application/json'
It should return: 'Content-Type': 'text/event-stream'
This breaks some of the OpenAI clients, like open-webui, making parasail not usable!
R
R. K.
Hi Aleksey,
Thank you for trying our Serverless models. I've tested the open-webui with Parasail Serverless models. It looks like a nice tool to test various models. It also provides nice speech input.
The Content-Type request header is used to inform our gateway about the body of the request. This must be Content-Type: application/json. The Accept header can be used to set the Content-Type header for the response. If the Parasail gateway receives a Accept: text/event-stream header it will respond with the Content-Type: text/event-stream
I've create a branch and tested this behaviour for a couple of Parasail Serverless models. I've used these commands:
git clone -b feature/add-accept-header-for-streaming-response git@github.com:rinokadijk/open-webui.git
docker build -t open-webui-fix --no-cache .
docker run -d -p 3000:8080 -e OPENAI_API_KEY="psk-your-key" -e OPENAI_API_BASE_URL=https://api.parasail.io/v1 -e TASK_MODEL="parasail-deepseek-r1-0528" -e TASK_MODEL_EXTERNAL="parasail-deepseek-r1-0528" -e ENABLE_OPENAI_API=TRUE -e DEFAULT_MODELS="parasail-deepseek-r1-0528" -e ENABLE_OLLAMA_API=false -e GLOBAL_LOG_LEVEL="DEBUG" -v open-webui:/app/backend/data --name open-webui --restart always open-webui-fix
I hope this helps you get the full streaming experience in open-webui.
M.R.
in progress
M.R.
We've spent sometime on this and are coming up with some solutions aside from just turning off streaming.
A
Aleksey
On the open-webui side, I traced the issue to this line: https://github.com/open-webui/open-webui/blob/b5f4c85bb196c16a775802907aedd87366f58b0f/backend/open_webui/routers/openai.py#L850
Hope this helps, cheers!
M.R.
under review
M.R.
Thanks for posting this! We will take a look and figure out what is going on.
A
Aleksey
I patched that manually, but looks like there are more problems with open-webui connecting to parasail.
M.R.
Aleksey We are looking at how to fix this and have some solutions in mind