Instructions to use open-thoughts/OpenThinker3-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use open-thoughts/OpenThinker3-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="open-thoughts/OpenThinker3-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("open-thoughts/OpenThinker3-7B") model = AutoModelForCausalLM.from_pretrained("open-thoughts/OpenThinker3-7B") 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use open-thoughts/OpenThinker3-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "open-thoughts/OpenThinker3-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "open-thoughts/OpenThinker3-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/open-thoughts/OpenThinker3-7B
- SGLang
How to use open-thoughts/OpenThinker3-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 "open-thoughts/OpenThinker3-7B" \ --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": "open-thoughts/OpenThinker3-7B", "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 "open-thoughts/OpenThinker3-7B" \ --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": "open-thoughts/OpenThinker3-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use open-thoughts/OpenThinker3-7B with Docker Model Runner:
docker model run hf.co/open-thoughts/OpenThinker3-7B
Discrepancy for the LCB score in your paper?
Hello again guys!
I was just reading back through your paper, and right at the beginning I was confused by a difference between what we read in your abstract and the results in the table at page 2.
It's about the LCB evaluation results:
- abstract and the accuracy chart says and shows up a 51 pts
- while table in page 2 states a whopping 64.5 pts
I guess the correct results are the ones stated in the abstract, as you also present it right here in the model card, but wanted to be sure and inform you about this.
Could you confirm it's indeed 51?
Would the 64.5 be instead the result for a checkpoint of the upcoming 32B model? :)
For LCB, there are different versions based on the update date. We report 2 versions, one from 05/23-05/24 (LCBv2) and one from 06/24 to 01/25 (LCB v5 minus LCB v2). If you check the table on page 2, there is an LCB under the “code” rows and another LCB under the “held out” rows.
In the abstract, the 51 we report is our generalization held-out set which is LCBv5-minus-LCBv2. You can also find this 51 number at the bottom of the table in page 2. The 64.5 you mentioned is the score on LCBv2 which is we used as part of our validation set.
Oh yes! My bad I didn't see the 2 separate rows in the page 2 table... Sorry! Thanks for your answer.