Local-first, privacy-first, offline-first AI for the browser.
Run ML models entirely in your browser. No servers. No API keys. Your data never leaves your device.
Docs website: https://localmode.dev
UI Components: https://localmode.ai
Blocks & Apps: https://localmode.ai/blocks
What is LocalMode?
LocalMode is a monorepo of packages for building AI-powered applications that run 100% in the browser. Everything from embeddings and vector search to LLM chat, vision, audio, agents, and structured output works offline after the initial model download.
15 packages. 36 demo blocks. Zero cloud dependencies.
Why LocalMode?
Privacy -- Your data never leaves your device. No telemetry, no tracking, no network requests from core.
Offline -- Works without internet after model download. Automatic fallbacks for every capability.
Fast -- No network latency. WebGPU acceleration where available. Instant inference.
Free -- No API costs, no rate limits, unlimited usage.
Universal -- Works in Chrome, Edge, Firefox, and Safari. Adapts to device capabilities.
Interoperable -- Vercel AI SDK patterns. LangChain.js adapters. Import from Pinecone/ChromaDB.
HuggingFace Transformers.js provider -- 26 model factories covering embeddings, classification, vision, audio, OCR, multimodal (CLIP), and LLM inference via ONNX (Qwen3.5 vision support)
@localmode/webllm
WebLLM provider for LLM inference via WebGPU -- 32 curated models including DeepSeek-R1, Qwen3, Llama 3.2, Phi 3.5 Vision
@localmode/wllama
GGUF model provider via llama.cpp WASM -- 30 curated models (text, vision, embeddings, reranking), true streaming, structured output (JSON mode), reasoning mode, WebGPU acceleration, tool calling, grammar sampling (GBNF), LoRA adapters, model management, GGUF model discovery (searchGGUFModels/listGGUFFiles), 160K+ HuggingFace models, universal browser support
@localmode/litert
Google LiteRT-LM provider (.litertlm models, WebGPU + CPU WASM fallback). Text-only, early preview. Catalog ships Gemma 4 E2B/E4B and Qwen3 0.6B, all verified end-to-end. Gated Gemma 3n / Gemma 3 1B loadable via custom URL.
@localmode/mediapipe
Google MediaPipe Tasks provider -- real-time hand/pose/face landmark tracking, gesture recognition, image & audio classification, language detection. WASM + WebGL, all browsers.
@localmode/chrome-ai
Chrome Built-in AI provider -- your app ships no model files; Chrome supplies Gemini Nano. Automatic fallback
@localmode/langchain
LangChain.js adapters -- drop-in local embeddings, chat, vector store, and reranker for existing LangChain apps, plus createLangChainKnowledgeBaseEngine (the KnowledgeBaseEngine contract over LangChain adapters)
@localmode/devtools
In-app AI observability -- 9 React hooks via the @localmode/devtools/react subpath for model cache, VectorDB stats, and inference queue data (the bundled DevTools widget UI was removed in v3.0.0 in favor of the hooks + the ui/devtools registry family and ui/blocks/devtools-drawer at localmode.ai)
@localmode/pdfjs
PDF text extraction with PDF.js
@localmode/dexie
Dexie.js storage adapter with schema versioning and transactions
@localmode/idb
Minimal IndexedDB storage adapter using the idb library
@localmode/localforage
Cross-browser storage adapter with automatic fallback
@localmode/ui — UI registry (not an npm package)
LocalMode UI is a shadcn-style registry of copy-owned AI UI components: 107 primitives across 10 families, plus 37 blocks that wire them to real on-device models. Like shadcn/ui, you install with the shadcn CLI and own the copied code, styled with shadcn/ui CSS variables so it inherits your theme. See the docs, installation guide, and apps/ui/README.md.
The primitives are presentational and install with zero @localmode/* packages, so they work with any React AI app — the LocalMode hooks (on-device), the Vercel AI SDK, or your own data. Local-first by design, cloud-compatible by contract.
bash
# components.json → { "registries": { "@localmode": "https://localmode.ai/r/{name}.json" } }npx shadcn@latest add @localmode/ui/conversation/message # a single componentnpx shadcn@latest add @localmode/ui/conversation # a whole familynpx shadcn@latest add @localmode/ui/all # the whole catalog
Blocks are complete experiences composed from the primitives — the wiring layer, and the only items that depend on @localmode/*. Each runs real models on-device and gates its download behind an explicit in-block action. Try them in the /blocks gallery, then install with npx shadcn@latest add @localmode/ui/blocks/<category>/<block>.
Category
Blocks
chat
The flagship — streaming chat across 76 models and 4 providers, with vision, reasoning, agent mode, semantic caching, and custom GGUF URLs
pii-redactor · encrypted-vault — on-device NER redaction with a differential-privacy demo, and a passphrase-locked AES-GCM vault
The 37th item, ui/blocks/devtools-drawer, is layout chrome rather than a gallery page: a six-tab observability drawer over @localmode/devtools, off by default and loaded only on first open. The 34 demo-app URLs from the previous localmode.ai site permanently redirect to the block that absorbed each one.
Browser feature detection with automatic fallbacks
Cross-Tab Sync
createBroadcaster(), createLockManager()
BroadcastChannel sync with Web Locks coordination
Network Status
getNetworkStatus(), waitForOnline()
Offline-first with network awareness
Demo Applications — the Blocks Gallery
See LocalMode running real models entirely in your browser at the /blocks gallery (localmode.ai/blocks). The gallery ships 36 route-served blocks across 12 categories — full experiences assembled from the registry primitives (chat plus the knowledge, vision, audio, text, device, writing-tools, agents, text-insights, photo, image-studio, and privacy category pages) plus the global-observability devtools-drawer chrome — each installable with npx shadcn@latest add @localmode/ui/blocks/<name>.
Full block descriptions, what each one covers, and install commands are in the @localmode/ui UI-registry section above (the authoritative block catalog).
Legacy localmode.ai/<slug> URLs permanently redirect to the corresponding block.