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.
| 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 |
- 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.
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-2BPlace your target text file in inputs/large_context.txt and execute the benchmark:
python main.pyThe 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.
- Large Context Transcript QA: Feeds multi-page text documents from
inputs/into the model to extract facts and verify claims. - Local Desktop Automation Router: Fast "No-Think" mode categorizes incoming requests in milliseconds, triggering local script executions.
- Privacy-First Code Auditor: Ingests multi-file code repositories entirely offline on local PC hardware without sending data to external APIs.
- Offline Academic Assistant: Uses "Think" mode to solve multi-step mathematical proofs and logical puzzles with explicit chain-of-thought steps.
- Low-Latency Edge Assistant: Runs on low-power edge devices and laptops with under 4GB VRAM for real-time field operations.
- GGUF & Ollama Integration: Register quantized GGUF weights for native local CLI serving via Ollama.
- Streamlit Interactive UI: Build a responsive visual web dashboard with real-time thinking process toggles.
- Structured JSON Output Parser: Add Pydantic schema validation for strict JSON response outputs.
- Multi-Turn Chat Terminal: Implement interactive multi-turn conversation memory with dynamic thinking parameters.
- Local RAG Integration: Pair MiniCPM5-2B with local vector stores for hybrid retrieval and deep document reasoning.
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.
MiniCPM5-2B OpenBMB HuggingFace Local AI Deep Reasoning 128K Context Offline AI Hybrid Reasoning Tool Calling PyTorch