Instructions to use Xylolabs/MobileLLM-R2-2.5B-base-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 Xylolabs/MobileLLM-R2-2.5B-base-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 Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Xylolabs/MobileLLM-R2-2.5B-base-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 Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf Xylolabs/MobileLLM-R2-2.5B-base-GGUF: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 Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M
Use Docker
docker model run hf.co/Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use Xylolabs/MobileLLM-R2-2.5B-base-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xylolabs/MobileLLM-R2-2.5B-base-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": "Xylolabs/MobileLLM-R2-2.5B-base-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M
- Ollama
How to use Xylolabs/MobileLLM-R2-2.5B-base-GGUF with Ollama:
ollama run hf.co/Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use Xylolabs/MobileLLM-R2-2.5B-base-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Xylolabs/MobileLLM-R2-2.5B-base-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:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Xylolabs/MobileLLM-R2-2.5B-base-GGUF with Docker Model Runner:
docker model run hf.co/Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M
- Lemonade
How to use Xylolabs/MobileLLM-R2-2.5B-base-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.MobileLLM-R2-2.5B-base-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use Xylolabs/MobileLLM-R2-2.5B-base-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 Xylolabs/MobileLLM-R2-2.5B-base-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:9931/v1 hermes config set model.default Xylolabs/MobileLLM-R2-2.5B-base-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Xylolabs/MobileLLM-R2-2.5B-base-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Xylolabs/MobileLLM-R2-2.5B-base-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:9931/v1 \ --custom-model-id "Xylolabs/MobileLLM-R2-2.5B-base-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"
Download README.md from Xylolabs/MobileLLM-R2-2.5B-base-GGUF: direct link, hf CLI and curl.
- Browser
- Download file 34.2 kB
-
https://huggingface.co/Xylolabs/MobileLLM-R2-2.5B-base-GGUF/resolve/main/README.md
- Command line
-
hf download hf://Xylolabs/MobileLLM-R2-2.5B-base-GGUF/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/Xylolabs/MobileLLM-R2-2.5B-base-GGUF/resolve/main/README.md
license: other
license_name: fair-noncommercial-research-license
license_link: LICENSE
base_model: facebook/MobileLLM-R2-2.5B-base
base_model_relation: quantized
library_name: gguf
pipeline_tag: text-generation
tags:
- gguf
- llama-cpp
- mobilellm
extra_gated_prompt: >
FAIR Noncommercial Research License
v1 Last Updated: September 23, 2025
“Acceptable Use Policy” means the FAIR Acceptable Use Policy, applicable to
Research Materials, that is incorporated into this Agreement.
“Agreement” means the terms and conditions for use, reproduction, distribution
and modification of the Research Materials set forth herein.
“Documentation” means the specifications, manuals and documentation
accompanying
Research Materials distributed by Meta.
“Licensee” or “you” means you, or your employer or any other person or entity
(if you are entering into this Agreement on such person or entity’s behalf),
of the age required under applicable laws, rules or regulations to provide
legal consent and that has legal authority to bind your employer or such other
person or entity if you are entering in this Agreement on their behalf.
“Meta” or “we” means Meta Platforms Ireland Limited (if you are located in or,
if you are an entity, your principal place of business is in the EEA or
Switzerland) and Meta Platforms, Inc. (if you are located outside of the EEA
or Switzerland).
“Noncommercial Research Uses” means noncommercial research use cases related
to research, development, education, processing, or analysis and in each case,
is not primarily intended for commercial advantage or monetary compensation to
you or others.
“Research Materials” means, collectively, Documentation and the models,
software and algorithms, including machine-learning model code, trained model
weights, inference-enabling code, training-enabling code, fine-tuning enabling
code, demonstration materials and other elements of the foregoing distributed
by Meta and made available under this Agreement.
By clicking “I Accept” below or by using or distributing any portion or
element of the Research Materials, you agree to be bound by this Agreement.
1. License Rights and Redistribution.
a. Grant of Rights. You are granted a non-exclusive, worldwide,
non-transferable and royalty-free limited license under Meta’s intellectual
property or other rights owned by Meta embodied in the Research Materials to
use, reproduce, distribute, copy, create derivative works of, and make
modifications to the Research Materials.
b. Redistribution and Use.
i. You will not use the Research Materials or any outputs or results of the Research Materials in connection with any commercial uses or for any uses other than Noncommercial Research Uses;
ii. Distribution of Research Materials, and any derivative works thereof, are
subject to the terms of this Agreement. If you distribute or make the Research
Materials, or any derivative works thereof, available to a third party, you
may only do so under the terms of this Agreement. You shall also provide a
copy of this Agreement to such third party.
iii. If you submit for publication the results of research you perform on,
using, or otherwise in connection with Research Materials, you must
acknowledge the use of Research Materials in your publication.
iv. Your use of the Research Materials must comply with applicable laws and
regulations (including Trade Control Laws) and adhere to the FAIR Acceptable
Use Policy, which is hereby incorporated by reference into this Agreement.
2. User Support. Your Noncommercial Research Use of the Research Materials is
done at your own discretion; Meta does not process any information nor provide
any service in relation to such use. Meta is under no obligation to provide
any support services for the Research Materials. Any support provided is “as
is”, “with all faults”, and without warranty of any kind.
3. Disclaimer of Warranty. UNLESS REQUIRED BY APPLICABLE LAW, THE RESEARCH
MATERIALS AND ANY OUTPUT AND RESULTS THEREFROM ARE PROVIDED ON AN “AS IS”
BASIS, WITHOUT WARRANTIES OF ANY KIND, AND META DISCLAIMS ALL WARRANTIES OF
ANY KIND, BOTH EXPRESS AND IMPLIED, INCLUDING, WITHOUT LIMITATION, ANY
WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A
PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE
APPROPRIATENESS OF USING OR REDISTRIBUTING THE RESEARCH MATERIALS AND ASSUME
ANY RISKS ASSOCIATED WITH YOUR USE OF THE RESEARCH MATERIALS AND ANY OUTPUT
AND RESULTS.
4. Limitation of Liability. IN NO EVENT WILL META OR ITS AFFILIATES BE LIABLE
UNDER ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, TORT, NEGLIGENCE, PRODUCTS
LIABILITY, OR OTHERWISE, ARISING OUT OF THIS AGREEMENT, FOR ANY LOST PROFITS
OR ANY DIRECT OR INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL, EXEMPLARY OR
PUNITIVE DAMAGES, EVEN IF META OR ITS AFFILIATES HAVE BEEN ADVISED OF THE
POSSIBILITY OF ANY OF THE FOREGOING.
5. Intellectual Property.
a. Subject to Meta’s ownership of Research Materials and derivatives made by
or for Meta, with respect to any derivative works and modifications of the
Research Materials that are made by you, as between you and Meta, you are and
will be the owner of such derivative works and modifications.
b. If you institute litigation or other proceedings against Meta or any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that the
Research Materials, outputs or results, or any portion of any of the
foregoing, constitutes infringement of intellectual property or other rights
owned or licensable by you, then any licenses granted to you under this
Agreement shall terminate as of the date such litigation or claim is filed or
instituted. You will indemnify and hold harmless Meta from and against any
claim by any third party arising out of or related to your use or distribution
of the Research Materials.
6. Term and Termination. The term of this Agreement will commence upon your
acceptance of this Agreement or access to the Research Materials and will
continue in full force and effect until terminated in accordance with the
terms and conditions herein. Meta may terminate this Agreement if you are in
breach of any term or condition of this Agreement. Upon termination of this
Agreement, you shall delete and cease use of the Research Materials. Sections
3, 4 and 7 shall survive the termination of this Agreement.
7. Governing Law and Jurisdiction. This Agreement will be governed and
construed under the laws of the State of California without regard to choice
of law principles, and the UN Convention on Contracts for the International
Sale of Goods does not apply to this Agreement. The courts of California shall
have exclusive jurisdiction of any dispute arising out of this Agreement.
8. Modifications and Amendments. Meta may modify this Agreement from time to
time; provided that they are similar in spirit to the current version of the
Agreement, but may differ in detail to address new problems or concerns. All
such changes will be effective immediately. Your continued use of the Research
Materials after any modification to this Agreement constitutes your agreement
to such modification. Except as provided in this Agreement, no modification or
addition to any provision of this Agreement will be binding unless it is in
writing and signed by an authorized representative of both you and Meta.
FAIR Acceptable Use Policy
The Fundamental AI Research (FAIR) team at Meta seeks to further understanding
of new and existing research domains with the mission of advancing the
state-of-the-art in artificial intelligence through open research for the
benefit of all.
As part of this mission, Meta makes certain research materials available for
noncommercial research use. Meta is committed to promoting the safe and
responsible use of such research materials.
Prohibited Uses
You agree you will not use, or allow others to use, Research Materials to:
Violate the law or others’ rights, including to:
Engage in, promote, generate, contribute to, encourage, plan, incite, or
further illegal or unlawful activity or content, such as:
Violence or terrorism
Exploitation or harm to children, including the solicitation, creation,
acquisition, or dissemination of child exploitative content or failure to
report Child Sexual Abuse Material
Human trafficking, exploitation, and sexual violence
The illegal distribution of information or materials to minors, including
obscene materials, or failure to employ legally required age-gating in
connection with such information or materials.
Sexual solicitation
Any other criminal activity
Engage in, promote, incite, or facilitate the harassment, abuse, threatening,
or bullying of individuals or groups of individuals
Engage in, promote, incite, or facilitate discrimination or other unlawful or
harmful conduct in the provision of employment, employment benefits, credit,
housing, other economic benefits, or other essential goods and services
Engage in the unauthorized or unlicensed practice of any profession including,
but not limited to, financial, legal, medical/health, or related professional
practices
Collect, process, disclose, generate, or infer health, demographic, or other
sensitive personal or private information about individuals without rights and
consents required by applicable laws
Engage in or facilitate any action or generate any content that infringes,
misappropriates, or otherwise violates any third-party rights, including the
outputs or results of any technology using FAIR research materials
Create, generate, or facilitate the creation of malicious code, malware,
computer viruses or do anything else that could disable, overburden, interfere
with or impair the proper working, integrity, operation or appearance of a
website or computer system
2. Engage in, promote, incite, facilitate, or assist in the planning or
development of activities that present a risk of death or bodily harm to
individuals, including use of research artifacts related to the following:
Military, warfare, nuclear industries or applications, espionage, use for
materials or activities that are subject to the International Traffic Arms
Regulations (ITAR) maintained by the United States Department of State
Guns and illegal weapons (including weapon development)
Illegal drugs and regulated/controlled substances
Operation of critical infrastructure, transportation technologies, or heavy
machinery
Self-harm or harm to others, including suicide, cutting, and eating disorders
Any content intended to incite or promote violence, abuse, or any infliction
of bodily harm to an individual
3. Intentionally deceive or mislead others, including use of FAIR Research
Materials related to the following:
Generating, promoting, or furthering fraud or the creation or promotion of disinformation
Generating, promoting, or furthering defamatory content, including the creation of defamatory statements, images, or other content
Generating, promoting, or further distributing spam
Impersonating another individual without consent, authorization, or legal right
Representing that outputs of FAIR research materials or outputs from
technology using FAIR research materials are human-generated
Generating or facilitating false online engagement, including fake reviews and
other means of fake online engagement
4. Fail to appropriately disclose to end users any known dangers of your
Research Materials.
Please report any violation of this Policy or other problems that could lead
to a violation of this Policy by submitting a report here
[https://docs.google.com/forms/d/e/1FAIpQLSeb11cryAopJ7LNrC4nxEUXrHY26hfkXQMf_uH-oFgA3WlYZQ/viewform].
extra_gated_fields:
I accept the terms of the FAIR Noncommercial Research License above: checkbox
extra_gated_description: >-
By default, Hugging Face shares your username and primary email address with
Xylolabs, the repository owner, when you request access.
extra_gated_button_content: Submit
MobileLLM-R2-2.5B-base-GGUF
Quantized Meta MobileLLM-R2-2.5B-base GGUF files run with llama.cpp; BF16 is not included.
Files
| Quant | Parts | Size |
|---|---|---|
| Q2_K | 1 | 1.633 GB |
| Q3_K_M | 1 | 1.895 GB |
| IQ4_XS | 1 | 2.042 GB |
| Q4_K_S | 1 | 2.119 GB |
| Q4_K_M | 1 | 2.184 GB |
| Q5_K_M | 1 | 2.443 GB |
| Q6_K | 1 | 2.719 GB |
| Q8_0 | 1 | 3.391 GB |
How to run
Requires llama.cpp build b12531 or newer with muse-spark support.
llama-completion -m MobileLLM-R2-2.5B-Base-Q4_K_M.gguf --swa-full -p "Once upon a time" -n 128
Accuracy
Mean KL divergence and top-1 agreement against BF16 on WikiText-2, raw and held-out text.
| Quant | Size | WikiText-2 KL | top-1 | Raw KL | top-1 | Held-out KL | top-1 |
|---|---|---|---|---|---|---|---|
| Q2_K | 1.633 GB | 0.444059 | 69.725% | 0.399286 | 70.549% | 0.681510 | 58.176% |
| Q3_K_M | 1.895 GB | 0.100742 | 85.363% | 0.099648 | 85.294% | 0.147587 | 78.775% |
| IQ4_XS | 2.042 GB | 0.045887 | 89.162% | 0.039988 | 90.275% | 0.061291 | 84.569% |
| Q4_K_S | 2.119 GB | 0.042427 | 90.093% | 0.041043 | 91.059% | 0.051967 | 86.343% |
| Q4_K_M | 2.184 GB | 0.028948 | 91.598% | 0.026232 | 92.627% | 0.043552 | 87.167% |
| Q5_K_M | 2.443 GB | 0.010207 | 94.706% | 0.009505 | 94.824% | 0.013828 | 92.441% |
| Q6_K | 2.719 GB | 0.005923 | 95.956% | 0.005174 | 96.745% | 0.006940 | 94.657% |
| Q8_0 | 3.391 GB | 0.003006 | 97.186% | 0.002712 | 97.098% | 0.003677 | 96.167% |
Hardware
| Hardware | Memory | File | Context |
|---|---|---|---|
| RTX 4090 / RTX 3090 | 24 GB | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| RTX 5090 | 32 GB | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| RTX 6000 Ada, or 2 x 24 GB | 48 GB | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| One H100 | 80 GB | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| RTX PRO 6000 Blackwell (GDDR7) | 96 GB | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| DGX Spark | 128 GB unified | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| Mac Studio M5 Max | 128 GB unified | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| One H200 (HBM3e) | 141 GB | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| One B200 | 192 GB | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| Mac Studio M5 Ultra | 256 GB unified | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| Mac Studio M5 Ultra | 512 GB unified | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
| One B300 (HBM3e) | 288 GB | MobileLLM-R2-2.5B-Base-Q8_0.gguf (3.4 GB) |
16K |
License
FAIR Noncommercial Research License.
Updates
- 2026-12-03: Added Q2_K, Q3_K_M, IQ4_XS, Q4_K_S, Q4_K_M, Q5_K_M, Q6_K and Q8_0.
🤗 Hugging Face | 🌐 Project page
Model Details
We present MobileLLM-R2, the latest 2.5B-parameter model in the MobileLLM family. Trained on 1.2T pre-training tokens and fewer than 2T tokens in total, MobileLLM-R2 supports both long-horizon reasoning and multi-turn agentic tool use. This release includes:
Base model:
Final model:
- MobileLLM-R2-2.5B
- MobileLLM-R2-2.5B-GGUF (llama.cpp)
In addition to the models, we release the complete training recipe and intermediate checkpoints to facilitate further research on efficient and reproducible agentic model training.
Intermediate checkpoints
| Pre-training | Mid-training Phase 1 | Mid-training Phase 2 | General SFT | Agentic Reasoning SFT | On-policy Distillation |
|---|
Highlights
- Agentic coding at 2.5B parameters: 30.9% on SWE-Bench Verified, 15.3 points above the strongest baseline, Qwen3.5-2B (15.6%).
- Reasoning and coding: the best AIME'24 (59.4%) and LiveCodeBench (47.3%) scores of all seven models compared.
- Token efficiency: 1.2T pre-training tokens, 9.3× fewer than SmolLM3-3B and 30× fewer than the Qwen3 family.
- On-policy distillation: the final stage adds 9.6 points on AIME'24, 8.7 on LiveCodeBench and 5.9 on SWE-Bench Verified over the SFT model.
- On device: 3.0 GiB of memory at a 32K context with Q4_K_M weights and an 8-bit KV cache, suggesting memory feasibility on commodity mobile devices.
With only 2.5B parameters and 1.2T pre-training tokens, MobileLLM-R2 outperforms OLMo-3-7B-Instruct (7.3B parameters, 5.9T pre-training tokens) on five of the six benchmarks shown, spanning mathematical reasoning, coding, and agentic tasks.
News
- Nov 30, 2026: 🚀 MobileLLM-R2 models are released on HuggingFace.
- Nov 24, 2025: 🔥 MobileLLM-R1.5 models are available on HuggingFace.
- Sept 29, 2025: 🎉 The technical report "MobileLLM-R1: Exploring the Limits of Sub-Billion Language Model Reasoners with Open Training Recipes" is available.
- Sept 28, 2025: 🌟 The MobileLLM-R1 training code is available on GitHub.
- Sept 12, 2025: 🚀 MobileLLM-R1 models are released on HuggingFace.
Model Architecture:
| # Layers | # Attention Heads | # KV Heads | Dim | Hidden Dim | Params | |
|---|---|---|---|---|---|---|
| MobileLLM-R2-2.5B | 32 | 32 | 8 | 2048 | 8192 | 2.49B |
| Input modalities | Output modalities | Context Length | Vocabulary Size | Shared Embeddings | |
|---|---|---|---|---|---|
| MobileLLM-R2-2.5B-base | Text | Text | 16k | 202k | Yes |
| MobileLLM-R2-2.5B | Text | Text | 32k | 202k | Yes |
Our architecture builds upon the designs of MobileLLM and Muse-Glimmer-30B. We adopt the Muse-Glimmer tokenizer, which has a 202,048-token subword vocabulary, together with SwiGLU activations and RoPE with θ = 107, and we share the input and output embedding weights.
Demo: a local coding agent
MobileLLM-R2 runs as a coding agent on a laptop with llama.cpp. We ran two agent harnesses, Terminus-2 and Claude Code, on tasks from a 100-task sample of SWE-bench Verified, with the Q8_0 GGUF file and each task in a container without network access. These replays show runs whose fix passed the task's SWE-bench tests.
- Full replay: eight solved runs on one page, which also works offline once saved.
- Run it yourself: the GGUF model card has the setup for both harnesses.
- Claude Code: the run goes through a small adapter that repairs mechanical tool-call mistakes. It is provided as a demo only, and its code will be released with our open-source code on GitHub. Anthropic does not support using Claude Code with models other than Claude.
How to use
The model code ships with the checkpoint, so pass trust_remote_code=True to both the tokenizer and the model:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("facebook/MobileLLM-R2-2.5B", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("facebook/MobileLLM-R2-2.5B", dtype=torch.bfloat16, trust_remote_code=True)
Inference examples
Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "facebook/MobileLLM-R2-2.5B"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id, dtype=torch.bfloat16, trust_remote_code=True
).to("cuda")
# Math problem / default scenario (reasoning strength "high" by default)
messages = [{"role": "user", "content": "Compute: $1-2+3-4+5- \\dots +99-100$."}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to("cuda")
# Tool calling / agentic scenario: low reasoning strength, as in the agentic training data
tools = [{"type": "function", "function": {"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
messages = [{"role": "user", "content": "What is the weather like in Paris right now?"}]
inputs = tokenizer.apply_chat_template(
messages, tools=tools, reasoning_strength="low",
add_generation_prompt=True, return_tensors="pt", return_dict=True
).to("cuda")
out = model.generate(**inputs, max_new_tokens=30000) # sampling defaults: temperature 0.6, top-p 0.95, top-k 20
print(tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False))
You can also serve it with stock vLLM 0.28 or newer, whose built-in muse_glimmer parsers return OpenAI-style tool_calls (on vLLM 0.17 to 0.27, install vllm_plugin/ from the repository):
vllm serve facebook/MobileLLM-R2-2.5B --trust-remote-code \
--enable-auto-tool-choice --tool-call-parser muse_glimmer --reasoning-parser muse_glimmer
For llama.cpp (b11671 or later): llama-server -m MobileLLM-R2-Q4_K_M.gguf --jinja --swa-full -c 32768.
Evaluation
MobileLLM-R2 base model
| Model | MATH500 | GSM8K | MBPP | HumanEval | CommonSense | MMLU | WikiText-2 (↓) |
|---|---|---|---|---|---|---|---|
| 4-shot em | 8-shot em | 3-shot pass@1 | 0-shot pass@1 | 0-shot accuracy | 5-shot accuracy | perplexity | |
| MobileLLM-R2-2.5B-base | 45.0 | 88.9 | 54.2 | 43.9 | 56.7 | 54.4 | 15.75 |
MobileLLM-R2 post-trained model
| Category | Benchmark | MobileLLM-R2-2.5B | MobileLLM-R1.5-950M | Qwen3.5-2B | SmolLM3-3B | Nemotron-3-Nano-4B | Gemma-4-E2B | Olmo-3-7B |
|---|---|---|---|---|---|---|---|---|
| Size | 2.50B | 0.95B | 2.27B | 3.08B | 3.97B | 2.00B / 5.12B | 7.30B | |
| Math | AIME24 (avg@16) | 59.4 | 39.8 | 13.3 | 46.7 | 58.5 | 48.1 | 54.8 |
| AIME25 (avg@16) | 49.0 | 31.0 | 16.5 | 37.7 | 56.5 | 36.0 | 42.3 | |
| MATH500 | 91.0 | 86.6 | 67.8 | 91.8 | 91.4 | 77.4 | 92.0 | |
| GSM8K | 91.9 | 83.7 | 76.2 | 88.0 | 87.2 | 90.1 | 93.3 | |
| Knowledge | MMLU | 56.5 | 37.4 | 65.9 | 63.2 | 65.8 | 58.1 | 63.4 |
| GPQA-Diamond | 45.2 | 29.3 | 51.5 | 41.4 | 61.1 | 44.4 | 41.9 | |
| Coding | HumanEval | 69.5 | 11.6 | 36.0 | 54.3 | 72.0 | 67.1 | 47.6 |
| MBPP | 49.6 | 5.6 | 23.2 | 50.0 | 45.8 | 47.4 | 39.2 | |
| LiveCodeBench v6 | 47.3 | 29.1 | 12.6 | 28.8 | 45.3 | 44.8 | 21.8 | |
| Agentic | BFCL V4 | 50.6 | 10.2 | 48.9 | 25.7 | 53.8 | 41.9 | 31.8 |
| SWE-Bench Verified | 30.9 | 0.0 | 15.6 | 0.0 | 7.3 | 1.1 | 0.6 | |
| OOD | Terminal-Bench 2.0 | 5.2 | 0.0 | 4.1 | 0.4 | 2.6 | 1.9 | 1.1 |
| Aider Polyglot | 6.5 | 2.7 | 3.7 | 2.5 | 5.0 | 3.7 | 2.1 | |
| BFCL-Parity | 77.5 | 0.0 | 30.1 | 70.2 | 68.0 | 84.0 | 69.4 |
Bold: within 1.0 point of the best among models under 3.5B total parameters. Underline: best of all models.
Quantized models (GGUF)
MobileLLM-R2-2.5B-GGUF provides BF16 and five quantizations from 1.5 to 5.0 GB. These files, in dense/, run on llama.cpp built with the small patch in that folder; on an Apple M4 Max laptop, Q4_K_M with an 8-bit KV cache decodes 137 tokens/s at a 4K context.
| Quantization | Size (GB) | Perplexity | vs BF16 |
|---|---|---|---|
| BF16 | 5.00 | 15.61 | reference |
| Q8_0 | 2.67 | 15.64 | +0.2% |
| Q6_K | 2.09 | 15.64 | +0.2% |
| Q5_K_M | 1.87 | 15.76 | +1.0% |
| Q4_K_M | 1.67 | 16.17 | +3.6% |
| IQ4_XS | 1.54 | 16.37 | +4.9% |
Perplexity is measured with llama-perplexity on the full WikiText-2 test set at a 512-token context.
Training
Training Process
MobileLLM-R2 is pre-trained on 1.2T tokens selected from a pool of over 15T raw tokens from 194 sources, mid-trained in two phases, the second with more math and code, and post-trained in three stages: general SFT, agentic reasoning SFT, and on-policy knowledge distillation (OPD).
Training stages and hyperparameter details
In pre-training, the model is optimized with Muon at a peak learning rate of 1.2×10-3 and a weight decay of 0.1, on a cosine schedule with 7,500 warmup steps, with online knowledge distillation from Muse-Glimmer-30B (forward KL, no hard-label loss).
In mid-training, two 50,000-step distillation phases from Muse-Glimmer-30B each decay the learning rate linearly to zero; the share of math and code rises from 15.1% and 27.6% in Phase 1 to 49.0% and 39.2% in Phase 2.
In post-training, both SFT stages use Muon with a cosine schedule (10% warmup) and zero weight decay. OPD samples one student rollout per prompt (temperature 0.6, top-p 0.95, up to 30,000 tokens) and minimizes the forward KL from the teacher over the full vocabulary.
| Stage | Phase | Tokens / Samples | Batch Size | Sequence Length | Updates / Epochs | Peak LR | #GPUs |
|---|---|---|---|---|---|---|---|
| Pre-training | Single phase | 1.2T tokens | 128 | 16k | 600k | 1.2e-3 | 32 x 8 |
| Mid-training | Phase 1 | 105B tokens | 128 | 16k | 50k | 3.63e-4 | 16 x 8 |
| Phase 2 | 105B tokens | 128 | 16k | 50k | 3.63e-4 | 16 x 8 | |
| Post-training | General SFT | 2.4M samples | 1024 | 32k | 2 epochs | 8e-5 | 16 x 8 |
| Agentic Reasoning SFT | 8.8M samples | 1024 | 32k | 1 epoch | 4e-5 | 16 x 8 | |
| OPD | 812K samples | 1024 | 32k | 1 epoch | 5e-6 | 16 x 8 |
Data Mix
Pre-training
| Dataset | Subset | Mix Ratio |
|---|---|---|
| FineWeb-Edu | v1.4.0 | 0.86% |
| Dolma 3 | Common Crawl | 57.84% |
| Stack Edu | 2.95% | |
| olmOCR Science | 10.28% | |
| ProofPile Arxiv | 0.31% | |
| Wiki | 0.79% | |
| Dolma | FLAN | 0.58% |
| DCLM | Baseline | 0.51% |
| MegaMath | Text and code blocks | 0.69% |
| Translated code | 0.27% | |
| QA | 0.98% | |
| Web Pro | 0.73% | |
| Nemotron | Code | 0.51% |
| Math | 0.95% | |
| Science | 0.55% | |
| FineMath | Base and subsets | 0.33% |
| OpenWebMath | Proof-Pile 2 | 0.34% |
| Algebraic Stack | Proof-Pile 2 | 0.31% |
| Arxiv | Arxiv | 0.80% |
| StackExchange | StackExchange | 0.29% |
| Wiki | English | 0.46% |
| Natural Reasoning | -- | 0.73% |
| Cosmopedia | SmolLM | 0.27% |
| Bridge data | Synthetic cross-domain | 15.78% |
| Others | -- | 1.89% |
| Total | 100.00% |
Mid-training
| Dataset | Subset | Rows (M) | Phase1 Mix Ratio | Phase2 Mix Ratio |
|---|---|---|---|---|
| Dolmino | DCLM Baseline | 606 | 37.03% | 6.58% |
| FLAN | 57.3 | 4.10% | 0.73% | |
| peS2o | 38.8 | 11.41% | 2.03% | |
| Wiki | 6.17 | 2.66% | 0.47% | |
| StackExchange | 2.48 | 2.12% | 2.02% | |
| Math | 21 | 11.63% | 29.39% | |
| Nemotron | Code (SFT) | 10.1 | 5.69% | 8.08% |
| Math (SFT) | 22.1 | 3.45% | 19.59% | |
| StarCoder | StarCoder | 206 | 6.90% | 9.80% |
| Dolma 3 | Stack-Edu (Python, C++, C, JavaScript) | 526 | 15.00% | 21.31% |
| Total | 100.00% | 100.00% |
Post-training
| Phase | Objective | Dataset | Data Type | Rows | Repeat | Epochs | Teacher-rewritten |
|---|---|---|---|---|---|---|---|
| General SFT | CE | Dolci-Think-SFT-7B | General Reasoning | 2.3M | 1× | 2 | 0% |
| Nemotron-Agentic-v1 | Agentic | 100K | 1× | 2 | 0% | ||
| Agentic Reasoning SFT | CE | OpenMathReasoning (CoT) | Math Reasoning | 3.2M | 1× | 1 | 25.0% |
| OpenCodeReasoning-2 | Code Reasoning | 2.6M | 1× | 1 | 12.9% | ||
| OpenScienceReasoning-2 | Science Reasoning | 1.6M | 1× | 1 | 24.8% | ||
| OpenThoughts-Agent-SFT | Agentic | 94K | 14× | 1 | 5.0% | ||
| Synthesized Agentic Data | Agentic | 27K | 3× | 1 | 0% | ||
| OPD | KL | OpenMathReasoning | Math Reasoning | 561K | 1× | 1 | -- |
| OpenCodeReasoning-2 | Code Reasoning | 184K | 1× | 1 | -- | ||
| OpenThoughts-Agent | Agentic | 66K | 1× | 1 | -- |
Citation
If you find our model useful for your research, please consider citing:
@article{zhao2026mobilellm-r2,
title={MobileLLM-R2: Advancing On-Device Language Models from Reasoning to Agents},
author={Zhao, Changsheng and Chang, Ernie and Liu, Zechun and Ashley, Dylan R. and Paltenghi, Matteo and Chandra, Vikas and Shi, Yangyang and Krishnamoorthi, Raghuraman},
journal={arXiv preprint arXiv:2611.39870},
year={2026}
}
@inproceedings{zhao2026mobilellm-r1,
title={Mobilellm-r1: Exploring the limits of sub-billion language model reasoners with open training recipes},
author={Zhao, Changsheng and Chang, Ernie and Liu, Zechun and Chang, Chia-Jung and Wen, Wei and Lai, Chen and Cao, Sheng and Tian, Yuandong and Krishnamoorthi, Raghuraman and Shi, Yangyang and others},
booktitle={International Conference on Learning Representations},
volume={2026},
pages={121936--121955},
year={2026}
}
Contact
Changsheng Zhao, Meta Inc (cszhao at meta dot com)
Ernie Chang, Meta Inc (erniecyc at meta dot com)
Zechun Liu, Meta Inc (zechunliu at meta dot com)
License
MobileLLM-R2 is released under the FAIR Noncommercial Research License; see LICENSE.

