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 UniversalTransformerCache.get_mask_sizes for batched generation
Verified signature## Problem Batched generation (batch_size > 1) produces corrupted output for all sequences except the longest (unpadded) one in the batch. `UniversalTransformerCache` inherits `Cache.get_mask_sizes`, which falls back to `return cache_position.shape[0], 0` when `layer_idx >= len(self.layers)`. Since `UniversalTransformerCache` manages its own flat `key_cache`/`value_cache` lists and keeps `self.layers` empty (`[]`), this fallback **always** fires: - **Prefill**: works correctly (`cache_position` spans full input length) - **Autoregressive decoding**: **fails** — `cache_position` has length 1, so the 4D attention mask is built for `kv_length=1` instead of `cached_length + 1` This undersized mask gets broadcasted across the full KV cache, losing per-position padding information and corrupting every padded sequence in the batch. Manifests differently by attention implementation: - `"eager"`: garbled whitespace output - `"sdpa"`: `RuntimeError: (*bias): last dimension must be contiguo…9ff42b9
-
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