Instructions to use allenai/OLMo-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use allenai/OLMo-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="allenai/OLMo-7B", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("allenai/OLMo-7B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use allenai/OLMo-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "allenai/OLMo-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "allenai/OLMo-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/allenai/OLMo-7B
- SGLang
How to use allenai/OLMo-7B 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-7B" \ --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/OLMo-7B", "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/OLMo-7B" \ --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/OLMo-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use allenai/OLMo-7B with Docker Model Runner:
docker model run hf.co/allenai/OLMo-7B
Submit OLMo to the leaderboard
Please submit this model to the leaderboard https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard
Apparently it is not run automatically because it contains some custom executable code.
@clefourrier
I think the plan is to just add it fully into Huggingface transformers, and remove all the custom executable code. I assume at this point it would run get added automatically?
Hi!
We almost never run models which require trust_remote_code=True on our cluster for safety reasons - it might happen exceptionally, but then it means my co-maintainer or myself has to read the full code of the model + dependencies before running evaluations, and we don't have the bandwidth at the moment.
However, if the model becomes natively integrated into transformers, then it will become instantly submittable on the leaderboard :)
@clefourrier CohereForAI/c4ai-command-r-v01 is another example of a hyped model that currently is not (yet) evaluated in the dashboard.
Both are probably worth the effort of checking the "remote code" (or integrating it into transformers... vLLM seems to have merged OLMo support: https://github.com/vllm-project/vllm/pull/2832 ).
On lmsys.org OLMo currently ranks on the level of Mistral-7B-Instruct-v0.1 there, but my subjective impression was that OLMo is substantially worse.
Either way, both aren't the common case of yet-another-merge, but in both cases substantial effort went into the training, and hence their performance on the leaderboard is of much higher interest than the thousand LoRA overfitting models we see these days. Hence, I'd really like to see them included in the evaluation.
@dirkgr I did not see a pull request for OLMo in the transformers library yet. Why not? It would help promoting your model if it is easier to run.
Mate, we have lots of priorities, and getting OLMo into the transformers library is just one of them. We recently cleaned up the naming conventions we have in the training code to make that easier. Meanwhile, the entire stack is open source, and the HF version of the code is already in the OLMo repo. If you need this right now, you can make the PR today!
Hi @kno10 ,
We actually discussed with Cohere before the release, and since it's not a base pretrained model (it's a pretrained + SFT model), we followed our usual guidelines and did not evaluate it. We however explained how they could report numbers equivalent to the Open LLM Leaderboard's result, and as far as I know, the code is currently being integrated in transformers.
But I also agree with @dirkgr , that if you think things are missing, you should feel free to contribute! After all, that's also one of the cool things about open source :)
Closing this as done since we have integrated OLMo into the transformers library and it's on the leaderboard now.