Instructions to use ByteDance/Ouro-2.6B-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ByteDance/Ouro-2.6B-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ByteDance/Ouro-2.6B-Thinking", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ByteDance/Ouro-2.6B-Thinking", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ByteDance/Ouro-2.6B-Thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ByteDance/Ouro-2.6B-Thinking" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ByteDance/Ouro-2.6B-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ByteDance/Ouro-2.6B-Thinking
- SGLang
How to use ByteDance/Ouro-2.6B-Thinking 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 "ByteDance/Ouro-2.6B-Thinking" \ --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": "ByteDance/Ouro-2.6B-Thinking", "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 "ByteDance/Ouro-2.6B-Thinking" \ --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": "ByteDance/Ouro-2.6B-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ByteDance/Ouro-2.6B-Thinking with Docker Model Runner:
docker model run hf.co/ByteDance/Ouro-2.6B-Thinking
Exit gates usage at inference timeHow does the exit gate reduce inference compute?
I read the paper and inspected the provided inference code, but I could not determine how the exit gate currently reduces actual inference compute or latency.
As far as I understand, the implementation computes all four recurrent steps for every generated token and only afterward selects the hidden state/logits corresponding to the predicted exit step. In that case, the gate performs predictive early exit, but not computational early exit: all four loops have already been executed.
True token-wise early stopping also appears to create a KV-cache issue. For example, if token n exits after loop 2 but token n+1 continues to loop 4, then loop-4 attention for token n+1 requires loop-4 keys and values for token n, which were never computed.
There are several possible approaches to this problem. For example, Confident Adaptive Language Modeling discusses early exit in autoregressive Transformers:
https://arxiv.org/pdf/2207.07061
Could you clarify the intended inference procedure?
In particular:
- Is there a separate implementation that actually stops computation once the exit threshold is reached?
- If different tokens exit at different recurrent steps, how are the missing deeper-loop KV-cache entries handled?
It would be very helpful if you could provide the exact inference algorithm or point to the relevant implementation.