Skip to content

Shawn5cents/Ncode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Ncode v2.0.0

Major Release: Enhanced Performance and New Features

License Python Status PRs Welcome Code Style

Features โ€ข Installation โ€ข Usage โ€ข Contributing โ€ข License


  _   _              _      
 | \ | |            | |     
 |  \| | ___ ___  __| | ___ 
 | . ` |/ __/ _ \/ _` |/ _ \
 | |\  | (_| (_) | (_| |  __/
 |_| \_|\___\___/ \__,_|\___|
                             
 Local Code Generation System

๐ŸŽฏ Project Goals

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

๐Ÿง  Technical Stack

Core Components

  • 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

Key Libraries

  • Transformers: Model loading and inference
  • NumPy: Numerical computations
  • Pandas: Data processing and analysis
  • Loguru: Advanced logging capabilities
  • Pytest: Comprehensive testing framework

๐Ÿš€ What's New in v2.0.0

Version Comparison: v1 vs v2

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

Major Enhancements

  • 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

Screenshots

New Attention Mechanism Configuration

MLA Configuration Example of the new MLA configuration with improved memory usage and inference speed

Improved Error Handling

Error Recovery Demonstration of automatic error recovery and resource optimization

Resource Optimization Dashboard

Resource Dashboard Real-time monitoring of system resources and performance metrics

Code Generation Example

Code Example Example of Python code generation with Fibonacci sequence implementation

Known Issues

  • 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

Fixes Needed

  • 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

๐Ÿ› ๏ธ Contributing to Bug Fixes

We welcome contributions to help address these issues! Here's how you can help:

Getting Started

  1. Fork the repository and clone it locally
  2. Set up your development environment following the installation instructions
  3. Identify an issue you'd like to work on from the list above

Contribution Guidelines

  • 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

Specific Areas Needing Attention

  1. Memory Management

    • Location: backend/resource_manager.py
    • Focus: Memory leak detection and cleanup
  2. Model Switching

    • Location: backend/model_manager.py
    • Focus: Stability during model transitions
  3. GPU Optimization

    • Location: backend/gpu_utilization.py
    • Focus: Better hardware compatibility
  4. Error Handling

    • Location: backend/error_handler.py
    • Focus: Clearer error messages and debugging info

Testing Your Changes

  • 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

Getting Help

โœจ Features

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

๐Ÿ› ๏ธ Installation

General Steps

  1. Clone the repository:
git clone https://github.com/Shawn5cents/Ncode
cd Ncode
  1. Install dependencies:
pip install -r requirements.txt

Platform-Specific Setup

Windows

  1. Install Python 3.10+ from python.org
  2. Ensure Python is added to PATH during installation
  3. Open PowerShell and verify Python installation:
python --version
pip --version
  1. Install build tools:
pip install wheel

Linux

  1. 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
  1. Verify installation:
python3 --version
pip3 --version
  1. Install development tools:
sudo apt install build-essential  # Ubuntu/Debian
sudo dnf groupinstall "Development Tools"  # Fedora

iOS (via Pythonista or a-Shell)

  1. Install Pythonista from the App Store
  2. Clone repository using Git client in Pythonista
  3. 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.

๐Ÿš€ Usage

Start generating code with our intuitive CLI:

python backend/cli_client.py

๐ŸŽฎ Commands

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

๐Ÿ‘ฅ Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

๐Ÿ“„ License

MIT License - see LICENSE for details.


Made with โค๏ธ by the Ncode Team

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published