WebLLM

Node.js Daemon

Run WebLLM inference on desktop (Windows, Linux, macOS) with any browser

What is the Daemon?

The WebLLM daemon is a simple Node.js tool that runs @webllm/server on your desktop (Windows, Linux, or macOS). It requires Node.js to be installed on your system.

🌐 Works with ALL browsers

The BIG benefit: No browser extension needed! Use WebLLM with Firefox, Safari, Edge, Brave, or any browser. The daemon runs as a local server that any browser can connect to.

Best for:

  • • Using non-Chrome browsers
  • • Local development
  • • Testing without extension
  • • CI/CD pipelines
  • • Quick prototyping

Features:

  • • HTTP and SSE endpoints
  • • Debug mode with detailed logs
  • • Token-based auth
  • • CORS enabled

Quick Start

Run the daemon:
npx webllm daemon

Starts server at http://localhost:54321

Updating

Get the latest version:
npx webllm@latest daemon

Using npx, pnpm dlx, or yarn dlx always fetches the latest version automatically.

If you installed globally with npm install -g webllm, update with npm install -g webllm@latest

Storage & Preferences

⚠️ Separate Storage

The daemon and browser extension store preferences in different locations. They do not share configuration.

If you switch from the extension to the daemon (or vice versa), you'll need to re-enter your API keys and configure your providers again.

Extension Storage:

Browser's IndexedDB

Daemon Storage:

~/.webllm/ directory

Configuration

Environment Variables
Variable
Default
Description
PORT54321Server port
HOSTlocalhostServer host
DEBUGfalseEnable debug logs
AUTH_ENABLEDtrueRequire token auth
CLI Options

💡 Debug Mode for Developers

Use --debug to see detailed logs showing how WebLLM routes and processes your requests:

  • • Provider selection logic and priority order
  • • Request transformation and message formatting
  • • API calls and responses from each provider
  • • Fallback behavior when a provider fails
  • • Storage operations and conversation tracking

Perfect for understanding the full request pipeline and debugging integration issues.

API Endpoints

POST
/api

Execute LLM requests

POST
/sse

Server-Sent Events for streaming

GET
/health

Health check endpoint

GET
/config/providers

List configured providers

Authentication

The daemon generates a token on first startup, saved to ~/.webllm/daemon.token

Client Integration

The @webllm/client SDK automatically detects and connects to the daemon:

Best Practices

✅ Use with any browser

The daemon works with Firefox, Safari, Edge, Brave, and any browser—not just Chrome. Perfect for cross-browser development and testing.

✅ Keep auth enabled

Only disable auth for testing. Always use token authentication to prevent unauthorized access from other applications on your machine.

✅ Use debug mode when developing

Run with --debug to see detailed logs and understand how your requests are routed and processed.

✅ Remember separate storage

The daemon doesn't share configuration with the browser extension. You'll need to configure providers and API keys separately.