Instructions to use allenai/olmicro-2.7b-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/olmicro-2.7b-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allenai/olmicro-2.7b-base", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("allenai/olmicro-2.7b-base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use allenai/olmicro-2.7b-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/olmicro-2.7b-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/olmicro-2.7b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/allenai/olmicro-2.7b-base
- SGLang
How to use allenai/olmicro-2.7b-base 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 "allenai/olmicro-2.7b-base" \ --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": "allenai/olmicro-2.7b-base", "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 "allenai/olmicro-2.7b-base" \ --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": "allenai/olmicro-2.7b-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use allenai/olmicro-2.7b-base with Docker Model Runner:
docker model run hf.co/allenai/olmicro-2.7b-base
Olmicro 2.7B Base
Olmicro is a fully open, controlled suite of five base language models from Ai2, from 275M to 2.7B parameters, built as a modern, accessible testbed for language modeling research. All five share one architecture, one data mix and one recipe. The architecture is a hybrid that interleaves Gated DeltaNet and full-attention layers at a 4:1 ratio, with no positional encoding. Each model is pretrained on 2,000 tokens per non-embedding parameter, about 100 times the Chinchilla-optimal count, and then trained on a further 100B tokens of mid-training and 100B tokens of long-context extension to 64k tokens. Across sizes, Olmicro performs competitively with similarly sized open models while using less training compute than most of them. Every model comes with intermediate checkpoints from all of training, both as Hugging Face weights and as Olmo-core checkpoints with optimizer state, along with the code to reproduce pretraining.
This repository houses Olmicro 2.7B Base, the largest model in the suite, with the final model on main and every intermediate checkpoint from pretraining, mid-training and long-context extension as a branch.
Paper · Code · Collection · Training checkpoints · Evaluations
Models
Architecture
All five sizes have a head dimension of 128 and a context length of 65,536 tokens.
| 275M | 450M | 810M | 1.4B | 2.7B | |
|---|---|---|---|---|---|
| Layers (Gated DeltaNet + attention) | 10 (8 + 2) | 15 (12 + 3) | 15 (12 + 3) | 20 (16 + 4) | 30 (24 + 6) |
| Hidden size | 640 | 768 | 1,024 | 1,280 | 1,536 |
| Query / key-value heads | 8 / 8 | 8 / 8 | 16 / 8 | 16 / 8 | 16 / 8 |
| Feed-forward hidden size | 5,120 | 6,144 | 8,192 | 10,240 | 12,288 |
Size and cost
| 275M | 450M | 810M | 1.4B | 2.7B | |
|---|---|---|---|---|---|
| Parameters | 275.5M | 454.2M | 810.4M | 1.42B | 2.69B |
| Non-embedding parameters | 211.3M | 377.1M | 707.6M | 1.29B | 2.53B |
| KV cache per token (16-bit) | 8 KiB | 12 KiB | 12 KiB | 16 KiB | 24 KiB |
| Training tokens, all stages | 623B | 954B | 1.62T | 2.79T | 5.27T |
| Training compute (6ND, FLOPs) | 7.9 × 1020 | 2.2 × 1021 | 6.9 × 1021 | 2.2 × 1022 | 8.0 × 1022 |
Training
| Stage | Data | Tokens | Sequence length |
|---|---|---|---|
| Pretraining | Dolma 3 | 5.07T | 8,192 |
| Midtraining | Dolma 3 Dolmino | 100B | 8,192 |
| Long-context extension | Dolma 3 Longmino | 100B | 65,536 |
Usage
pip install "torch==2.11.0" "transformers>=5.12,<5.16" "flash-linear-attention==0.5.2"
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "allenai/olmicro-2.7b-base"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.bfloat16).to("cuda")
inputs = tok("The capital of France is", return_tensors="pt").to("cuda")
print(tok.decode(model.generate(**inputs, max_new_tokens=20)[0]))
flash-linear-attention provides the fast Gated DeltaNet kernels; without it, the model falls back to a much
slower PyTorch path. For vLLM, and to load the model without trust_remote_code, install the Olmicro plugins
from the code repository.
Checkpoints
main is the final model (stage3-step0023842). The 638 intermediate checkpoints are branches named
stage<k>-step<NNNNNNN>; load one with revision=, e.g. revision="stage1-step0303000".
| Stage | Branches | Steps |
|---|---|---|
| 1, pretraining | 606 | 0 to 604,266 |
| 2, midtraining | 12 | 1,000 to 11,921 |
| 3, long-context extension | 20 | 4,000 to 23,842 |
The full training state of every checkpoint (weights, optimizer and data-loader state), for resuming training, is in the bucket allenai/olmicro-2.7b-base. See the code repository to resume training.
Safety evaluation
Safety evaluations of the final model (main) of each size, on a subset of the Olmo 3 safety suite. Every
score is 0 to 100, and higher is better. BBQ measures social bias; Do-Anything-Now, HarmBench, StrongReject,
WildJailbreak (harmful) and WildGuard measure refusal of harmful requests; WildJailbreak (benign) and XSTest
also reward answering safe prompts, so they penalize over-refusal; WMDP is 100 minus the accuracy on questions
about hazardous knowledge. These are base models with no safety tuning, so the scores are a baseline for later
safety work rather than a sign that the models are safe to deploy. See the paper for the setup and
for comparisons with other open models.
| Benchmark | 275M | 450M | 810M | 1.4B | 2.7B |
|---|---|---|---|---|---|
| BBQ | 35.4 | 43.2 | 35.2 | 41.0 | 47.1 |
| Do-Anything-Now | 30.7 | 34.0 | 34.0 | 23.0 | 27.3 |
| HarmBench | 29.7 | 32.8 | 28.7 | 26.9 | 22.8 |
| StrongReject | 95.6 | 93.2 | 91.3 | 87.0 | 81.7 |
| WildJailbreak, harmful | 9.9 | 7.7 | 5.9 | 4.1 | 3.7 |
| WildJailbreak, benign | 83.2 | 89.6 | 90.4 | 93.6 | 96.0 |
| WildGuard | 38.5 | 40.1 | 43.4 | 45.8 | 42.1 |
| XSTest | 47.6 | 44.2 | 56.9 | 56.2 | 55.3 |
| WMDP | 61.6 | 56.2 | 50.2 | 49.3 | 42.4 |
Limitations
Olmicro models are base models: they are not instruction-tuned or safety-tuned, and can produce incorrect, biased or harmful text. The training data is mostly 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.
Citation
@techreport{samaga2026olmicro,
title = {{Olmicro}: Scaling Down to Accelerate the Science of Language Models},
author = {Yashas Samaga and Saumya Malik and Malia Morgan and Jacob Morrison and Tyler Murray and Michael Noukhovitch and Jackson Petty and Noah A. Smith and William Merrill},
institution = {Allen Institute for AI},
year = {2026},
month = nov,
url = {https://allenai.org/papers/olmicro}
}
- Downloads last month
- 2,481