Skip to content

Soum-Code/hybrid-moe-codegen

Repository files navigation

⚡ Neural Engine 3B (AoT-MoE)

Model Size Framework Deployment Architecture

A state-of-the-art Reasoning-First Code Generation Platform built on a 3-Billion parameter Hybrid Mixture of Experts (MoE) architecture. 🏎️🚀🧠

🌟 Overview

The Neural Engine 3B is designed to solve the "hallucination" problem in small-scale code LLMs by enforcing an Atom of Thoughts (AoT) reasoning logic. Before generating any source code, the model synthesizes modular "reasoning atoms" that plan the structure, syntax, and complexity of the task.


🧬 Core Architecture

MoE-Upcycled Qwen2.5-Coder

  • Neural Backbone: Qwen2.5-Coder-3B.
  • Expert Adapter: LoRA (Low-Rank Adaptation) fine-tuned for XML-tagged reasoning.
  • Optimization: NF4 (4-bit) quantization for cost-efficient cloud inference.

AoT (Atom of Thoughts) Logic

Instead of black-box generation, the engine follows a transparent cognitive loop:

graph LR
    A[User Instruction] --> B[<atom> Identify Domain </atom>]
    B --> C[<atom> Structural Plan </atom>]
    C --> D[<atom> Syntax Mapping </atom>]
    D --> E[<execution> Final Source Code </execution>]
Loading

🛰️ Technical Stack

  • Deep Learning: PyTorch, Hugging Face Transformers, PEFT (LoRA).
  • Backend: FastAPI (Python), Uvicorn.
  • Frontend: Streamlit ("Neural Dark Room" Aesthetic).
  • Infrastructure: Docker, Google Cloud Run (us-central1), Kaggle Kernels (SFT).

🛠️ Installation & Usage

1. Requirements

Ensure you have Python 3.10+ and a minimum of 16Gi RAM for the 3B model (FP32).

2. Local Setup

# Clone the repository
git clone https://github.com/your-username/neural-engine-3b.git
cd neural-engine-3b

# Install dependencies
pip install -r requirements.txt

# Start the Backend (Reasoning Engine)
python -m uvicorn api:app --host 0.0.0.0 --port 8000

# Start the Frontend (Neural Dashboard)
python -m streamlit run app.py

🚀 Cloud Deployment

The engine is "Cloud-Ready" for Google Cloud Run. To launch your own instance within a Firebase/GCP project:

.\deploy.ps1

🎯 Key Features

  • Neural Synthesis View: Watch the model's internal reasoning atoms stream in real-time.
  • Validation Sandbox: Execute generated code in isolated subprocesses.
  • Neural Auto-Healer: Automatically repair syntax errors using the model's self-correction reflex.
  • MoE Telemetry: Live metrics for loss convergence and model evaluation.

Neural Engine 3B is the next step in verifiable AI code generation. 🧬🏁🏆

About

Hybrid Conv-Transformer with 12-layer Mixture of Experts and TurboQuant for AI code generation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors