Open WebUI
Open WebUI can connect to external model services through OpenAI-compatible configuration. When self-hosting Open WebUI, you can set the Tokeness Base URL and API key via environment variables or the admin panel.
Preparation
| Field | Value |
|---|---|
| OpenAI API Base URL | https://n.tokeness.dev/v1 |
| OpenAI API Key | A key created in the Tokeness console |
| Model | The full model name copied from the Tokeness model catalog |
If your Open WebUI has been running for a while, some environment variables may have already been persisted to the database. When later changes do not take effect, update them in the admin panel or follow Open WebUI's persistent configuration guide.
Docker Environment Variable Method
For single-machine testing, start like this:
docker run -d \
--name open-webui \
-p 3000:8080 \
-e OPENAI_API_BASE_URL=https://n.tokeness.dev/v1 \
-e OPENAI_API_KEY=your Tokeness API key \
-v open-webui:/app/backend/data \
ghcr.io/open-webui/open-webui:mainIf you use docker compose, you can write:
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
ports:
- "3000:8080"
environment:
OPENAI_API_BASE_URL: https://n.tokeness.dev/v1
OPENAI_API_KEY: ${TOKENESS_API_KEY}
volumes:
- open-webui:/app/backend/data
volumes:
open-webui:Put the key in a .env file:
TOKENESS_API_KEY=your Tokeness API keyAdmin Panel Method
If Open WebUI is already running, you can configure it in the admin panel:
- Log in to Open WebUI.
- Open the Admin Panel.
- Find the Connections or Models settings.
- Locate the OpenAI API configuration.
- Set the Base URL to
https://n.tokeness.dev/v1. - Enter your Tokeness API key.
- Save and refresh the page.
Menu names may differ across versions. As long as the field means OpenAI Base URL and OpenAI API Key, fill in the values above.
Set the Default Model
If you want new users to see a specific model by default, set:
DEFAULT_MODELS=YOUR_MODEL_NAMEReplace YOUR_MODEL_NAME with the full model name from the Tokeness model catalog.
For multiple models, separate with commas:
DEFAULT_MODELS=model-a,model-bRAG and Embedding
Open WebUI's knowledge base, RAG, voice, and image features may have separate configuration items. Get standard chat working first, then configure these.
Common embedding fields:
RAG_OPENAI_API_BASE_URL=https://n.tokeness.dev/v1
RAG_OPENAI_API_KEY=your Tokeness API keyThe embedding model name must be a vector model available in Tokeness. Do not put a chat model in the vector model field.
Verification
- Open Open WebUI.
- Select a model from Tokeness.
- Send "reply with ok only".
- Open the Tokeness usage logs and confirm a request arrived.
- If you configured a knowledge base, upload a small text file and test retrieval.
Troubleshooting
| Symptom | Action |
|---|---|
| Environment variable changes do not take effect | Open WebUI may have persisted the config — update it in the admin panel or handle PersistentConfig |
| Model list is empty | Enter the Tokeness model name manually |
| 401 | Check OPENAI_API_KEY |
| 404 | Check that OPENAI_API_BASE_URL is https://n.tokeness.dev/v1 |
| Chat works but knowledge base does not | Check the embedding model and RAG-related configuration separately |
| Requests fail inside the Docker container | Enter the container and check network, DNS, and proxy settings |