Instructions to use pre-to-post-olmo/Math-Models with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use pre-to-post-olmo/Math-Models with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="pre-to-post-olmo/Math-Models", device_map="auto")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("pre-to-post-olmo/Math-Models", dtype="auto", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use pre-to-post-olmo/Math-Models with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "pre-to-post-olmo/Math-Models" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pre-to-post-olmo/Math-Models", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/pre-to-post-olmo/Math-Models
- SGLang
How to use pre-to-post-olmo/Math-Models 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 "pre-to-post-olmo/Math-Models" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pre-to-post-olmo/Math-Models", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "pre-to-post-olmo/Math-Models" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pre-to-post-olmo/Math-Models", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use pre-to-post-olmo/Math-Models with Docker Model Runner:
docker model run hf.co/pre-to-post-olmo/Math-Models
Math-Models
Checkpoints from a pretraining β post-training study on a 1B-parameter OLMo-2 model trained on math. The repo bundles, for 15 pretraining anchors, the model at every stage of the pipeline:
pretrain β anneal β SFT β RL
so you can compare how the amount of pretraining changes what post-training can add.
Structure
Each folder is one pretraining anchor (a stable pretraining checkpoint at
step{N}, β N Γ 2.097M tokens). Inside it, one subfolder per stage:
step{N}/
βββ pretrain/ # stable pretraining snapshot @ step N
βββ anneal/ # LR-annealed from the pretrain snapshot
βββ sft/ # SFT (NuminaMath) on top of the anneal
βββ rl/
βββ step100/ # GRPO RL (DeepScaleR), every 100 steps ...
βββ step200/
βββ ... up to step3000
Every leaf is a self-contained, ready-to-load HF model in bf16 safetensors (weights + tokenizer only β no optimizer state or training logs).
| Anchor | Pretrain tokens | Anchor | Pretrain tokens |
|---|---|---|---|
step5000 |
10.5B | step45000 |
94.4B |
step10000 |
21.0B | step50000 |
104.9B |
step15000 |
31.5B | step60000 |
125.8B |
step20000 |
41.9B | step70000 |
146.8B |
step25000 |
52.4B | step80000 |
167.8B |
step30000 |
62.9B | step90000 |
188.7B |
step35000 |
73.4B | step95368 |
200.0B (final) |
step40000 |
83.9B |
Loading
The models use the standard OLMo-2 architecture, so transformers loads them
directly β no trust_remote_code. Point from_pretrained at the subfolder you want.
If you don't want to clone the whole repo (it's large), snapshot just one leaf:
from huggingface_hub import snapshot_download
from transformers import AutoModelForCausalLM, AutoTokenizer
path = snapshot_download(
"pre-to-post-olmo/Math-Models",
allow_patterns="step20000/sft/*",
local_dir="Math-Models",
)
model = AutoModelForCausalLM.from_pretrained(f"{path}/step20000/sft")
tok = AutoTokenizer.from_pretrained(f"{path}/step20000/sft")
Generating a rollout
A generate.py at the repo root wraps the load + chat-template + decode:
python generate.py --model step20000/sft --prompt "What is 12 * 13?"
python generate.py --model step95368/rl/step3000 --prompt "..." --max-new-tokens 1024
pretrain/ and anneal/ are base LMs (no chat template); sft/ and rl/ are
chat-tuned and expect the chat template (applied automatically by generate.py).