Instructions to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Use Docker
docker model run hf.co/ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
- Ollama
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with Ollama:
ollama run hf.co/ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
- Unsloth Studio
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF to start chatting
- Pi
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with Docker Model Runner:
docker model run hf.co/ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
- Lemonade
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.LFM2-350M-GRPO-NuminaMath-10K-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
LFM2-350M-GRPO-NuminaMath-10K-GGUF
GGUF quantized versions of LFM2-350M-GRPO-NuminaMath-10K for efficient CPU and mixed CPU/GPU inference.
Model Overview
This is a quantized version of LFM2-350M-GRPO-NuminaMath-10K, a 350M 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-350m-grpo-numina-10k-q4_k_m.gguf |
~40% of original | Best balance of quality and size |
Quick Start
Using Ollama
# Pull and run directly from HuggingFace
ollama pull hf.co/ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M
ollama run hf.co/ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF:Q4_K_M "Solve step by step: What is 15% of 80?"
Alternative: Create Custom Modelfile
# Download the GGUF file first
huggingface-cli download ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF \
lfm2-350m-grpo-numina-10k-q4_k_m.gguf --local-dir ./models
# Create Modelfile with custom system prompt
cat > Modelfile << 'EOF'
FROM ./models/lfm2-350m-grpo-numina-10k-q4_k_m.gguf
SYSTEM "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."
PARAMETER temperature 0.7
PARAMETER top_p 0.9
EOF
# Create and run the model
ollama create lfm2-350m-grpo-numina-10k -f Modelfile
ollama run lfm2-350m-grpo-numina-10k
Using llama.cpp
# Download the GGUF file
huggingface-cli download ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF \
lfm2-350m-grpo-numina-10k-q4_k_m.gguf --local-dir ./models
# Run inference
./llama-cli -m ./models/lfm2-350m-grpo-numina-10k-q4_k_m.gguf \
-p "Solve step by step: If a train travels at 60 mph for 2.5 hours, how far does it travel?" \
-n 256
# Or start a server
./llama-server -m ./models/lfm2-350m-grpo-numina-10k-q4_k_m.gguf \
--host 0.0.0.0 --port 8080
Using llama-cpp-python
from llama_cpp import Llama
# Load the model
llm = Llama(
model_path="./models/lfm2-350m-grpo-numina-10k-q4_k_m.gguf",
n_ctx=2048,
n_gpu_layers=-1 # Use all GPU layers if available
)
# Generate response
prompt = '''Solve step by step:
A store has a 25% off sale. If an item originally costs $80, what is the sale price?
Solution:'''
output = llm(
prompt,
max_tokens=256,
temperature=0.7,
top_p=0.9,
echo=False
)
print(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?
Source Model
This is a quantized version of LFM2-350M-GRPO-NuminaMath-10K.
Training Details
| Property | Value |
|---|---|
| Base Model | LiquidAI/LFM2-350M |
| Training Method | GRPO (Group Relative Policy Optimization) |
| Dataset | AI-MO/NuminaMath-CoT |
| Training Samples | 10,000 |
| LoRA Rank | 16 |
| LoRA Alpha | 32 |
See the source model card for full training details and usage examples with Transformers.
Hardware Requirements
| Quantization | RAM Required | GPU VRAM (optional) |
|---|---|---|
| Q4_K_M | ~1-2 GB | ~1-2 GB |
Conversion Details
| Property | Value |
|---|---|
| Source Model | ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K |
| Conversion Date | 2025-12-29 |
| Quantization | Q4_K_M |
| Converter | llama.cpp |
License
CC-BY-NC-4.0 (same as source model)
Acknowledgments
- Liquid AI for the LFM2 base model
- AI-MO for the NuminaMath-CoT dataset
- llama.cpp for quantization tools
- ermiaazarkhalili for training and quantization
Quantized using the HF-TRL GGUF conversion pipeline on Compute Canada infrastructure
Citation
If you use this model in your research or applications, please cite:
@misc{azarkhalili2026_lfm2_350m_grpo_numinamath_10k_gguf,
author = {Azarkhalili, Behrooz},
title = {LFM2-350M-GRPO-NuminaMath-10K-GGUF},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF}
}
To generate a citable DOI, click "Cite this model" on the model page.
Training Method
Trained using GRPO (Group Relative Policy Optimization) on NuminaMath-CoT.
Base (merged) model: LFM2-350M-GRPO-NuminaMath-10K
Acknowledgments
- Hugging Face TRL Team for the training library
- llama.cpp for the GGUF quantization format
- Compute Canada / DRAC for HPC resources
- Base model developers for making their weights openly available
- Downloads last month
- 203
4-bit
5-bit
8-bit
Model tree for ermiaazarkhalili/LFM2-350M-GRPO-NuminaMath-10K-GGUF
Base model
LiquidAI/LFM2-350M