mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
issue: Cannot use OpenAI-compatible server API in Playground Completions mode #5458
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @secminhr on GitHub (Jun 6, 2025).
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.6.13 (dev branch, commit
0b84b22)Ollama Version (if applicable)
No response
Operating System
macOS Sequoia
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
In Playground Completions mode, when the selected model is from an OpenAI-compatible server, by clicking the Run button the input prompt should be sent to the server API and get the response.
Actual Behavior
When the selected model is from an OpenAI-compatible server, the Run button will send a request to http://localhost:{backend_port}/api/chat/completions instead of the model's server URL. Therefore only built-in models work.
Steps to Reproduce
WEBUI_AUTH=falseto.envto use single-user mode.npm run dev.backendand start backend with./dev.sh.Python environment running backend is created via conda, following the instructions in the documentation.
Logs & Screenshots
Additional Information
Modified
.envfor your reference:A fix I've done on my local machine is adding a
model.directcheck insrc/lib/components/playground/Completions.svelte, and updating the URL and token argument tochatCompletioncorrespondingly.@tjbck commented on GitHub (Jun 6, 2025):
@ayanahye
@ayanahye commented on GitHub (Jun 8, 2025):
Hello, I wanted to clarify why you're setting the OPEN_API_BASE_URL to empty string? If you set it to whichever port your OpenAI-compatible provider is on it should work. Please let me know, thank you!
@secminhr commented on GitHub (Jun 9, 2025):
I added the OpenAI-compatible server via Settings/Connections. I didn't change OPEN_API_BASE_URL because the normal chat will work without that additional environment variable, so I thought Playground/Completions should also work.
After playing around with OPEN_API_BASE_URL, I found that if the URL is provided via OPEN_API_BASE_URL, it's marked as
Externalin the model selector; if the URL is provided via Settings/Connections, then it's markedDirect. And it seems that Playground/Completions only supports External models, while normal chat supports them both.I used 2 URLs to test that, by opening 2 servers on my local machine (serving different models). One is added in
.env, and another one is added via Settings/Connections.Is it intended to only support External models? But then it would be difficult for non-admin users to use Playground/Completions with their own OpenAI-compatible servers.
@ayanahye commented on GitHub (Jun 10, 2025):
Hello, thank you for your response. Yes, you are right. Currently, Open WebUI supports External Connections, but Direct connections are not fully supported yet. We are updating the Docs with more information. Thank you!
@secminhr commented on GitHub (Jun 11, 2025):
Got it. Thank you.