Best Local LLM for Math and Quantitative Reasoning

Which open-weight models actually solve math on your hardware, from quick arithmetic to AIME-level problems, ranked by VRAM tier and use case.

TL;DR

  • For most day-to-day arithmetic, algebra, and word problems on a CPU or small GPU, the right pick is a Qwen3 thinking variant at 4B or 8B (qwen3:4b is 2 GB, qwen3:8b is 5.2 GB) or a DeepSeek-R1 distill at the same size. Both are MIT and Apache-2.0, both run on a laptop.
  • For harder competition math (AIME, Olympiad-style), the strong consumer-card choices are Phi-4 reasoning (14B, 11 GB, MIT), Magistral Small (24B, 14 GB, Apache-2.0), and DeepScaleR (1.5B, 3.6 GB) - the last one is a small but surprisingly strong RL-tuned distill that ships a published AIME 2024 score.
  • For the math-only specialist generation that predates reasoning models, Mathstral (7B, 4.1 GB, Apache-2.0) and Qwen2-Math (1.5B/7B/72B, 4K context, Apache-2.0) are still on the Ollama library and still useful for short problems, but the reasoning models above are a better default.
  • Local math still has hard limits: very long proofs, advanced number theory, and Olympiad geometry remain a weakness for any sub-30B model. If the problem is published for a human competition, expect to verify with a CAS or a second model.

Why “best for math” is a separate question

The leaderboard of open-weight general LLMs and the leaderboard of math models are no longer the same list. A reasoning model that explains its work can solve problems a base model of the same size cannot, and a base math-specialist model can be faster and cheaper than a thinking model on the simple arithmetic it was tuned for. Picking one for the wrong job costs accuracy or wastes VRAM.

Three families are worth separating before any benchmark table:

  • Math-specialist base/instruct models. Trained predominantly on math corpora. Short context, fast response, strong on grade-school and competition problems of the kind their training set covered. Examples: Qwen2-Math, Mathstral, WizardMath.
  • Reasoning (thinking) models. Emit a chain-of-thought trace before the final answer. Slower and more verbose per question, but the strongest family on AIME 24/25, MATH-500, and Olympiad-style benchmarks. Examples: DeepSeek-R1 and its distills, QwQ-32B, the Qwen3 thinking tag family, Phi-4-reasoning, Phi-4-mini-reasoning, Magistral, OpenThinker, DeepScaleR.
  • General models with strong math but no chain-of-thought forcing. Qwen3 non-thinking, Phi-4 (the base), most chat-tuned 7-32B models. Useful for quick checks; weaker than reasoning models on multi-step problems.

The rest of this guide picks one model per workload tier.

Smallest tier: 1.5B to 4B - fits in any laptop

For quick arithmetic, percent calculations, and short word problems on a CPU or a 4-8 GB GPU, the cleanest 2026 picks are the smaller distilled reasoning models and the smallest Phi-4 reasoning variant.

DeepScaleR-1.5B-Preview is the surprise of the small tier. The Ollama library lists it at 3.6 GB on disk with a 128K context window (Ollama deepscaler). The published benchmark table on that page reports a 43.1% pass@1 average on AIME 2024, 87.8% on MATH-500, and 73.6% on AMC 2023, against 28.8% / 82.8% / 62.9% for its base DeepSeek-R1-Distill-Qwen-1.5B. The same table claims DeepScaleR-1.5B surpasses OpenAI O1-Preview on AIME 2024. Those numbers come from the model card, not from independent re-evaluation, and the underlying paper is fine-tuning plus distributed RL on roughly 40,000 problem-answer pairs from AIME 1984-2023, AMC, Omni-MATH, and Still. Treat 43.1% as the high end of what a 1.5B model can hit, not a guarantee for any specific problem.

Phi-4-mini-reasoning (3.8B) is the right small-tier pick when reliability on multi-step reasoning matters more than raw speed. The Microsoft model card lists AIME 24 at 57.5%, MATH-500 at 94.6%, and GPQA Diamond at 52.0%, against o1-mini at 63.6% / 90.0% / 60.0% on the same benchmarks (Hugging Face - microsoft/Phi-4-mini-reasoning). The card also lists the base Phi-4-Mini at 10.0% / 71.8% / 36.9% on the same three benchmarks, which is the cleanest single number that shows how much the reasoning fine-tune adds. License: MIT. Context: 128K.

