๐งฎ Qwen 2.5 Math 1.5B (GGUF Quantized)
This repository contains the GGUF quantized version of the Qwen 2.5 Math 1.5B model.
It is a specialized Mathematical Reasoning Model optimized for edge devices, offline usage, and educational apps. Despite its small size (1.5B), it outperforms many larger general-purpose models in complex mathematical problem-solving tasks.
Quantized By: Md Habibur Rahman (Aasif)
Quantization Format: GGUF (Q4_K_M) - Optimized for balance between Math Accuracy and Speed.
๐ Key Features
- Math Specialist: Specifically trained on massive mathematical datasets (Algebra, Calculus, Geometry, Logic).
- Chain-of-Thought (CoT): Capable of showing step-by-step reasoning for solving problems.
- Edge AI Ready: Extremely lightweight (~1 GB). Runs smoothly on Android, Raspberry Pi, and Older Laptops.
- Offline Capable: Does not require an internet connection to solve problems.
๐ Usage (Python)
You can run this model using the llama-cpp-python library.
1. Installation
pip install llama-cpp-python huggingface_hub
- Python Inference Code
Here is a script to solve math problems with step-by-step logic:
from huggingface_hub import hf_hub_download
from llama_cpp import Llama
# Download the model
model_path = hf_hub_download(
repo_id="Habibur2/Qwen2.5-Math-1.5B-GGUF",
filename="qwen-math-1.5b-q4_k_m.gguf"
)
# Load Model
# Set n_gpu_layers=-1 for full GPU usage (Fastest)
# Set n_gpu_layers=0 for CPU only
llm = Llama(
model_path=model_path,
n_ctx=2048, # Context Window
n_threads=4, # CPU Threads
n_gpu_layers=-1 # GPU Acceleration
)
# Define a Math Problem
math_problem = "Find the integral of x^2 + 5x with respect to x."
# System Prompt is Crucial for Math Models
messages = [
{"role": "system", "content": "You are a helpful mathematical assistant. Please solve the problem step-by-step and show your reasoning clearly."},
{"role": "user", "content": math_problem}
]
# Generate Solution
output = llm.create_chat_completion(
messages=messages,
max_tokens=1024, # Math solutions need more tokens
temperature=0.1 # Low temperature (0.1) is best for precise math
)
print("๐ค Solution:\n")
print(output['choices'][0]['message']['content'])
โ๏ธ Technical Specifications
Feature,Details Original Model,Qwen 2.5 Math 1.5B Instruct Architecture,"Transformer (RoPE, SwiGLU)" Parameters,1.5 Billion Quantization Type,Q4_K_M (4-bit Medium) File Size,~1.12 GB Recommended RAM,2 GB+
๐งช Benchmark & Capabilities
This model excels at:
Algebra & Arithmetic: Solving equations, inequalities, and basic operations.
Calculus: Differentiation and Integration problems.
Word Problems: Understanding and translating text into mathematical equations.
LaTeX Output: Can generate answers in LaTeX format for academic rendering.
๐จโ๐ป About the Project
This model was quantized and uploaded by Md Habibur Rahman as part of a research initiative on Offline Edge AI & Small Language Models (SLM). The goal is to democratize access to powerful educational AI tools without relying on heavy cloud infrastructure.
Disclaimer: While this model is highly capable, always verify complex mathematical solutions.
- Downloads last month
- 29
4-bit