Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

🧠 MiniCPM5-2B Local Hybrid AI

A lightweight python application leveraging OpenBMB's MiniCPM5-2B model via Hugging Face transformers to execute hybrid dual-brain reasoning (Fast No-Think answers vs Deep Think reasoning) on large context input files under 4GB VRAM.

⚡ 3-Step Workflow

Step 1: Input Step 2: AI Action Step 3: Result
Reads context file from inputs/large_context.txt MiniCPM5-2B runs Fast Mode & Deep Think Mode benchmarks Calculates generation time, TPS, and extracts <think> reasoning data

🚀 Key Superpowers

  • Dual-Brain Hybrid Engine: Toggle between instant fast response ("No-Think") for simple routing and deep step-by-step reasoning ("Think") for complex logic from a single model checkpoint.
  • Ultra-Low Hardware Footprint: Fits inside 4GB VRAM on standard consumer GPUs without sacrificing intelligence.
  • 128K Massive Context Window: Natively ingests entire long-form transcripts, codebases, and massive text files locally from inputs/.
  • Local Model Storage: Saves model weights inside the models/ subfolder for 100% offline local inference.
  • #1 Leader Under 4B: Outperforms competing models up to 12B parameters on the Artificial Analysis Intelligence Index.

📦 Quickstart & Model Download

Run these single-step PowerShell commands to install dependencies and download the MiniCPM5-2B model checkpoint directly into the models/ subfolder:

# Install PyTorch, Hugging Face transformers, and download tool
pip install torch transformers accelerate huggingface_hub

# Download MiniCPM5-2B model checkpoint into models/ subfolder
huggingface-cli download openbmb/MiniCPM5-2B --local-dir models/MiniCPM5-2B

💻 Running Context Benchmark Testing

Place your target text file in inputs/large_context.txt and execute the benchmark:

python main.py

The script will auto-detect the local model in models/MiniCPM5-2B, execute queries across both Fast and Deep Thinking modes, measure tokens/second (TPS) performance, extract thinking steps, and save a full evaluation report to outputs/outputs.md.


🎯 5 Practical Use Cases

  1. Large Context Transcript QA: Feeds multi-page text documents from inputs/ into the model to extract facts and verify claims.
  2. Local Desktop Automation Router: Fast "No-Think" mode categorizes incoming requests in milliseconds, triggering local script executions.
  3. Privacy-First Code Auditor: Ingests multi-file code repositories entirely offline on local PC hardware without sending data to external APIs.
  4. Offline Academic Assistant: Uses "Think" mode to solve multi-step mathematical proofs and logical puzzles with explicit chain-of-thought steps.
  5. Low-Latency Edge Assistant: Runs on low-power edge devices and laptops with under 4GB VRAM for real-time field operations.

🔮 5 Future Enhancement Features

  1. GGUF & Ollama Integration: Register quantized GGUF weights for native local CLI serving via Ollama.
  2. Streamlit Interactive UI: Build a responsive visual web dashboard with real-time thinking process toggles.
  3. Structured JSON Output Parser: Add Pydantic schema validation for strict JSON response outputs.
  4. Multi-Turn Chat Terminal: Implement interactive multi-turn conversation memory with dynamic thinking parameters.
  5. Local RAG Integration: Pair MiniCPM5-2B with local vector stores for hybrid retrieval and deep document reasoning.

📁 File Structure

minicpm-5-2b/
├── inputs/
│   └── large_context.txt
├── models/
│   └── MiniCPM5-2B/
├── main.py
├── README.md
└── requirements.txt
  • inputs/large_context.txt: Document context input file for benchmark testing.
  • models/MiniCPM5-2B/: Local directory containing downloaded MiniCPM5-2B model weights.
  • main.py: Core python application loading local model and running context benchmarks.
  • README.md: Project documentation and setup instructions.
  • requirements.txt: Python package dependencies list.

🏷️ Keywords & Tags

MiniCPM5-2B OpenBMB HuggingFace Local AI Deep Reasoning 128K Context Offline AI Hybrid Reasoning Tool Calling PyTorch

About

MiniCPM5-2B IS INSANE! 128K Context & Deep Reasoning Runs Locally - OpenBMB MiniCPM5-2B local execution and context benchmarking

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages