Features โข Installation โข Usage โข Contributing โข License
_ _ _
| \ | | | |
| \| | ___ ___ __| | ___
| . ` |/ __/ _ \/ _` |/ _ \
| |\ | (_| (_) | (_| | __/
|_| \_|\___\___/ \__,_|\___|
Local Code Generation System
Ncode aims to revolutionize local code generation by providing:
- Efficient Code Generation: Fast and accurate code suggestions
- Local Execution: Privacy-focused, runs entirely on your machine
- Flexible Architecture: Supports multiple models and configurations
- Developer Productivity: Streamlines coding workflows
- Python 3.10+: Primary programming language
- LLaMA Models: Base models for code generation
- PyTorch: Model inference and GPU acceleration
- Pydantic: Data validation and settings management
- aiohttp: Async HTTP operations
- Transformers: Model loading and inference
- NumPy: Numerical computations
- Pandas: Data processing and analysis
- Loguru: Advanced logging capabilities
- Pytest: Comprehensive testing framework
Feature | v1.0.0 | v2.0.0 | Improvement |
---|---|---|---|
Code Generation Speed | 100 tokens/sec | 140 tokens/sec | 40% faster |
Error Recovery | Basic error handling | Robust recovery with fallbacks | More reliable |
Attention Mechanisms | Standard MHA | MLA & MHA support | More efficient |
Resource Management | Manual optimization | Automatic optimization | Better utilization |
GPU Utilization | Basic GPU support | Smart layer optimization | Up to 30% better |
- Improved Model Performance: Up to 40% faster code generation
- Enhanced Error Handling: More robust error recovery and fallback mechanisms
- New Attention Mechanisms: Support for advanced attention configurations
- Better Resource Management: Optimized memory usage and GPU utilization
Example of the new MLA configuration with improved memory usage and inference speed
Demonstration of automatic error recovery and resource optimization
Real-time monitoring of system resources and performance metrics
Example of Python code generation with Fibonacci sequence implementation
- Memory Leaks: Occasional memory leaks during long sessions (fix in progress)
- Model Switching: Some instability when switching between models
- GPU Utilization: Suboptimal GPU usage on certain hardware configurations
- Improve memory management for long-running sessions
- Stabilize model switching functionality
- Optimize GPU utilization across different hardware
- Enhance error messages for better debugging
- Improve documentation for new features
We welcome contributions to help address these issues! Here's how you can help:
- Fork the repository and clone it locally
- Set up your development environment following the installation instructions
- Identify an issue you'd like to work on from the list above
- Create a new branch for your fix:
git checkout -b fix/[issue-name]
- Write tests for your changes
- Document your changes in the code and update relevant documentation
- Submit a pull request with a clear description of your changes
-
Memory Management
- Location:
backend/resource_manager.py
- Focus: Memory leak detection and cleanup
- Location:
-
Model Switching
- Location:
backend/model_manager.py
- Focus: Stability during model transitions
- Location:
-
GPU Optimization
- Location:
backend/gpu_utilization.py
- Focus: Better hardware compatibility
- Location:
-
Error Handling
- Location:
backend/error_handler.py
- Focus: Clearer error messages and debugging info
- Location:
- Run the full test suite:
pytest tests/
- Verify memory usage with:
python backend/memory_tests.py
- Check GPU utilization with:
python backend/gpu_tests.py
- Join our Discord server for real-time discussion
- Check the Contributing Guide for more details
- Open an issue if you need clarification on any aspect
Feature | Description | Benefits |
---|---|---|
๐ Multi-Token Prediction (MTP) | Revolutionary parallel token generation | Up to 5x faster code generation |
๐ Parallel Processing | Simultaneous planning and implementation | Efficient workflow, better results |
๐ฏ GPU Acceleration | Smart GPU layer optimization | Maximum performance on your hardware |
๐ง Model Flexibility | Hot-swappable planning & coding models | Choose the right model for each task |
๐ง Multi-Head Latent Attention (MLA) | Efficient attention mechanism | Reduced memory usage, faster inference |
๐ Resource Optimization | Intelligent memory management | Smooth operation on any system |
๐ก Mixture of Experts (MoE) | Enhanced model with specialized sub-networks | Improved performance and efficiency |
๐ฅ๏ธ Enhanced Code Display | Syntax highlighting and formatted output | Better code readability and review |
๐ Organized Code Storage | Automatic file organization by date and project | Easy management of generated code |
๐พ Code Saving | Save generated code with proper naming and structure | Persistent storage of generated solutions |
๐ Code Summaries | Generate code-focused summaries with examples | Better understanding and documentation of generated code |
- Clone the repository:
git clone https://github.com/Shawn5cents/Ncode
cd Ncode
- Install dependencies:
pip install -r requirements.txt
- Install Python 3.10+ from python.org
- Ensure Python is added to PATH during installation
- Open PowerShell and verify Python installation:
python --version
pip --version
- Install build tools:
pip install wheel
- Install Python 3.10+ using your package manager:
# Ubuntu/Debian
sudo apt update
sudo apt install python3.10 python3-pip
# Fedora
sudo dnf install python3.10 python3-pip
- Verify installation:
python3 --version
pip3 --version
- Install development tools:
sudo apt install build-essential # Ubuntu/Debian
sudo dnf groupinstall "Development Tools" # Fedora
- Install Pythonista from the App Store
- Clone repository using Git client in Pythonista
- Install dependencies:
import os
os.system('pip install -r requirements.txt')
Note: iOS has limited capabilities due to sandboxing. Consider using a remote server for full functionality.
Start generating code with our intuitive CLI:
python backend/cli_client.py
Command | Description |
---|---|
mtp |
๐ Toggle Multi-Token Prediction mode |
models |
๐ List available models |
switch TYPE MODEL |
๐ Change active model (TYPE: planning|coding) |
attention TYPE MECHANISM [latent_dim] [cache] |
๐ง Configure attention mechanism (MHA/MLA) |
help |
๐ก Show help message |
quit |
๐ Exit program |
moe TYPE ENABLED [num_experts] [capacity] [ratio] |
๐๏ธ Configure Mixture of Experts |
save |
๐พ Save generated code to file |
summary [format] |
๐ Generate summary (text, roadmap, flowchart) |
code-summary |
๐ป Generate code-focused summary with examples |
config |
โ๏ธ Show current model configuration |
We welcome contributions! See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.