diff --git a/README.md b/README.md index c6e095138..9384c5eed 100644 --- a/README.md +++ b/README.md @@ -169,9 +169,19 @@ This will start the Open WebUI server, which you can access at [http://localhost Enable Docker Model Runner in Docker Desktop and set the `DMR_BASE_URL` environment variable to the exposed API endpoint: -```bash -docker run -d -p 3000:8080 -e DMR_BASE_URL=http://localhost:12434 -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main -``` +- **When running Open WebUI in Docker** (container-to-container communication): + + ```bash + docker run -d -p 3000:8080 -e DMR_BASE_URL=http://model-runner.docker.internal:12434 -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main + ``` + +- **When running Open WebUI directly on the host** (host process accessing Docker Model Runner): + + ```bash + docker run -d -p 3000:8080 -e DMR_BASE_URL=http://localhost:12434 -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main + ``` + +**Note**: The default configuration uses `http://model-runner.docker.internal:12434` which works for Docker deployments. If you're running Open WebUI as a host process, make sure to set `DMR_BASE_URL=http://localhost:12434`. ### Installing Open WebUI with Bundled Ollama Support diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index b5fbe6f12..06d2e3001 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -904,7 +904,7 @@ ENABLE_DMR_API = PersistentConfig( "dmr.enable", os.environ.get("ENABLE_DMR_API", "True").lower() == "true", ) -DMR_BASE_URL = os.environ.get("DMR_BASE_URL", "http://localhost:12434") +DMR_BASE_URL = os.environ.get("DMR_BASE_URL", "http://model-runner.docker.internal:12434") # Remove trailing slash DMR_BASE_URL = DMR_BASE_URL[:-1] if DMR_BASE_URL.endswith("/") else DMR_BASE_URL