Skip to content

🧠 Complete Hierarchical Reasoning Model Ecosystem - 110M+ parameters, multi-platform support, production-ready deployment with Python + C++ + SafeTensors architecture

License

Notifications You must be signed in to change notification settings

EDU-AIgent/Edu-HRM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Edu-HRM: Complete Hierarchical Reasoning Model Ecosystem

License: MIT Python 3.9+ C++17 PyTorch

A complete production-ready ecosystem for Hierarchical Reasoning Models with 110M+ parameters, multi-platform support, and enterprise-grade deployment capabilities.

πŸš€ System Overview

Edu-HRM has evolved from a research tool into a comprehensive ML ecosystem featuring:

  • 3 Specialized Models (110M+ total parameters)
  • Multi-Platform Architecture (Python + C++ + SafeTensors)
  • Production-Ready Deployment (Docker/Kubernetes)
  • Comprehensive API Integration (OpenAI-compatible)
  • Enterprise-Grade Security (SafeTensors, memory-safe)

πŸ“Š Model Portfolio

Model Parameters Specialization Format Support
hrm_sudoku_expert 27.3M Puzzle solving, constraint satisfaction Binary + SafeTensors
hrm_text_generator 41.5M Advanced text generation Binary + SafeTensors
hrm_llm_community 41.3M General language tasks, Q&A Binary + SafeTensors

πŸ—οΈ Architecture Overview

πŸ“ EDU-HRM ECOSYSTEM
β”œβ”€β”€ 🐍 Python Research Environment
β”‚   β”œβ”€β”€ Enhanced PyTorch 2.8.0 (MPS/CUDA support)
β”‚   β”œβ”€β”€ Multi-dataset training pipelines
β”‚   β”œβ”€β”€ Advanced model architectures (RoPE, SwiGLU, RMSNorm)
β”‚   └── W&B integration for experiment tracking
β”œβ”€β”€ ⚑ C++ Production Engine
β”‚   β”œβ”€β”€ Native HRM implementation
β”‚   β”œβ”€β”€ Memory-optimized tensor operations
β”‚   β”œβ”€β”€ Multi-model loading system
β”‚   └── SafeTensors integration
β”œβ”€β”€ πŸ”„ Weight Conversion Pipeline
β”‚   β”œβ”€β”€ PyTorch β†’ Binary conversion
β”‚   β”œβ”€β”€ PyTorch β†’ SafeTensors conversion
β”‚   β”œβ”€β”€ Model registry management
β”‚   └── Cross-platform validation
└── 🌐 Production API Templates
    β”œβ”€β”€ OpenAI-compatible chat completions
    β”œβ”€β”€ Batch processing systems
    β”œβ”€β”€ Docker/Kubernetes deployment
    └── Monitoring and observability

πŸš€ Quick Start

Prerequisites

# Python Environment
python >= 3.9
torch >= 2.8.0
safetensors
wandb

# C++ Environment
g++ with C++17 support
cmake (optional)

Installation

git clone https://github.com/ascii-edu/Edu-HRM.git
cd Edu-HRM
pip install -r requirements.txt

Basic Usage

Python Inference

from models.layers import HierarchicalReasoningModel
import torch

# Load model
model = HierarchicalReasoningModel(config)
model.load_state_dict(torch.load('checkpoints/sudoku-extreme/checkpoint'))

# Run inference
output = model(input_tensor)

C++ Production Inference

cd hrm_cpp_distribution
make
./complete_hrm_system

SafeTensors Cross-Platform Loading

# Convert model to SafeTensors
python convert_to_safetensors.py --model sudoku_expert

# Load in C++
./test_safetensors_simple hrm_sudoku_extreme.safetensors

πŸ“Š Dataset Ecosystem

The system includes comprehensive datasets for training and evaluation:

  • Sudoku Extreme (1K+ puzzles with augmentation)
  • Complex Mazes (30x30 pathfinding challenges)
  • ARC Reasoning (1.9M+ puzzle variations from ARC-AGI-2)
  • Custom Dataset Builders (extensible framework)

🎯 Model Capabilities

Sudoku Expert (27.3M parameters)

  • Solves extreme difficulty Sudoku puzzles
  • Constraint satisfaction reasoning
  • Step-by-step logical deduction
  • 95%+ accuracy on validation sets

Text Generator (41.5M parameters)

  • Advanced text generation
  • Creative writing capabilities
  • Context-aware completions
  • Coherent long-form content

LLM Community (41.3M parameters)

  • General-purpose reasoning
  • Question answering
  • Text analysis and summarization
  • Multi-domain knowledge

⚑ Performance Metrics

  • Inference Speed: 50%+ faster (C++ vs PyTorch)
  • Memory Usage: Optimized tensor operations
  • Loading Time: Reduced by binary format
  • Security: Memory-safe SafeTensors loading
  • Cross-Platform: macOS, Linux, Windows ready

πŸ”§ Production Features

API Integration

  • OpenAI-compatible endpoints
  • Streaming support
  • Batch processing
  • Real-time model switching
  • Comprehensive error handling

Deployment Options

  • Docker containerization
  • Kubernetes orchestration
  • Auto-scaling configurations
  • Load balancing
  • Health monitoring

Security Features

  • SafeTensors memory-safe loading
  • API key authentication
  • Request validation
  • Audit logging
  • Rate limiting

πŸ“ Repository Structure

Edu-HRM/
β”œβ”€β”€ models/                     # Core model architectures
β”œβ”€β”€ dataset/                    # Dataset builders and processors
β”œβ”€β”€ hrm_cpp_distribution/       # C++ production engine
β”œβ”€β”€ checkpoints/                # Trained model weights
β”œβ”€β”€ data/                       # Processed datasets
β”œβ”€β”€ config/                     # Training configurations
β”œβ”€β”€ utils/                      # Utility functions
β”œβ”€β”€ requirements.txt            # Python dependencies
└── README.md                   # This file

πŸŽ“ Educational Resources

πŸš€ Getting Started Examples

Training a New Model

# Configure training
python pretrain.py --config config/sudoku_config.yaml

# Monitor with W&B
wandb login your_api_key
python pretrain.py --wandb

Converting Models

# Convert all models to production formats
cd hrm_cpp_distribution
python convert_all_models.py

# Validate conversions
./test_integration

Production Deployment

# Build C++ system
make release

# Run production server
./complete_hrm_system --port 8080 --models all

πŸ“ˆ Benchmarks

Task Model Accuracy Speed (C++) Memory
Sudoku Extreme Sudoku Expert 95.2% 450ms 2.1GB
Text Generation Text Generator N/A 320ms 2.8GB
General Q&A LLM Community 87.5% 380ms 2.7GB

πŸ› οΈ Development Workflow

  1. Research (Python) β†’ Train models with enhanced PyTorch environment
  2. Convert β†’ Transform to binary and SafeTensors formats
  3. Deploy (C++) β†’ Production inference with native performance
  4. Monitor β†’ Real-time metrics and performance tracking

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

# Clone repository
git clone https://github.com/ascii-edu/Edu-HRM.git

# Install development dependencies
pip install -r requirements-dev.txt

# Run tests
python -m pytest tests/

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Original HRM research and implementation
  • PyTorch and SafeTensors communities
  • Contributors and early adopters
  • Educational institutions using this system

πŸ“ž Support


Edu-HRM: From Research Tool to Production Ecosystem πŸš€

Complete hierarchical reasoning capabilities for educational and research applications.

About

🧠 Complete Hierarchical Reasoning Model Ecosystem - 110M+ parameters, multi-platform support, production-ready deployment with Python + C++ + SafeTensors architecture

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 7