Qwen3:4b (thinking mode) and qwen3:1.7b (thinking) are the non-Microsoft answer in the small tier. The Ollama page lists qwen3:4b at 2 GB and qwen3:8b at 5.2 GB on disk with 256K context for 4B/30B/235B and 40K for the other dense sizes (Ollama qwen3). Math benchmarks for the Qwen3 thinking variants are not published in plain text on that page, but the upstream Qwen team states that “Qwen3-30B-A3B outcompetes QwQ-32B with 10 times of activated parameters” and that Qwen3-4B “rivals Qwen2.5-72B-Instruct” on combined reasoning benchmarks (Qwen3 blog). For day-to-day arithmetic and short word problems, qwen3:4b is a sensible default on hardware that cannot run a 14B model.

If the laptop has no GPU at all, the previous local-AI guide on this site covers the CPU path and the small models that actually run there.

Mid tier: 7B to 14B - the most common consumer GPU

The mid tier is where most readers sit. The right pick depends on whether the priority is breadth (a reasoning model that handles many problem types) or peak math score (a math specialist or a 14B reasoning model trained with RL).

Qwen2-Math (7B) is the legacy math specialist still worth knowing. The Ollama page lists qwen2-math:7b at 4.4 GB on disk with a 4K context window and 1.2M downloads, alongside 1.5B at 935 MB and 72B at 41 GB (Ollama qwen2-math). All tags use a 4K context. The page does not list specific benchmark scores; the headline claim is that the family “significantly outperforms” open and closed competitors including GPT-4o on math. License: Apache-2.0. Caveat: 4K context is short, and the family is from 2024; for problems with long setup text or multi-page proofs, a reasoning model with longer context is a better fit.

Mathstral (7B) is the Mistral math specialist. The Ollama library lists mathstral:7b at 4.1 GB with a 32K context window (Ollama mathstral). The same page reports 68.37% on MATH under majority voting and 74.59% on MATH when paired with a strong reward model among 64 candidates. License: Apache-2.0. Caveat: same vintage as Qwen2-Math; pair with a calculator or a CAS rather than rely on it for fresh competition problems.

DeepSeek-R1 distilled to 8B or 14B (Qwen-based) is the strongest general pick in this tier. The Ollama library lists deepseek-r1:8b at 5.2 GB and deepseek-r1:14b at 9.0 GB, with a 128K context for both distilled tags and a 160K context for the full 671B tag (Ollama deepseek-r1). The page does not publish per-tag math numbers, but the underlying DeepSeek-R1 paper and model card report AIME 2024 pass@1 of 79.8% on the full 671B model with the distilled 32B-ruled Qwen variant close behind. License: MIT. The distilled tags are also MIT and free for commercial use.

Phi-4-reasoning (14B) is the strongest single Microsoft model in the mid tier. The Ollama page lists phi4-reasoning at 11 GB with a 32K context window and identifies the training as supervised fine-tuning on reasoning traces from OpenAI o3-mini, with a “plus” variant that adds reinforcement learning (Ollama phi4-reasoning). The Hugging Face model card for phi-4-reasoning (April 30, 2025) lists AIME 24 at 75.3%, AIME 25 at 62.9%, and OmniMath at 76.6% (Hugging Face - microsoft/phi-4-reasoning). License: MIT. Compared with DeepSeek-R1-Distill-Llama-70B (5x larger), the card claims Phi-4-reasoning exceeds it and is competitive with the full DeepSeek-R1. Independent re-evaluation is patchy; treat the 75.3% as the card’s number, not a settled community benchmark.

OpenThinker (7B or 32B) is the open-data reasoning pick. The Ollama page lists openthinker:7b at 4.7 GB and openthinker:32b at 20 GB, both at 32K context, and identifies the base as Qwen2.5 fine-tuned on the OpenThoughts-114k dataset (Ollama openthinker). The published table for the 32B variant lists AIME24 at 66.0%, AIME25 at 53.3%, MATH-500 at 90.6%, GPQA Diamond at 61.6%, and LiveCodeBench v2 at 68.9% - very close to DeepSeek-R1-Distill-Qwen-32B (AIME24 76.7, AIME25 55.9, MATH-500 89.4) despite training on roughly one-seventh of the examples. The page does not state a license; the underlying repo is fully open-source but the specific tag does not display terms.

