Text Generation
Transformers
Safetensors
GGUF
llama
looped-language-model
reasoning
recurrent-depth
thinking
chain-of-thought
conversational
custom_code
text-generation-inference
Instructions to use scpalmetto/Ouro-2.6B-Thinking-Fixed with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use scpalmetto/Ouro-2.6B-Thinking-Fixed with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="scpalmetto/Ouro-2.6B-Thinking-Fixed", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("scpalmetto/Ouro-2.6B-Thinking-Fixed", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("scpalmetto/Ouro-2.6B-Thinking-Fixed", trust_remote_code=True, device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use scpalmetto/Ouro-2.6B-Thinking-Fixed with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M # Run inference directly in the terminal: llama cli -hf scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M # Run inference directly in the terminal: llama cli -hf scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
Use Docker
docker model run hf.co/scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use scpalmetto/Ouro-2.6B-Thinking-Fixed with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "scpalmetto/Ouro-2.6B-Thinking-Fixed" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "scpalmetto/Ouro-2.6B-Thinking-Fixed", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
- SGLang
How to use scpalmetto/Ouro-2.6B-Thinking-Fixed 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 "scpalmetto/Ouro-2.6B-Thinking-Fixed" \ --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": "scpalmetto/Ouro-2.6B-Thinking-Fixed", "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 "scpalmetto/Ouro-2.6B-Thinking-Fixed" \ --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": "scpalmetto/Ouro-2.6B-Thinking-Fixed", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use scpalmetto/Ouro-2.6B-Thinking-Fixed with Ollama:
ollama run hf.co/scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use scpalmetto/Ouro-2.6B-Thinking-Fixed with Docker Model Runner:
docker model run hf.co/scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
- Lemonade
How to use scpalmetto/Ouro-2.6B-Thinking-Fixed with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull scpalmetto/Ouro-2.6B-Thinking-Fixed:Q4_K_M
Run and chat with the model
lemonade run user.Ouro-2.6B-Thinking-Fixed-Q4_K_M
List all available models
lemonade list
- Atomic Chat
|
Download README.md from scpalmetto/Ouro-2.6B-Thinking-Fixed: direct link, hf CLI and curl.
- Browser
- Download file 5.01 kB
-
https://huggingface.co/scpalmetto/Ouro-2.6B-Thinking-Fixed/resolve/main/README.md
- Command line
-
hf download hf://scpalmetto/Ouro-2.6B-Thinking-Fixed/README.md
-
curl -L -o README.md https://huggingface.co/scpalmetto/Ouro-2.6B-Thinking-Fixed/resolve/main/README.md
5.01 kB
| library_name: transformers | |
| license: apache-2.0 | |
| pipeline_tag: text-generation | |
| tags: | |
| - looped-language-model | |
| - reasoning | |
| - recurrent-depth | |
| - thinking | |
| - chain-of-thought | |
| # Ouro-2.6B-Thinking | |
|  | |
| ## Model Description | |
| **⚠️ IMPORTANT: This model is intended for research purposes only. It is provided as-is without warranties for production use. ** | |
| **Ouro-2.6B-Thinking** is a reasoning-specialized variant of the Ouro-2.6B base model, enhanced through supervised fine-tuning on high-quality reasoning data. Please use ``transformers==4.54.1``for compatibility. | |
|  | |
| ## Key Features | |
| - **Advanced Reasoning**: Specifically optimized for mathematical and scientific reasoning tasks | |
| - **Compact Size**: Competitive with 4B models despite having only 2.6B parameters | |
| - **Cross-Step Consistency**: Intermediate recurrent outputs can serve as reliable proxies for final answers | |
| - **Explicit Thinking Process**: Trained to generate detailed reasoning steps | |
| ## Configuration | |
| ### Recurrent Steps and Adaptive Exit | |
| The model's computational behavior can be configured through the `config.json` file: | |
| ```json | |
| { | |
| "total_ut_steps": 4, | |
| "early_exit_threshold": 1.0 | |
| } | |
| ``` | |
| - **`total_ut_steps`**: Controls the number of recurrent steps (default: 4). You can adjust this value to trade off between performance and computation time. | |
| - **`early_exit_threshold`**: Controls the adaptive exit mechanism (default: 1.0). Lower values encourage earlier exit, while 1.0 means always use all steps. | |
| **Example: Modify recurrent steps** | |
| ```python | |
| from transformers import AutoConfig, AutoModelForCausalLM | |
| config = AutoConfig.from_pretrained("ByteDance/Ouro-2.6B-Thinking") | |
| config.total_ut_steps = 3 # Use 3 recurrent steps instead of 4 | |
| model = AutoModelForCausalLM.from_pretrained( | |
| "ByteDance/Ouro-2.6B-Thinking", | |
| config=config, | |
| device_map="auto" | |
| ) | |
| ``` | |
| > **Note**: vLLM does not currently support the adaptive exit feature due to its inference optimization characteristics. When using vLLM, the model will always execute the full number of `total_ut_steps`. | |
| ## Model Architecture | |
| Based on Ouro-2.6B with additional reasoning fine-tuning: | |
| | Configuration | Value | | |
| |:---|:---| | |
| | **Parameters** | 2.6B | | |
| | **Layers** | 24 | | |
| | **Recurrent Steps** | 4 | | |
| | **Hidden Size** | 2048 | | |
| | **Attention Heads** | Multi-Head Attention (MHA) | | |
| | **FFN Activation** | SwiGLU | | |
| | **Position Embedding** | RoPE | | |
| | **Vocabulary Size** | 49,152 | | |
| | **Context Length** | 32K (SFT) | | |
| | **Normalization** | Sandwich RMSNorm | | |
| ## Training Details | |
| ### Pre-training | |
| - **Training Tokens**: 7.7T tokens across 4 stages | |
| - **Base Architecture**: Ouro-2.6B | |
| ### Supervised Fine-Tuning | |
| - **Data Size**: ~8.3M examples | |
| - **Data Composition**: | |
| - Mathematics: 3.5M examples (OpenThoughts3, AceReason-1.1-SFT) | |
| - Code: 3.2M examples (AceReason, OpenCodeReasoning, Llama-Nemotron, OpenThoughts3) | |
| - Science: 808K examples (OpenThoughts3, Llama-Nemotron) | |
| - Chat: 767K examples (DeepWriting-20K) | |
| - **Training**: 2 epochs, max sequence length 32K | |
| - **Optimizer**: Adam (lr=2×10⁻⁵, β=(0.9, 0.95)) | |
| - **Scheduler**: Cosine decay | |
| ## Quick Start | |
| **⚠️ IMPORTANT**: Please use `transformers<4.56.0` to avoid compatibility issues. We recommend `transformers==4.54.1` or earlier versions. | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_name = "Bytedance/Ouro-2.6B-Thinking" | |
| tokenizer = AutoTokenizer.from_pretrained(model_name) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| model_name, | |
| device_map="auto", | |
| torch_dtype="auto" | |
| ) | |
| # Generate with reasoning | |
| messages = [ | |
| {"role": "user", "content": "Solve: If 2x + 3 = 11, what is x?"} | |
| ] | |
| inputs = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=True, | |
| add_generation_prompt=True, | |
| return_tensors="pt" | |
| ).to(model.device) | |
| outputs = model.generate(inputs, max_new_tokens=512, temperature=1.0, top_p=0.7) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) | |
| ``` | |
| ## Acknowledgments | |
| We thank [@Antizana](https://github.com/Antizana) for the KV cache fix merged from [ouro-cache-fix](https://github.com/Antizana/ouro-cache-fix), which resolved a critical compatibility issue with transformers>=4.56.0. | |
| ## Citation | |
| ```bibtex | |
| @article{zhu2025scaling, | |
| title={Scaling Latent Reasoning via Looped Language Models}, | |
| author={Zhu, Rui-Jie and Wang, Zixuan and Hua, Kai and Zhang, Tianyu and Li, Ziniu and Que, Haoran and Wei, Boyi and Wen, Zixin and Yin, Fan and Xing, He and others}, | |
| journal={arXiv preprint arXiv:2510.25741}, | |
| year={2025} | |
| } | |
| ## License | |
| This model is licensed under Apache-2.0. See the LICENSE file for details. | |
| ## Project Links | |
| - **Paper**: [Scaling Latent Reasoning via Looped Language Models](https://huggingface.co/papers/2510.25741) | |
| - **Project Page**: [https://ouro-llm.github.io](https://ouro-llm.github.io) | |
| - **Code**: [https://github.com/ByteDance/Ouro](https://github.com/ByteDance/Ouro) | |
| --- |