LocalFLLM is a powerful, high-performance, and 100% client-side web interface designed to interact with local Large Language Models (LLMs) via your own Ollama server or any compatible API endpoint.
The core philosophy of this project is Local First: all your chats, configurations, and contexts remain strictly on your machine. There are no middlemen, no external databases, and no installations required (no Docker, no Node.js, no backend setup). It is entirely contained within a single static HTML file.
- Zero Setup Required: It's just a pure static
index.htmlfile. You can run it directly from your hard drive or host it on GitHub Pages, Netlify, or any static hosting service. - Persistent History (IndexedDB): All your conversations are saved locally in your browser's IndexedDB. You won't lose your chats if you close or refresh the tab.
- High-Performance Rendering: Engineered with an inline Web Worker for asynchronous Markdown parsing and a 20 FPS UI throttling system. It handles massive context windows and hyper-fast streaming speeds without freezing your browser (No Layout Thrashing).
- Tool Calling (Function Calling): Full support for models that can execute functions. The UI transparently displays the AI's requested
Action(parameters) and theSystem Toolresponse before delivering the final answer in a seamless loop. - Stop Generation: A built-in cancellation token (
AbortController) allows you to stop the AI's generation mid-stream instantly. - Dynamic Configuration per Chat: Each conversation maintains its own configuration state. You can have one chat talking to a coding model with low temperature, and another chat using a creative model with high temperature.
- Auto-Fetch Models: Automatically queries your local API (
/api/tags) to provide a dropdown list of your installed models. - Secure Custom Auth Headers: Need to connect to a secured local API or a proxy? Set custom authorization headers (e.g., Bearer tokens). For security, this token is encrypted locally in your browser using AES encryption (CryptoJS) tied to your browser's fingerprint before being saved to IndexedDB.
- Thinking Process Parser: For reasoning models (like DeepSeek or specialized Qwen models), the UI smoothly parses the
<think>tags (or the structuralthinkingJSON property) into a collapsible box, keeping the chat clean. - Markdown & Code Highlighting: Full support for Markdown formatting, tables, and syntax highlighting for code blocks.
- Get the file: Download the
index.htmlfile. - Open it: Simply double-click the file to open it in your favorite modern web browser (Chrome, Firefox, Edge, Safari). Alternatively, access the hosted version if deployed on GitHub Pages.
- Configure your Server:
- By default, it connects to a local Ollama instance running at
http://127.0.0.1:11434/api/chat. - Important: If your Ollama server is running on a different port or IP, change the API URL in the "Chat Settings" panel.
- By default, it connects to a local Ollama instance running at
- CORS Requirement: Since this runs in a browser, your Ollama server must allow Cross-Origin Resource Sharing (CORS).
- To start Ollama with CORS enabled, use the following command in your terminal:
OLLAMA_ORIGINS="*" ollama serve
- To start Ollama with CORS enabled, use the following command in your terminal:
- Start Chatting: Select your model name and start typing!
- HTML5/JS/CSS: Pure native web technologies.
- Tailwind CSS: For the modern, responsive dark-mode user interface (via CDN).
- Marked.js & DOMPurify: For safely rendering Markdown responses via Web Workers.
- Highlight.js: For beautiful code block formatting.
- CryptoJS: For local-first encryption of sensitive headers.
- Lucide Icons: For the sleek UI iconography.
This application makes no external requests other than fetching the CDN libraries for styling/parsing and the direct HTTP requests to your specified API URL (e.g., your local Ollama). No analytics, no tracking, and no cloud storage. Your data is yours.