Instructions to use allenai/Olmo-3-32B-Think with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/Olmo-3-32B-Think with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allenai/Olmo-3-32B-Think") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("allenai/Olmo-3-32B-Think") model = AutoModelForCausalLM.from_pretrained("allenai/Olmo-3-32B-Think") 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 Settings
- vLLM
How to use allenai/Olmo-3-32B-Think with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/Olmo-3-32B-Think" # 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-32B-Think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/allenai/Olmo-3-32B-Think
- SGLang
How to use allenai/Olmo-3-32B-Think 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-32B-Think" \ --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-32B-Think", "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-32B-Think" \ --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-32B-Think", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use allenai/Olmo-3-32B-Think with Docker Model Runner:
docker model run hf.co/allenai/Olmo-3-32B-Think
chat template: strip out `assistant\n`?
Hey guys, I don't know if what I did is right, but I needed to get rid of the assistant\n prefix for each responses.
Despite being a minimal change, just adding .lstrip("assistant\n"), I have no idea if this is a good solution. Adapting those jinja templates drive me mad every single time, so the less I deal with them the better I feel lol.
In all case, thanks for offering the fruit of your work to the community! The fully open model gap has finally been filled π And I'm thrilled to try it out now :)
Hey! There is a an argument to apply_chat_template called add_generation_prompt. if you set add_generation_prompt=False it will not append "assistant\n" to each set of messages.
https://huggingface.co/docs/transformers/en/chat_templating#using-applychattemplate
It works based on this conditional in the template:
...
' }}{% endif %}{% if loop.last and add_generation_prompt %}{{ '<|im_start|>assistant
<think>' }}{% endif %}{% endfor %}
Thanks for your answer!
I read the doc part you pointed to, and I know get the purpose of add_generation_prompt. But I'm still confused...
So, I understand that the purpose of add_generation_prompt is to prepend the next generation with the right token so that the model "knows" it's its turn, to prevent it from continuing the user message instead of answering.
And from what I understand, in your case you are using the add_generation_prompt conditionnal to prepend the model generation with <|im_start|>assistant\n<think> when true instead of <|im_start|>assistant\n when false.
And so I'm confused because this conditionnal seems to only control if <think> is added or not, but the assistant\n part seems to always be there.
I forgot to mention I'm serving your model quantized through llama.cpp. add_generation_prompt is set client side when sending the request, with "chat_template_kwargs": {"add_generation_prompt": true/false}.
But this is where my brain just crashes, here is what I get:
- with
"add_generation_prompt": true, the model generation starts with<|im_start|>and I directly see its CoT without any<think>orassistant\n - with
"add_generation_prompt": false, the model generation starts with<|im_start|>assistant\n<think>then its CoT
In other words, I never get the behavior I want (starting by <|im_start|><think>).
And when I try to force the add_generation_prompt behavior, removing assistant\n like so:
{%- if loop.last and add_generation_prompt -%}
{{- "<|im_start|><think>" -}}
Then, with "add_generation_prompt": true, same as before: the model generation starts with <|im_start|> and I directly see its CoT without any <think> or assistant\n.
I don't know what's going on I'm so lost with those templates logic every single time. And that's hard to figure out what I don't understand wrong using help from LMs because feeding them with such templates often interfere with their own template thats ironic and frustrating :D That's really one of the rare cases you can't get help from them!
Again, thanks for your answer already, and don't worry if you don't feel like pursuing with my case lol one day I'll figure this out!