DEV Community

talos13
talos13

Posted on

I built a zero-backend, browser-only alternative to Open WebUI and heavy LLM stacks

Most open-source LLM chat interfaces follow the exact same blueprint: a heavy Python or Node.js backend, a Postgres/Redis database, and a multi-container Docker Compose setup just to pass a JSON prompt to an API.

If you just want a clean, responsive workspace to inspect token counts, test system prompts, or chat with your local Ollama instance, deploying 2GB+ of Docker containers is massive overkill.

That’s why I built Lab - a lightweight, completely serverless, local-first web environment for LLMs.

Lab Interface

Lab Interface

πŸ’‘ Core Architecture

  • Zero Backend: Everything executes entirely on the client side in your browser.
  • Local Storage via IndexedDB: Chats, model configs, system prompts, and API keys are persisted locally in your browser using Dexie.js. Nothing ever touches my servers.
  • Surgical Context Controls:
    • Exact token usage breakdown per message: User vs. Assistant vs. Tool vs. System.
    • Message Pinning: Lock essential system instructions or context anchors in place to prevent them from being pruned when managing context windows.
    • Collapsible code blocks and raw JSON payload inspectors.
  • Multi-Provider Support: Seamlessly switch between Anthropic, OpenAI, OpenRouter, Google Gemini, and local models via Ollama.
  • Offline & PWA Ready: Installable as a native desktop or mobile PWA with background service worker caching.

πŸ› οΈ Working with Local Models (Ollama)

Since Lab runs entirely in your browser over HTTPS, connecting to a local Ollama instance (http://localhost:11434) requires allowing browser cross-origin requests.

Simply set the environment variable on your Ollama host:

# Linux (systemd)
sudo systemctl edit ollama.service

# Add:
[Service]
Environment="OLLAMA_ORIGINS=*"
Enter fullscreen mode Exit fullscreen mode

Restart Ollama, and Lab connects instantly directly from your browser tab.


πŸ”— Links & Code

The project is fully open-source under the AGPL-v3.0 license:

Feedback, bug reports, and PRs are more than welcome!

Top comments (2)

Collapse
 
raknaos profile image
Raknaos •

Two things I'd flag before running this against a local Ollama. OLLAMA_ORIGINS=* means every page open in that browser can hit localhost:11434 with no credentials and no CORS error β€” drive-by scripts scanning for an exposed inference endpoint are a known pattern. Pinning it to the exact app origin rather than a wildcard keeps the same demo working.

The other one is the API keys sitting in IndexedDB: any extension with host permissions, or one XSS in the PWA, reads them in plaintext since there is no server boundary to hide behind. For a local-only tool that is a fair trade, but I'd say it out loud in the README next to the proxy setup β€” that is the part people copy without reading.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.