Run 100+ AI models entirely in your browser β no servers, no API keys, 100% private.
Features Β· How It Works Β· Tech Stack Β· Getting Started Β· Project Structure Β· Contributing Β· License
Think ChatGPT, but running on your hardware with zero cloud dependency.
All inference runs locally via WebGPU. Your conversations never leave your device.
|
|
|
|
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Browser β
β β
β ββββββββββββββββ postMessage βββββββββββββββββββ β
β β React UI β ββββββββββββββΊ β Web Worker β β
β β (main β β (MLC Engine) β β
β β thread) β β β β
β ββββββββ¬ββββββββ ββββββββββ¬βββββββββ β
β β β β
β β localStorage β WebGPU β
β βΌ βΌ β
β ββββββββββββββββ βββββββββββββββββββ β
β β Chat β β Your GPU β β
β β History β β (VRAM) β β
β ββββββββββββββββ βββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Cache API β Model weights persisted locally β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Download once β Quantized weights fetched from HuggingFace, stored in the browser Cache API
- Web Worker isolation β MLC engine runs in a dedicated worker to keep the UI silky smooth
- GPU inference β All matrix ops run on your GPU via WebGPU at near-native speed
- Stream to UI β Tokens stream back in real-time via
postMessage, rendered as rich Markdown - Persist locally β Chats saved to
localStorage, restored on reload
| Layer | Technology |
|---|---|
| Framework | React 19 + TypeScript |
| Build | Vite |
| Styling | Tailwind CSS v4 |
| LLM Runtime | @mlc-ai/web-llm via WebGPU |
| Routing | React Router v7 |
| Animations | Framer Motion |
| Icons | Lucide React |
| Markdown | react-markdown + remark-gfm |
| PWA | Service Worker + Web App Manifest |
| Analytics | Vercel Analytics |
| Browser | Minimum Version | Status |
|---|---|---|
| Chrome | 113+ | β Supported |
| Edge | 113+ | β Supported |
| Safari | 18.2+ | β Supported |
| Firefox | β | β No WebGPU yet |
Hardware: Small models (~0.5B) work with 2 GB VRAM. Larger models (7B+) need a dedicated GPU with 6β8 GB+ VRAM.
- Node.js 18+
- A WebGPU-compatible browser
# Clone the repo
git clone https://github.com/GautamVhavle/BrowserLLM.git
cd BrowserLLM
# Install dependencies
npm install
# Start dev server
npm run devOpen http://localhost:5173 and you're running.
npm run build # TypeScript check + Vite production build
npm run preview # Preview the built app locally| Command | What it does |
|---|---|
npm run dev |
Dev server with hot reload |
npm run build |
Type-check β production build |
npm run preview |
Serve production build locally |
npm run lint |
Run ESLint |
BrowserAI/
βββ public/
β βββ favicon.svg # App icon
β βββ manifest.json # PWA manifest
β βββ sw.js # Service worker
β βββ robots.txt # Search engine crawl rules
β βββ sitemap.xml # XML sitemap
β
βββ src/
β βββ main.tsx # Entry β React root + SW registration
β βββ App.tsx # Route definitions
β βββ index.css # Global styles + Tailwind
β β
β βββ types/index.ts # Shared interfaces (Message, ChatSession, etc.)
β β
β βββ hooks/
β β βββ useWebLLM.ts # Core β model loading, inference, stats
β β βββ useChatManager.ts # Chat state β wraps useWebLLM + localStorage
β β βββ useHardwareDetect.ts # GPU/VRAM/WebGPU detection
β β βββ useModelCache.ts # Cache API introspection
β β βββ useOnlineStatus.ts # Online/offline detection
β β
β βββ lib/
β β βββ modelCatalog.ts # 100+ model definitions with metadata
β β βββ models.ts # Public API re-exports
β β βββ storage.ts # localStorage CRUD
β β βββ constants.ts # Landing page content data
β β βββ animations.ts # Framer Motion variants
β β
β βββ workers/
β β βββ engine.worker.ts # Web Worker β MLC engine off main thread
β β
β βββ components/
β β βββ chat/ # Chat UI (layout, messages, input, stats, sidebar)
β β βββ landing/ # Landing page sections (hero, features, FAQ, etc.)
β β βββ ui/ # Shared UI (star field, loading bar, indicators)
β β
β βββ pages/
β βββ ModelsPage.tsx # Full model catalog with filters + hardware compat
β
βββ index.html # HTML shell with SEO meta, structured data
βββ vite.config.ts # Vite + Tailwind plugin config
βββ tsconfig.json # TypeScript config
βββ package.json
βββ eslint.config.js
BrowserLLM is open source and contributions are welcome!
Whether it's a bug fix, new feature, documentation improvement, or just a typo β every contribution helps.
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m "feat: add amazing feature" - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- TypeScript strict mode
- Functional React components with hooks
- Tailwind CSS for all styling (no CSS modules)
lucide-reactfor icons- Barrel exports via
index.tsfiles
- π Internationalization (i18n)
- π± Mobile UX improvements
- π¨ Theme customization
- π Advanced model benchmarking
- π§ͺ Test coverage
- π Documentation
This project is open source under the MIT License.
Free to use, modify, and distribute.
Built with β€οΈ by Gautam Vhavle
