Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions python/llm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ The first start downloads the model in the background — watch the `[ollama]`
log lines for pull progress. The model list in the UI populates once the pull
completes.

> On the device each service runs in its own network namespace, so the
> Docker service-name URL (`http://ollama:11434`) does not resolve. The
> `open-webui` entrypoint detects the agent-injected `WENDY_DEVICE_HOSTNAME`
> and rewrites `OLLAMA_BASE_URL` to reach Ollama's host-published port
> instead.
> On WendyOS, app groups do not get Docker Compose's service-name DNS, so
> the local Compose URL (`http://ollama:11434`) does not resolve from Open
> WebUI. The entrypoint rewrites that URL to `http://127.0.0.1:11434` on
> device because Ollama publishes its API on the shared device network stack.
> This deliberately avoids the device's `.local` hostname: mDNS works on the
> host for discovery, but app containers do not reliably include the NSS/mDNS
> pieces needed to resolve `.local` names from inside the container.

> Compose app groups do not yet support Wendy readiness probes or
> `postStart` hooks, so the browser is not opened automatically.
Expand Down
20 changes: 13 additions & 7 deletions python/llm/open-webui/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@ export WEBUI_AUTH="${WEBUI_AUTH:-False}"
export ENABLE_PERSISTENT_CONFIG="${ENABLE_PERSISTENT_CONFIG:-False}"
export WEBUI_NAME="${WEBUI_NAME:-Wendy}"

# On a Wendy device each compose service runs in its own network namespace,
# so the Docker service-name URL from docker-compose.yml does not resolve.
# The ollama service publishes 11434 on the device host, so point at it via
# the agent-injected device hostname instead (see the README).
if [[ -n "${WENDY_DEVICE_HOSTNAME:-}" && "${OLLAMA_BASE_URL:-}" == "http://ollama:11434" ]]; then
export OLLAMA_BASE_URL="http://${WENDY_DEVICE_HOSTNAME}:11434"
echo "Wendy device detected; OLLAMA_BASE_URL=${OLLAMA_BASE_URL}"
# On WendyOS app groups do not get Docker Compose's service-name DNS, so the
# local Compose URL (http://ollama:11434) is not usable from Open WebUI. Avoid
# rewriting to the device's .local hostname here: containers do not reliably
# have mDNS NSS support even when the host advertises itself with Avahi. The
# Ollama service publishes 11434 on the shared device network stack, making
# loopback the stable in-app route.
if [[ -n "${WENDY_DEVICE_HOSTNAME:-}" ]]; then
case "${OLLAMA_BASE_URL:-}" in
"http://ollama:11434"|"http://${WENDY_DEVICE_HOSTNAME}:11434")
Comment thread
konstantinbe marked this conversation as resolved.
Outdated
export OLLAMA_BASE_URL="http://127.0.0.1:11434"
echo "Wendy device detected; OLLAMA_BASE_URL=${OLLAMA_BASE_URL}"
;;
esac
fi

BRAND_PYTHON="/root/.local/share/uv/tools/open-webui/bin/python"
Expand Down
Loading