Foxus - Local-First AI Coding Assistant
A privacy-focused, fully offline coding assistant that provides AI-powered code completion, refactoring, bug fixing, and code explanation using locally running language models.
Features
- 🔒 Fully Local & Private: No internet connection required, all data stays on your machine
- 🧠 AI-Powered Assistance: Code completion, refactoring, bug fixing, and explanation
- 🌐 Multi-Language Support: Python, JavaScript, TypeScript, Go, Java, Rust, and more
- 💻 Cross-Platform: Windows, Linux, and macOS support
- ⌨️ Keyboard Shortcuts: Quick AI commands (
/explain
,/refactor
,/fix
, etc.) - 📁 Project Context: Multi-file analysis and understanding
- 🎨 Modern UI: Clean, responsive interface built with React and Tauri
Architecture
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Tauri + React │◄──►│ FastAPI Server │◄──►│ Ollama/LLM │
│ (Frontend) │ │ (Backend) │ │ (Local Models) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
Technology Stack
- Frontend: Tauri + React + TypeScript + Monaco Editor
- Backend: FastAPI (Python) + uvicorn
- LLM Runtime: Ollama
- Models: CodeLlama, Deepseek-Coder, StarCoder
- Styling: Tailwind CSS
- State Management: Zustand
Quick Start
Prerequisites
- Node.js (v18+)
- Python (3.9+)
- Rust (for Tauri)
- Ollama
Installation
- Clone and setup the project:
git clone <repository>
cd foxus
- Install dependencies:
# Install frontend dependencies
cd frontend
npm install
cd ..
# Install backend dependencies
cd backend
pip install -r requirements.txt
cd ..
- Install and start Ollama:
# Install Ollama (Linux/macOS)
curl -fsSL https://ollama.ai/install.sh | sh
# Pull a coding model
ollama pull codellama:7b-code
- Start the application:
# Terminal 1: Start backend
cd backend
python main.py
# Terminal 2: Start frontend
cd frontend
npm run tauri dev
Project Structure
foxus/
├── frontend/ # Tauri + React application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── services/ # API services
│ │ ├── hooks/ # Custom React hooks
│ │ ├── stores/ # State management
│ │ └── utils/ # Utility functions
│ ├── src-tauri/ # Tauri backend (Rust)
│ └── package.json
├── backend/ # FastAPI server
│ ├── app/
│ │ ├── api/ # API routes
│ │ ├── core/ # Core functionality
│ │ ├── models/ # Pydantic models
│ │ └── services/ # Business logic
│ ├── main.py
│ └── requirements.txt
├── docs/ # Documentation
└── README.md
Usage
AI Commands
/explain
- Explain selected code/refactor
- Suggest refactoring improvements/fix
- Fix bugs in selected code/complete
- Auto-complete code/comment
- Add comments to code/test
- Generate unit tests
Keyboard Shortcuts
Ctrl+K
(orCmd+K
) - Open AI command paletteCtrl+Shift+E
- Explain codeCtrl+Shift+R
- Refactor codeCtrl+Shift+F
- Fix code
Development
Adding New AI Commands
- Add command to
backend/app/api/ai.py
- Update frontend command palette in
frontend/src/components/CommandPalette.tsx
- Add keyboard shortcut in
frontend/src/hooks/useKeyboardShortcuts.ts
Supported Models
- CodeLlama (7B, 13B, 34B)
- Deepseek-Coder (1.3B, 6.7B, 33B)
- StarCoder (1B, 3B, 7B, 15B)
- CodeT5+ (220M, 770M, 2B, 6B)
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
MIT License - see LICENSE file for details.
Description
Languages
Python
62.3%
TypeScript
30.1%
JavaScript
2.4%
CSS
2.4%
Rust
2.3%
Other
0.5%