Larger tier: 24B to 32B - 24 GB cards

A single 24 GB consumer card (RTX 3090, 4090) can load the top reasoning models in this tier.

Magistral Small (24B) is Mistral’s June 12, 2025 reasoning release and the cleanest 24B math pick. The Ollama page lists magistral at 14 GB with an official 128K context window but a published caveat that performance degrades past 40K, so cap practical use at 40K (Ollama magistral). The Hugging Face model card lists AIME24 pass@1 at 70.68% and AIME25 pass@1 at 62.76% for the Small variant (Hugging Face - mistralai/Magistral-Small-2506). The same card reports GPQA Diamond at 68.18% and Livecodebench v5 at 55.84%, the only two non-math published numbers. License: Apache-2.0. Mistral markets the family for “regulated fields” (legal, finance, healthcare, government) because the chain-of-thought is “traceable for auditability.”

QwQ-32B is the older Qwen reasoning model still widely used. The Ollama page lists qwq:32b at 20 GB with a 40K context window (Ollama qwq). The page does not publish specific math scores; the family is Apache-2.0 per the Qwen release. Its strengths remain multi-step reasoning and tool use rather than peak math numbers, which the newer Qwen3 30B-A3B thinking variant generally beats.

DeepSeek-R1 distilled to 32B is the strongest single open-weight pick in this tier for math. The Ollama library lists deepseek-r1:32b at 20 GB with 128K context (Ollama deepseek-r1). It runs on a 24 GB consumer card. License: MIT. The Qwen3-30B-A3B thinking variant at 19 GB (Ollama qwen3) is the moe alternative at the same VRAM footprint and is reported by the Qwen team to “outcompete QwQ-32B” with 10x fewer activated parameters per token.

The math benchmarks worth checking

Two numbers are worth knowing, because they appear on every modern reasoning-model card:

  • AIME 24 (or AIME 2024). The 2024 American Invitational Mathematics Examination. 15 integer-answer contest problems. Pass@1 (single attempt, single answer) is the standard score. A useful proxy for competition-style word problems with multi-step reasoning.
  • MATH-500. A 500-problem subset of the MATH dataset used in many papers. Saturation has set in - top reasoning models hit 90%+ and the gap between them is shrinking.

Two more numbers appear on the cards but are less decisive:

  • GSM8K. Grade-school word problems. Easy for any 7B+ reasoning model in 2026. Treat GSM8K as a smoke test, not a discriminator.
  • GPQA Diamond. Graduate-level Google-Proof Q&A. Filters reasoning models that overfit to math (a model that is great at AIME may be worse here than a generalist reasoning model).

A useful sanity-check: any modern reasoning model in the 14B+ range that scores below 50% on AIME 24 is doing something wrong, and any that scores above 75% is competitive with frontier closed models on that benchmark. Numbers between those two should be treated as model-specific.

Where local math still loses

Two workloads still defeat consumer-card local models in late 2026:

  • Long proofs and Olympiad geometry. Even Magistral and DeepSeek-R1-Distill-32B fail or hand-wave on multi-page proofs. The published AIME 25 scores (Phi-4-reasoning 62.9, Magistral Small 62.76, DeepSeek-R1-Distill-Llama-70B comparable) are the floor you should expect on a fresh competition, not the median.
  • Numerically heavy computation. Local LLMs still cannot reliably multiply four-digit numbers or integrate a non-trivial function symbolically. Pair the model with a Python REPL, SymPy, or a dedicated CAS, and let the model decide when to call out.

For anything below those limits, the picks above are honest, current, and run on hardware a home user already owns.

The bottom line

For most readers the right math model is Phi-4-mini-reasoning for under-8 GB hardware, DeepSeek-R1 distilled to 8B or 14B (or Phi-4-reasoning) for a single consumer GPU, and Magistral Small or DeepSeek-R1 distilled to 32B on a 24 GB card. Keep Mathstral and Qwen2-Math for short, fast problems where a reasoning trace is wasted tokens, and pair any model with a Python REPL or CAS for the multiplications and integrals.