Instructions to use allenai/Olmo-3-7B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/Olmo-3-7B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allenai/Olmo-3-7B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("allenai/Olmo-3-7B-Instruct") model = AutoModelForCausalLM.from_pretrained("allenai/Olmo-3-7B-Instruct", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use allenai/Olmo-3-7B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/Olmo-3-7B-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": "allenai/Olmo-3-7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/allenai/Olmo-3-7B-Instruct
- SGLang
How to use allenai/Olmo-3-7B-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 "allenai/Olmo-3-7B-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": "allenai/Olmo-3-7B-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 "allenai/Olmo-3-7B-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": "allenai/Olmo-3-7B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use allenai/Olmo-3-7B-Instruct with Docker Model Runner:
docker model run hf.co/allenai/Olmo-3-7B-Instruct
Commit History
-
Update the number of parameters (#13)
- Update the number of parameters (1b7232c573593db38c0e079bb681bfb038411e26) Co-authored-by: Mishig Davaadorj <[email protected]>6e5971d
-
Add OLMo 3 citation
Verified signature096bb54
-
Update inference examples to use the correct chat template (#7)
Verified signature- Update inference examples to use the correct chat template (67a6fd06f0081c8de1b922f85462878091c8a511) Co-authored-by: Mario Sanz <[email protected]>c34eee9
-
fix (#5)
Verified signature- fix (a0808e06ac19f4c4476148d13dbbf75f77af5f2a) Co-authored-by: xzuyn <[email protected]>51c1f0b
-
Update README.md
Verified signature84e56fc -
Update README.md
Verified signature37b7955 -
Upload olmo-instruct.png
Verified signaturecdf1ec0 -
Update README.md
Verified signature3497a82
-
Update README.md
Verified signature14975fe -
Update README.md
Verified signature7d4fa93 -
Update generation_config.json
Verified signature48683df -
Add `transformers` as the library name (#2)
Verified signature- Add `transformers` as the library name (9820b7611ce5e5809fbb46556dfae22b544e9a3f) Co-authored-by: Aritra Roy Gosthipaty <[email protected]>8b6b19f
-
Update README.md
Verified signature14a937e -
Update README.md
Verified signature5498984 -
Update README.md
Verified signaturee00f0d2 -
Update README.md
Verified signatured5287fe -
Update README.md
Verified signatureca644da -
Update README.md
Verified signature1280663 -
Update README.md
Verified signatured93ec82 -
Upload checkpoint from step 450
Verified signatured42dc9d
-
initial commit
Verified signature3b160f9