Instructions to use unsloth/Olmo-3.1-32B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/Olmo-3.1-32B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/Olmo-3.1-32B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/Olmo-3.1-32B-Instruct") model = AutoModelForCausalLM.from_pretrained("unsloth/Olmo-3.1-32B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use unsloth/Olmo-3.1-32B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/Olmo-3.1-32B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/Olmo-3.1-32B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/Olmo-3.1-32B-Instruct
- SGLang
How to use unsloth/Olmo-3.1-32B-Instruct 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 "unsloth/Olmo-3.1-32B-Instruct" \ --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": "unsloth/Olmo-3.1-32B-Instruct", "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 "unsloth/Olmo-3.1-32B-Instruct" \ --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": "unsloth/Olmo-3.1-32B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use unsloth/Olmo-3.1-32B-Instruct 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 unsloth/Olmo-3.1-32B-Instruct 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 unsloth/Olmo-3.1-32B-Instruct to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/Olmo-3.1-32B-Instruct to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="unsloth/Olmo-3.1-32B-Instruct", max_seq_length=2048, ) - Docker Model Runner
How to use unsloth/Olmo-3.1-32B-Instruct with Docker Model Runner:
docker model run hf.co/unsloth/Olmo-3.1-32B-Instruct
Includes Unsloth chat template fixes!
Forllama.cpp, use--jinja
Unsloth Dynamic 2.0 achieves superior accuracy & outperforms other leading quants.
Model Details
Model Card for Olmo-3.1-32B-Instruct
We introduce Olmo 3, a new family of 7B and 32B models both Instruct and Think variants. Long chain-of-thought thinking improves reasoning tasks like math and coding.
Olmo is a series of Open language models designed to enable the science of language models. These models are pre-trained on the Dolma 3 dataset and post-trained on the Dolci datasets. We are releasing all code, checkpoints, logs (coming soon), and associated training details.
The core models released in this batch include the following:
| Stage | Olmo 3 7B Think | Olmo (3/3.1) 32B Think | Olmo 3 7B Instruct | Olmo 3.1 32B Instruct |
|---|---|---|---|---|
| Base Model | Olmo-3-7B | Olmo-3-32B | Olmo-3-7B | Olmo-3-32B |
| SFT | Olmo-3-7B-Think-SFT | Olmo-3-32B-Think-SFT | Olmo-3-7B-Instruct-SFT | Olmo-3.1-32B-Instruct-SFT |
| DPO | Olmo-3-7B-Think-DPO | Olmo-3-32B-Think-DPO | Olmo-3-7B-Instruct-DPO | Olmo-3.1-32B-Instruct-DPO |
| Final Models (RLVR) | Olmo-3-7B-Think | Olmo-3-32B-Think Olmo-3.1-32B-Think |
Olmo-3-7B-Instruct | Olmo-3.1-32B-Instruct |
Installation
Olmo 3 is supported in transformers 4.57.0 or higher:
pip install transformers>=4.57.0
Inference
You can use OLMo with the standard HuggingFace transformers library:
from transformers import AutoModelForCausalLM, AutoTokenizer
olmo = AutoModelForCausalLM.from_pretrained("allenai/Olmo-3.1-32B-Instruct")
tokenizer = AutoTokenizer.from_pretrained("allenai/Olmo-3.1-32B-Instruct")
message = ["Language modeling is "]
inputs = tokenizer(message, return_tensors='pt', return_token_type_ids=False)
# optional verifying cuda
# inputs = {k: v.to('cuda') for k,v in inputs.items()}
# olmo = olmo.to('cuda')
response = olmo.generate(**inputs, max_new_tokens=100, do_sample=True, top_k=50, top_p=0.95)
print(tokenizer.batch_decode(response, skip_special_tokens=True)[0])
>> 'Language modeling is a key component of any text-based application, but its effectiveness...'
For faster performance, you can quantize the model using the following method:
AutoModelForCausalLM.from_pretrained("allenai/Olmo-3.1-32B-Instruct",
torch_dtype=torch.float16,
load_in_8bit=True) # Requires bitsandbytes
The quantized model is more sensitive to data types and CUDA operations. To avoid potential issues, it's recommended to pass the inputs directly to CUDA using:
inputs.input_ids.to('cuda')
We have released checkpoints for these models. For post-training, the naming convention is step_XXXX.
NOTE: For this model, due to a checkpointing issue, we only are releasing the final few checkpoints. See our other RL jobs for more detailed intermediate checkpoint suite.
To load a specific model revision with HuggingFace, simply add the argument revision:
olmo = AutoModelForCausalLM.from_pretrained("allenai/Olmo-3.1-32B-Instruct", revision="step_1375")
Or, you can access all the revisions for the models via the following code snippet:
from huggingface_hub import list_repo_refs
out = list_repo_refs("allenai/Olmo-3.1-32B-Instruct")
branches = [b.name for b in out.branches]
Fine-tuning
Model fine-tuning can be done from the final checkpoint (the main revision of this model) or many intermediate checkpoints. Two recipes for tuning are available.
- Fine-tune with the OLMo-core repository:
torchrun --nproc-per-node=8 ./src/scripts/official/MODEL.py run01
You can override most configuration options from the command-line. For example, to override the learning rate you could launch the script like this:
torchrun --nproc-per-node=8 ./src/scripts/train/MODEL.py run01 --train_module.optim.lr=6e-3
For more documentation, see the GitHub readme.
Model Description
- Developed by: Allen Institute for AI (Ai2)
- Model type: a Transformer style autoregressive language model.
- Language(s) (NLP): English
- License: This model is licensed under Apache 2.0. It is intended for research and educational use in accordance with Ai2's Responsible Use Guidelines.
- Contact: Technical inquiries:
olmo@allenai.org. Press:press@allenai.org - Date cutoff: Dec. 2024.
Model Sources
- Project Page: https://allenai.org/olmo
- Repositories:
- Open-Instruct for DPO and RLVR: https://github.com/allenai/open-instruct
- OLMo-Core for pre-training and SFT: https://github.com/allenai/OLMo-core
- OLMo-Eval for evaluation: https://github.com/allenai/OLMo-Eval
- Paper:: https://allenai.org/papers/olmo3
Evaluation
| Metric | Olmo 3.1 32B Instruct SFT | Olmo 3.1 32B Instruct DPO | Olmo 3.1 32B Instruct | Apertus 70B | Qwen 3 32B (No Think) | Qwen 3 VL 32B Instruct | Qwen 2.5 32B | Gemma 3 27B | Gemma 2 27B | OLMo 2 32B |
|---|---|---|---|---|---|---|---|---|---|---|
| Math | ||||||||||
| MATH | 74.4 | 86.6 | 93.4 | 36.2 | 84.3 | 95.1 | 80.2 | 87.4 | 51.5 | 49.2 |
| AIME 2024 | 12.7 | 35.2 | 67.8 | 0.31 | 27.9 | 75.4 | 15.7 | 28.9 | 4.7 | 4.6 |
| AIME 2025 | 8.2 | 23.3 | 57.9 | 0.1 | 21.3 | 64.2 | 13.4 | 22.9 | 0.9 | 0.9 |
| OMEGA | 15.5 | 33.3 | 42.2 | 5.6 | 23.4 | 44.0 | 19.2 | 24.0 | 9.1 | 9.8 |
| Reasoning | ||||||||||
| BigBenchHard | 69.0 | 82.1 | 84.0 | 57.0 | 80.4 | 89.0 | 80.9 | 82.4 | 66.0 | 65.6 |
| ZebraLogic | 30.6 | 51.1 | 61.7 | 9.0 | 28.4 | 86.7 | 24.1 | 24.8 | 17.2 | 13.3 |
| AGI Eval English | 71.7 | 79.4 | 79.5 | 61.6 | 82.4 | 89.4 | 78.9 | 76.9 | 70.9 | 68.4 |
| Coding | ||||||||||
| HumanEvalPlus | 80.8 | 85.7 | 86.7 | 42.9 | 83.9 | 89.3 | 82.6 | 79.2 | 67.5 | 44.4 |
| MBPP+ | 61.5 | 63.6 | 65.1 | 45.8 | 67.9 | 69.0 | 66.6 | 65.7 | 61.2 | 49.0 |
| LiveCodeBench v3 | 35.4 | 49.6 | 54.7 | 9.7 | 57.5 | 70.2 | 49.9 | 39.0 | 28.7 | 10.6 |
| IF | ||||||||||
| IFEval | 87.7 | 87.3 | 88.8 | 70.4 | 87.5 | 88.1 | 81.9 | 85.4 | 62.1 | 85.8 |
| IFBench | 29.7 | 36.3 | 39.7 | 26.0 | 31.3 | 37.2 | 36.7 | 31.3 | 27.8 | 36.4 |
| Knowledge & QA | ||||||||||
| MMLU | 79.0 | 81.9 | 80.9 | 70.2 | 85.8 | 88.7 | 84.6 | 74.6 | 76.1 | 77.1 |
| PopQA | 23.7 | 28.5 | 25.0 | 33.5 | 25.9 | 25.7 | 28.0 | 30.2 | 30.4 | 37.2 |
| GPQA | 41.3 | 47.9 | 48.6 | 27.9 | 54.4 | 61.4 | 44.6 | 45.0 | 39.9 | 36.4 |
| Chat | ||||||||||
| AlpacaEval 2 LC | 42.2 | 69.7 | 59.8 | 19.9 | 67.9 | 84.3 | 81.9 | 65.5 | 39.8 | 38.0 |
| Safety | 92.1 | 88.9 | 89.5 | 77.1 | 81.6 | 85.8 | 82.2 | 68.8 | 74.4 | 84.2 |
Model Details
Stage 1: SFT
- supervised fine-tuning on the Dolci-Think-SFT-7B dataset. This dataset consits of math, code, chat, and general knowledge queries.
- Datasets: Dolci-Think-SFT-7B, Dolci-Instruct-SFT
Stage 2:DPO
- direct preference optimization on the Dolci-Think-DPO-7B dataset. This dataset consits of math, code, chat, and general knowledge queries.
- Datasets: Dolci-Think-DPO-7B, Dolci-Instruct-DPO
Stage 3: RLVR
- reinforcement learning from verifiable rewards on the Dolci-Think-RL-7B dataset. This dataset consits of math, code, instruction-following, and general chat queries.
- Datasets: Dolci-Think-RL-7B, Dolci-Instruct-RL
Bias, Risks, and Limitations
Like any base language model or fine-tuned model without safety filtering, these models can easily be prompted by users to generate harmful and sensitive content. Such content may also be produced unintentionally, especially in cases involving bias, so we recommend that users consider the risks when applying this technology. Additionally, many statements from OLMo or any LLM are often inaccurate, so facts should be verified.
License
This model is licensed under Apache 2.0. It is intended for research and educational use in accordance with Ai2's Responsible Use Guidelines.
Citation
A technical manuscript is forthcoming!
Model Card Contact
For errors in this model card, contact olmo@allenai.org.
- Downloads last month
- 13
Model tree for unsloth/Olmo-3.1-32B-Instruct
Base model
allenai/Olmo-3-1125-32B
docker model run hf.co/unsloth/Olmo-3.1-32B-Instruct