Instructions to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath 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 U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M # Run inference directly in the terminal: llama cli -hf U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M # Run inference directly in the terminal: llama cli -hf U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
Use Docker
docker model run hf.co/U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
- SGLang
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with Ollama:
ollama run hf.co/U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
- Unsloth Desktop
- Pi
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath: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": "U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with Docker Model Runner:
docker model run hf.co/U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
- Lemonade
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
Run and chat with the model
lemonade run user.Qwen2.5-Math-1.5B-HigherMath-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath: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 U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath: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 "U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath: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"
qwen-math-higher-math
qwen-math-higher-math is a fine-tuned version of Qwen2.5-Math-1.5B-Instruct, specialized for university-level mathematics: calculus, linear algebra, ordinary differential equations, series, multivariable calculus, complex analysis, and probability.
The model produces step-by-step Chain-of-Thought solutions in English, uses LaTeX notation, and finishes with the final answer in \boxed{}.
Model details
| Property | Value |
|---|---|
| Base model | Qwen/Qwen2.5-Math-1.5B-Instruct |
| Parameters | 1.5B |
| Fine-tuning data | 1,500 filtered examples from AI-MO/NuminaMath-CoT |
| Target domain | University-level mathematics |
| Output format | Step-by-step reasoning, LaTeX, final answer in \boxed{} |
| Inference mode | Chain-of-Thought only; no tool use / Python / calculator |
| Quantized artifact | GGUF Q4_K_M, approximately 0.92 GB |
| Runtime | Ollama, CPU inference |
Intended use
This model is intended for:
- University-level math problem solving
- Calculus: limits, derivatives, integrals, series
- Linear algebra: matrices, determinants, eigenvalues
- Ordinary differential equations
- Multivariable calculus and vector calculus
- Complex analysis
- Probability and statistics
- Generating step-by-step explanations with LaTeX
It is not intended as a general-purpose assistant, coding assistant, or tool-using agent.
Benchmarks
All results were obtained with greedy decoding (temperature = 0), one generation per problem (pass@1), and answer extraction from the final \boxed{} expression. The model was evaluated locally through Ollama using a Q4_K_M GGUF quantization.
| Benchmark | Baseline: Qwen2.5-Math-1.5B-Instruct | qwen-math-higher-math | Difference |
|---|---|---|---|
| Custom University Math-200 | 98.50% | 99.50% | +1.0% |
| MATH-500 | 74.60% | 73.60% | -1.0% |
| GSM8K-100 | 86.00% | 82.00% | -4.0% |
Custom University Math-200
Custom University Math-200 is a held-out set of 200 university-level problems covering:
- Limits and continuity
- Derivatives
- Integrals
- Multivariable calculus
- Vector calculus
- Linear algebra
- ODEs and PDEs
- Series
- Complex analysis
- Probability and statistics
This is a custom evaluation set, not the official CollegeMath benchmark. The result should be interpreted as a domain-specific evaluation rather than a standardized public benchmark score.
MATH-500
MATH-500 is a 500-problem subset of the MATH benchmark. Answers are evaluated by exact match after extracting the final answer from \boxed{}.
GSM8K-100
GSM8K-100 is a 100-problem subset of GSM8K, used as a general mathematical reasoning sanity check.
Results interpretation
The fine-tuned model improved on the custom university-mathematics set by 1 percentage point, while showing a small decline on MATH-500 and GSM8K.
Because the baseline already scored 98.5% on the custom set, the available headroom was limited. The results suggest that the fine-tune specializes the model for higher mathematics, but does not improve general competition-level math performance.
The differences are small relative to the benchmark sizes, particularly for the 100-problem GSM8K subset. Larger evaluations and an error analysis are needed before drawing strong conclusions.
Usage
Ollama
ollama create qwen-math-higher-math -f Modelfile
ollama run qwen-math-higher-math
Example Modelfile:
FROM ./qwen-math-q4_k_m.gguf
PARAMETER temperature 0
PARAMETER num_ctx 4096
PARAMETER stop "<|im_end|>"
Python
from ollama import chat
response = chat(
model="qwen-math-higher-math",
messages=[
{
"role": "system",
"content": (
"Please reason step by step. "
"Use LaTeX for mathematical expressions. "
"Do not use Python, a calculator, or any external tools. "
"Put your final answer inside \\boxed{}."
)
},
{
"role": "user",
"content": "Find the derivative of f(x) = x^3 ln(x)."
}
],
options={
"temperature": 0,
"num_predict": 2048,
},
)
print(response["message"]["content"])
Recommended prompt
Please reason step by step.
Use LaTeX for mathematical expressions.
Do not use Python, a calculator, or any external tools.
Put your final answer inside \boxed{}.
Problem:
{problem}
Example
Input:
Find the derivative of f(x) = x^3 ln(x).
Expected output format:
To find the derivative of f(x) = x^3 ln(x), we use the product rule.
f'(x) = 3x^2 ln(x) + x^3 * (1/x)
= x^2(3 ln(x) + 1)
\boxed{x^2(3\ln(x)+1)}
Limitations
- The model is specialized for university-level mathematics and may perform worse on general conversation, coding, and non-mathematical tasks.
- It does not use external tools, calculators, or code execution.
- Long Chain-of-Thought outputs may be truncated if the context or generation limit is too small.
- The model may produce plausible but incorrect reasoning, especially on unfamiliar or highly complex problems.
- Benchmark scores are sensitive to prompt format, decoding settings, answer extraction, and answer-equivalence checking.
- The custom university-math benchmark has not yet been fully checked for overlap with the fine-tuning data.
Training data
The model was fine-tuned on 1,500 problems selected from AI-MO/NuminaMath-CoT.
The selected problems focus on:
- Limits and continuity
- Derivatives and differentiation rules
- Definite, indefinite, improper, and multiple integrals
- Series and convergence tests
- First- and second-order ordinary differential equations
- Matrices, determinants, and eigenvalues
- Probability, Bayesโ theorem, and combinatorics
The training data uses Chain-of-Thought solutions. No tool-integrated reasoning, Python execution, or calculator calls were used.
Evaluation methodology
- Model:
qwen-math-higher-math, Q4_K_M GGUF - Runtime: Ollama on CPU
- Decoding: greedy,
temperature = 0 - Generation limit: 2,048 tokens
- Evaluation: one generation per problem,
pass@1 - Answer extraction: last valid
\boxed{}expression - Answer checking: mathematical equivalence via
math-verify - Baseline: original
Qwen/Qwen2.5-Math-1.5B-Instruct
Citation
If you use this model, please cite the underlying Qwen2.5-Math work and NuminaMath dataset:
@article{qwen2.5math,
title={Qwen2.5-Math Technical Report: Toward Mathematical Expert Model via Self-Improvement},
author={Qwen Team},
journal={arXiv preprint arXiv:2409.12122},
year={2024}
}
@misc{numina,
title={NuminaMath},
author={AI-MO},
howpublished={\url{[https://huggingface.co/datasets/AI-MO/NuminaMath-CoT](https://huggingface.co/datasets/AI-MO/NuminaMath-CoT)}},
year={2024}
}
- Downloads last month
- 17
4-bit
Model tree for U-Ug1kn/Qwen2.5-Math-1.5B-HigherMath
Base model
Qwen/Qwen2.5-1.5B