This is a quantized version of LFM2-1.2B-GRPO-NuminaMath-10K, a 1.2B parameter model fine-tuned using Group Relative Policy Optimization (GRPO) on the NuminaMath-CoT dataset for mathematical reasoning tasks.
Key Features
Mathematical Reasoning: Optimized for step-by-step math problem solving
GRPO Training: Uses reinforcement learning with verifiable rewards
Efficient Inference: Quantized for fast CPU/GPU inference
Wide Compatibility: Works with Ollama, llama.cpp, LM Studio, and more
Available Quantizations
Quantization
File
Size
Description
Q4_K_M
lfm2-1.2b-grpo-numina-10k-q4_k_m.gguf
~40% of original
Best balance of quality and size
Quick Start
Using Ollama
bash
1# Pull and run directly from HuggingFace2ollama pull hf.co/ermiaazarkhalili/LFM2-1.2B-GRPO-NuminaMath-10K-GGUF:Q4_K_M
3ollama run hf.co/ermiaazarkhalili/LFM2-1.2B-GRPO-NuminaMath-10K-GGUF:Q4_K_M "Solve step by step: What is 15% of 80?"
Alternative: Create Custom Modelfile
bash
1# Download the GGUF file first2huggingface-cli download ermiaazarkhalili/LFM2-1.2B-GRPO-NuminaMath-10K-GGUF \3 lfm2-1.2b-grpo-numina-10k-q4_k_m.gguf --local-dir ./models
45# Create Modelfile with custom system prompt6cat> Modelfile <<'EOF'
7FROM ./models/lfm2-1.2b-grpo-numina-10k-q4_k_m.gguf
89SYSTEM "You are a helpful math tutor. When given a math problem, solve it step by step, showing your reasoning clearly. Always verify your final answer."
1011PARAMETER temperature 0.7
12PARAMETER top_p 0.9
13EOF1415# Create and run the model16ollama create lfm2-1.2b-grpo-numina-10k -f Modelfile
17ollama run lfm2-1.2b-grpo-numina-10k
Using llama.cpp
bash
1# Download the GGUF file2huggingface-cli download ermiaazarkhalili/LFM2-1.2B-GRPO-NuminaMath-10K-GGUF \3 lfm2-1.2b-grpo-numina-10k-q4_k_m.gguf --local-dir ./models
45# Run inference6./llama-cli -m ./models/lfm2-1.2b-grpo-numina-10k-q4_k_m.gguf \7 -p "Solve step by step: If a train travels at 60 mph for 2.5 hours, how far does it travel?"\8 -n 256910# Or start a server11./llama-server -m ./models/lfm2-1.2b-grpo-numina-10k-q4_k_m.gguf \12 --host 0.0.0.0 --port 8080
Using llama-cpp-python
python
1from llama_cpp import Llama
23# Load the model4llm = Llama(5 model_path="./models/lfm2-1.2b-grpo-numina-10k-q4_k_m.gguf",6 n_ctx=2048,7 n_gpu_layers=-1# Use all GPU layers if available8)910# Generate response11prompt ='''Solve step by step:
12A store has a 25% off sale. If an item originally costs $80, what is the sale price?
1314Solution:'''1516output = llm(17 prompt,18 max_tokens=256,19 temperature=0.7,20 top_p=0.9,21 echo=False22)2324print(output['choices'][0]['text'])
Using LM Studio
Download the GGUF file from this repository
Open LM Studio and navigate to the Models tab
Click "Import Model" and select the downloaded GGUF file
Load the model and start chatting about math problems!
Example Prompts
Here are some example prompts that work well with this model:
Solve step by step: What is 23 × 17?
Solve step by step: A rectangle has a length of 12 cm and a width of 8 cm. What is its area and perimeter?
Solve step by step: If 3x + 7 = 22, what is the value of x?
Solve step by step: A car travels 150 miles in 2.5 hours. What is its average speed in miles per hour?