Text Generation
Transformers
Safetensors
ouro
looped-language-model
reasoning
recurrent-depth
conversational
custom_code
Instructions to use ByteDance/Ouro-2.6B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ByteDance/Ouro-2.6B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ByteDance/Ouro-2.6B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ByteDance/Ouro-2.6B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ByteDance/Ouro-2.6B 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ByteDance/Ouro-2.6B
- SGLang
How to use ByteDance/Ouro-2.6B 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" \ --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", "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" \ --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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ByteDance/Ouro-2.6B with Docker Model Runner:
docker model run hf.co/ByteDance/Ouro-2.6B
Commit History
-
Fix bos/eos token IDs (config.json + tokenizer_config.json)
Verified signature## Problem Both `bos_token` and `eos_token` are set to `<|endoftext|>` (id=0), but Ouro uses ChatML format where: - `bos_token` should be `<|im_start|>` (id=1) - `eos_token` should be `<|im_end|>` (id=2) This causes issues with: - Generation stopping: model never sees a proper EOS signal - Tokenizer `add_special_tokens`: wrong BOS is prepended - Downstream tools (vLLM, lm-eval-harness) that rely on `eos_token_id` for stop conditions ## Fix **config.json:** - `bos_token_id`: 0 → 1 - `eos_token_id`: 0 → 2 **tokenizer_config.json:** - `bos_token`: `<|endoftext|>` → `<|im_start|>` - `eos_token`: `<|endoftext|>` → `<|im_end|>` See also: same fix merged for the Thinking variant — https://huggingface.co/ByteDance/Ouro-1.4B-Thinking/discussions/44a0ea2c
-
Update config.json
Verified signature1ed0425
-
Update README.md
Verified signature514f6e4 -
Update modeling_ouro.py
Verified signature261e7c3
-
Improve model card: Add prominent paper and project links (#1)
Verified signature- Improve model card: Add prominent paper and project links (f8e38372d72a8aa7f4ea9f14b98739a311589088) Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>3d18014
-
Upload folder using huggingface_hub
Verified signature0782c16 -
Upload folder using huggingface_hub
Verified signatured60a3ab
-
Update README.md
Verified signatureedfc467 -
Upload folder using huggingface_hub
Verified signature2bb99c7 -
initial commit
Verified signaturedfc41fc