Note from the author - This project came about due to the sudden popularity and prowess of the DeepSeek LLM family. I have always been fascinated by web development and wanted to see if I could learn Electron by building a code editor which suits my workflow. This project was a great experience to learn about open source and local LLMs. Building NarwhAI taught me not just about Electron and Monaco Editor, but about the incredible ecosystem of open-source AI tools democratizing access to artificial intelligence.
A privacy-focused code editor with local AI assistance powered by Ollama and Monaco Editor
Main editor interface with AI panel and multi-tab support
- 100% Local & Private - Your code never leaves your machine
- AI-Powered Assistance - Generate, debug, and explain code using local LLMs
- Multi-Tab Interface - Work with multiple files simultaneously
- Simplistic Yet Functional UI - Clean, modern UI with beige/aqua/blue color scheme
- Auto-Starts Ollama - No manual terminal commands needed
- Smart File Management - Proper save/save-as functionality with visual indicators
- Monaco Editor - Industry-standard code editor (same as VS Code)
# Clone the repository
git clone https://github.com/yourusername/narwhai.git
cd narwhai
# Install dependencies
npm install
# Start the application
npm startOn first launch, NarwhAI will automatically start Ollama. You'll need to install at least one model:
# Recommended models (choose one or more)
ollama pull deepseek-coder:6.7b # Best for coding
ollama pull llama3.2:3b # Lightweight & fast
ollama pull deepseek-r1:7b # Advanced reasoning| Action | macOS | Windows/Linux |
|---|---|---|
| New Tab | ⌘ T |
Ctrl+T |
| Close Tab | ⌘ W |
Ctrl+W |
| Open File | ⌘ O |
Ctrl+O |
| Save | ⌘ S |
Ctrl+S |
| Save As | ⌘ ⇧ S |
Ctrl+Shift+S |
| Generate Code | ⌘ G |
Ctrl+G |
| Debug Code | ⌘ D |
Ctrl+D |
| Explain Selection | ⌘ E |
Ctrl+E |
- Generate Code: Create code from scratch or enhance existing code
- Debug Analysis: Identify bugs and get improvement suggestions
- Explain Selection: Get detailed explanations of selected code snippets
- Visual indicators for unsaved changes (• dot)
- Confirmation prompts for closing unsaved files
- Each tab maintains its own file path and state
- Automatic language detection based on file extension
JavaScript, TypeScript, Python, HTML, CSS, JSON, Markdown, YAML, and more - full Monaco Editor language support.
Edit index.html to add more Ollama models to the dropdown:
<select id="model-select">
<option value="deepseek-coder:6.7b">DeepSeek Coder</option>
<option value="llama3.2:3b">Llama 3.2</option>
<option value="deepseek-r1:7b">DeepSeek R1</option>
<!-- Add your models here -->
<option value="codellama:7b">CodeLlama</option>
</select>npm run build-mac
# Creates .dmg in dist/ foldernpm run build-win
# Creates installer in dist/ foldernarwhai/
├── main.js # Electron main process
├── preload.js # Secure IPC bridge
├── renderer.js # UI and Monaco integration
├── index.html # Application interface
├── package.json # Dependencies & configuration
├── build/
│ └── icons/ # Application icons
│ ├── icon.png # Linux/dev icon
│ ├── icon.icns # macOS icon
│ └── icon.ico # Windows icon
└── node_modules/ # Dependencies (git-ignored)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Monaco Editor - The powerful code editor
- Electron - Cross-platform desktop framework
- Ollama - Local LLM inference engine
- DeepSeek - For the excellent coding models
- Inspired by Claude's elegant design philosophy
NarwhAI is an independent project and is not affiliated with Ollama, Microsoft (Monaco), DeepSeek, or Anthropic. This is a community-driven, open-source tool that interfaces with these technologies.
- Ollama must be installed separately before first use
- Some models require significant RAM (8GB+ recommended)
- Auto-start of Ollama may fail if not in system PATH
For issues, questions, or suggestions, please open an issue on GitHub.
