LocalNeural is a self-hosted, multi-provider AI chat interface with a stunning "Nothing OS" inspired UI. It supports local models via Ollama and cloud providers like OpenAI, Anthropic, Google Gemini, OpenRouter, and Groq β all behind a single, consistent interface.
Built with privacy-first principles: your data stays on your server. Features include real-time streaming, file RAG, multimodal vision, conversation branching, token tracking, admin controls, and more.
- Multi-Provider AI β Ollama (local), OpenAI, Anthropic, Google Gemini, OpenRouter, Groq
- Real-Time Streaming β Word-by-word responses via WebSockets (Socket.IO)
- Dark/Light Theme β CSS custom properties, persists across sessions
- Session Branching β Fork conversations into new branches
- Token Tracking β Per-session token counts displayed in history
- Markdown Toggle β Render messages as plain text or formatted markdown
- Message Export β Export individual messages as markdown
- File RAG β Upload PDFs, code files, markdown notes as project knowledge bases
- Multimodal Vision β Drag & drop or paste images for AI analysis (vision models)
- Conversation Management β Pin, archive, tag, search, and organize sessions
- Prompt Library β Save and inject system prompt templates
- Prompt Variables β
{date},{time},{datetime},{user}auto-substitution - Admin Controls β User management, global settings, global tools, user blocking
- User Settings β Per-user provider, model, temperature, system prompt
- Tools System β Define custom function-calling tools (global and per-user)
- Data Export β Export chats as Markdown, JSON, or HTML/PDF
- Account Management β Profile editing, password change, self-deletion
- Security Hardened β CSRF protection, rate limiting, 72h sessions, password min 8
Coming soon β see the live demo or run locally.
- Python 3.8+
- Ollama (for local models) β Download
- Pull a model:
ollama pull llama3
git clone https://github.com/rkriad585/LocalNeural.git
cd LocalNeural
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.pyOpen http://localhost:59869 in your browser.
Note: Default port is
59869. SetLOCALNEURAL_PORTenv var to change it.
docker build -t localneural .
docker run -p 59869:59869 localneuralOr use docker-compose:
docker-compose upCopy .env.example to .env and configure:
SECRET_KEY=your-strong-random-secret-key
LOCALNEURAL_HOST=0.0.0.0
LOCALNEURAL_PORT=59869
# Optional: SMTP for password reset emails
LOCALNEURAL_SMTP_HOST=smtp.gmail.com
LOCALNEURAL_SMTP_PORT=587
LOCALNEURAL_SMTP_USER=your@email.com
LOCALNEURAL_SMTP_PASSWORD=your-app-password
LOCALNEURAL_SMTP_FROM=your@email.com
# Optional: Auto-create super admin on first run
LOCALNEURAL_ADMIN_EMAIL=admin@example.com
LOCALNEURAL_ADMIN_PASSWORD=your-admin-passwordAll settings are documented in docs/CONFIGURATION.md.
| Document | Description |
|---|---|
| Architecture | System architecture, design decisions, data flow |
| API Reference | Full API endpoint documentation |
| Setup Guide | Detailed installation and configuration |
| User Guide | How to use all features |
| Deployment | Docker, production deployment |
| Configuration | All environment variables and settings |
| Features | Detailed feature documentation |
| Security | Security model, CSRF, rate limiting |
| Development | Contributing, code style, testing |
- Backend: Python, Flask, Flask-SocketIO, Flask-Limiter
- Database: SQLite (via
sqlite3) - Frontend: HTML5, TailwindCSS (CDN), jQuery, Socket.IO Client
- AI Providers: Ollama API, OpenAI API, Anthropic API, Google Gemini API, OpenRouter API, Groq API
- Markdown: marked.js, highlight.js
- Auth: Session-based with werkzeug password hashing
- Deployment: Docker, docker-compose
LocalNeural/
βββ app.py # Main Flask app (routes, auth, admin, tools, chat)
βββ config.py # Configuration class (env vars, defaults)
βββ database.py # SQLite database operations
βββ requirements.txt # Python dependencies
βββ Dockerfile # Docker build
βββ docker-compose.yml # Docker compose
βββ .env.example # Environment template
βββ LICENSE # MIT License
βββ README.md
βββ CODE_OF_CONDUCT.md
βββ CONTRIBUTING.md
βββ .data/
β βββ neural_memory.db # SQLite database file
βββ docs/ # Documentation
β βββ ARCHITECTURE.md
β βββ API.md
β βββ CONFIGURATION.md
β βββ DEPLOYMENT.md
β βββ DEVELOPMENT.md
β βββ FEATURES.md
β βββ SECURITY.md
β βββ SETUP.md
β βββ USER_GUIDE.md
βββ static/
β βββ css/
β β βββ style.css
β βββ images/
β β βββ logo.svg
β βββ js/
β β βββ main.js
β βββ uploads/
β βββ profiles/
βββ templates/
β βββ base.html
β βββ index.html
β βββ login.html
β βββ settings.html
β βββ settings_page.html
β βββ profile.html
β βββ admin.html
β βββ admin_dashboard.html
β βββ user_view.html
β βββ reset_password.html
βββ utilities/
βββ chat_logic.py # Session context, title generation
βββ email.py # SMTP email sending
βββ embeddings.py # Document embeddings
βββ file_parser.py # PDF/code file parsing
βββ providers.py # Multi-AI provider abstraction
βββ tools.py # Function calling tools
βββ web_search.py # Web search tool
Distributed under the MIT License. See LICENSE for more information.
Made with β€οΈ by rkriad585