You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
WebUI unusable behind a path-prefix reverse proxy (renders its own 404; API calls escape the prefix) #294
llama-swap (https://github.com/mostlygeek/llama-swap) can manage audiocpp_server
as an on-demand TTS backend: it starts/stops one instance per configured model and
proxies it under a path prefix, e.g. https://host/upstream/<model>/. The OpenAI
endpoints work great this way - but the embedded WebUI does not.
Problem
The WebUI is a SvelteKit app built for the domain root:
Pathname routing - the document is served fine at /upstream/<model>/ (HTTP 200), but the client-side router resolves the
current location.pathname, finds no matching route, and renders the
app's own 404 page. So any path-prefix deployment shows "404" even though
the server is healthy.
Root-absolute API calls - src/lib/api.ts fetches /health, /v1/models, /v1/audio/speech, … with absolute paths, so behind a prefix
they escape to the proxy root instead of reaching the instance.
What fixed it for me (tested)
svelte.config.js: kit.router = { type: 'hash' } - the pathname stops
mattering, and paths.relative: true (already set) keeps assets working.
Requires dropping the prerender/ssr page options from src/routes/+page.ts (hash router rejects them at build time).
Rebasing the root-absolute fetches onto the page's directory. I used a
small window.fetch wrapper in app.html (no-op when served at a real
root); making the api.ts paths relative would be the cleaner in-tree fix.
With those two changes the full UI (model load, TTS, cloning) works behind /upstream/<model>/ with zero proxy configuration. Happy to send a PR if
you're open to either approach.
Activity
0xShug0 commentedon Aug 22, 2026
@SelfRef Thanks for reporting this issue and PRs are very weclome!
Make embedded WebUI work behind a path-prefix reverse proxy
Make embedded WebUI work behind a path-prefix reverse proxy (0xShug0#297