AI agent that runs entirely in your browser Β· Live Demo
-
Local models via WebGPU β Run open-source LLMs directly in your browser using
@mlc-ai/web-llm. Model weights are cached in-browser; nothing leaves your machine.Want your own fine-tuned model in the picker? See Bring Your Own Model.
-
External API mode β Connect to any OpenAI-compatible API: OpenAI, OpenRouter, or a custom base URL.
-
Agent tool loop β Built-in tools:
get_time,fetch_url, andrun_javascript(sandboxed in a Web Worker). -
Persistent memory β Save and recall agent memories across chats with
memory_saveandmemory_delete. Memories live in the browser's virtual filesystem and survive page reloads. -
User-defined skills β Create, edit, and delete custom skills stored in
localStorage, loaded via theuse_skilltool. -
Remote MCP servers β Connect to MCP servers over Streamable HTTP, with tool names automatically prefixed by server.
- Local models: A WebGPU-capable browser β Chrome/Edge 113+, or recent Firefox/Safari builds.
- API mode: Any modern browser.
- Model downloads: ~1β3 GB depending on the model. Weights are cached in the browser after first download.
- Choose Local (WebGPU) or API mode.
- Local: pick a preset model and wait for it to download/cache. API: enter your API key and model ID.
- Chat with the agent.
- Add custom skills via the Skills panel.
- Add MCP servers via the MCP panel (servers must be CORS-enabled β see note below).
CORS limitation: MCP servers must have CORS headers configured to accept requests from the browser. This is a browser security constraint, not a bug in webgpu-agent.
- API keys are stored in browser
localStorageonly β never sent to any third party. run_javascriptexecutes inside a Web Worker sandbox with no DOM access.- All requests originate directly from your browser. There is no intermediate backend.
npm install
npm run dev # start dev server
npm test # run tests (vitest run)
npm run build # production build
npm run preview # preview production build| Directory | Purpose |
|---|---|
src/providers/ |
Model providers β local (WebLLM) and external API |
src/agent/ |
Agent loop and tool prompt generation |
src/tools/ |
Built-in tools (get_time, fetch_url, run_javascript) |
src/skills/ |
User-defined skills store (localStorage) |
src/mcp/ |
MCP client manager (Streamable HTTP) |
src/ui/ |
React UI components (chat, model picker, panels) |
The system prompt includes a # Skills section listing every installed skill's name and description. When the model needs full instructions, it calls use_skill with the exact skill name to load the complete SKILL.md on demand. This progressive disclosure keeps prompts small while giving the agent access to detailed workflows.
Skills live in /home/user/.agent/skills/<slug>/SKILL.md inside the browser's virtual filesystem (IndexedDB via @isomorphic-git/lightning-fs). User-created skills are managed through the Skills UI panel and persist across sessions.
The catalog is built by src/skills/store.ts and injected into the system prompt by src/agent/context.ts.
The agent has access to persistent file-based memory stored in the browser's virtual filesystem at /home/user/.agent/memory/. Each memory is a markdown file with name and description frontmatter. An index file, MEMORY.md, lists all saved memories.
- Save β
memory_savetool writes a new memory file and updates the index. - Delete β
memory_deletetool removes a memory file and updates the index. - Recall β The
MEMORY.mdindex is injected into the system prompt each run (viasrc/agent/context.ts); the agent reads individual memory files withfs_readas needed.
Memory survives page reloads and new chats β it is backed by IndexedDB. The index and usage guidance are injected as a # Memory section in the system prompt so the agent always knows what it has remembered and how to manage it.
Push to main β GitHub Actions automatically builds and deploys to GitHub Pages.
Vite Β· React Β· TypeScript Β· @mlc-ai/web-llm Β· @modelcontextprotocol/sdk Β· Vitest