Instructions to use ornith-ai/Ornith-1.5-35B-A3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ornith-ai/Ornith-1.5-35B-A3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ornith-ai/Ornith-1.5-35B-A3B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ornith-ai/Ornith-1.5-35B-A3B") model = AutoModelForMultimodalLM.from_pretrained("ornith-ai/Ornith-1.5-35B-A3B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ornith-ai/Ornith-1.5-35B-A3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ornith-ai/Ornith-1.5-35B-A3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ornith-ai/Ornith-1.5-35B-A3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ornith-ai/Ornith-1.5-35B-A3B
- SGLang
How to use ornith-ai/Ornith-1.5-35B-A3B 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 "ornith-ai/Ornith-1.5-35B-A3B" \ --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": "ornith-ai/Ornith-1.5-35B-A3B", "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 "ornith-ai/Ornith-1.5-35B-A3B" \ --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": "ornith-ai/Ornith-1.5-35B-A3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ornith-ai/Ornith-1.5-35B-A3B with Docker Model Runner:
docker model run hf.co/ornith-ai/Ornith-1.5-35B-A3B
Update README.md
Browse files
README.md
CHANGED
|
@@ -225,7 +225,11 @@ This model card documents **Ornith-1.5-35B-A3B**, the mid-size mixture-of-expert
|
|
| 225 |
<li><b>vLLM</b> ≥ 0.19.1</li>
|
| 226 |
<li><b>SGLang</b> ≥ 0.5.9</li>
|
| 227 |
</ul>
|
| 228 |
-
<p style="margin:0">Recommended sampling parameters:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 229 |
</div>
|
| 230 |
|
| 231 |
|
|
@@ -262,58 +266,42 @@ python -m sglang.launch_server \
|
|
| 262 |
--reasoning-parser qwen3
|
| 263 |
```
|
| 264 |
|
| 265 |
-
####
|
| 266 |
|
| 267 |
-
|
| 268 |
|
| 269 |
-
|
| 270 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 271 |
|
| 272 |
-
|
| 273 |
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
|
|
|
|
|
|
|
|
|
| 280 |
|
| 281 |
-
|
| 282 |
-
{"role": "user", "content": "Write a Python function is_prime(n). Keep it short."}
|
| 283 |
-
]
|
| 284 |
-
text = tokenizer.apply_chat_template(
|
| 285 |
-
messages,
|
| 286 |
-
tokenize=False,
|
| 287 |
-
add_generation_prompt=True,
|
| 288 |
-
)
|
| 289 |
|
| 290 |
-
|
| 291 |
-
generated = model.generate(
|
| 292 |
-
**inputs,
|
| 293 |
-
max_new_tokens=512,
|
| 294 |
-
do_sample=True,
|
| 295 |
-
temperature=0.6,
|
| 296 |
-
top_p=0.95,
|
| 297 |
-
top_k=20,
|
| 298 |
-
)
|
| 299 |
-
output_ids = generated[0][inputs.input_ids.shape[1]:]
|
| 300 |
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
```
|
| 305 |
|
| 306 |
-
|
| 307 |
|
| 308 |
-
```
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
```
|
| 317 |
|
| 318 |
### Using Ornith-1.5-35B-A3B via the Chat Completions API
|
| 319 |
|
|
@@ -381,51 +369,29 @@ You can point any OpenAI-compatible SDK (Python, Node.js, etc.) or `curl` at the
|
|
| 381 |
|
| 382 |
## Agentic Usage
|
| 383 |
|
| 384 |
-
Ornith-1.5-35B-A3B excels in tool-calling and agentic coding
|
| 385 |
|
| 386 |
-
|
| 387 |
|
| 388 |
-
Because Ornith-1.5-35B-A3B exposes an OpenAI-compatible endpoint with tool calling, it works out of the box with standard agent frameworks. Below is a minimal example that connects Ornith-1.5-35B-A3B to tools through an MCP server.
|
| 389 |
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
client = OpenAI(
|
| 395 |
-
base_url=os.getenv("OPENAI_BASE_URL", "http://localhost:8000/v1"),
|
| 396 |
-
api_key=os.getenv("OPENAI_API_KEY", "EMPTY"),
|
| 397 |
-
)
|
| 398 |
-
|
| 399 |
-
tools = [
|
| 400 |
-
{
|
| 401 |
-
"type": "function",
|
| 402 |
-
"function": {
|
| 403 |
-
"name": "run_shell",
|
| 404 |
-
"description": "Run a shell command and return its output.",
|
| 405 |
-
"parameters": {
|
| 406 |
-
"type": "object",
|
| 407 |
-
"properties": {
|
| 408 |
-
"command": {"type": "string", "description": "The command to run"}
|
| 409 |
-
},
|
| 410 |
-
"required": ["command"],
|
| 411 |
-
},
|
| 412 |
-
},
|
| 413 |
-
}
|
| 414 |
-
]
|
| 415 |
|
| 416 |
-
messages = [{"role": "user", "content": "List the Python files in the current directory."}]
|
| 417 |
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
top_p=0.95,
|
| 424 |
-
)
|
| 425 |
-
print(response.choices[0].message)
|
| 426 |
```
|
| 427 |
|
| 428 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 429 |
|
| 430 |
#### Hermes Agent
|
| 431 |
```bash
|
|
@@ -435,18 +401,6 @@ export OPENAI_API_KEY="EMPTY"
|
|
| 435 |
export MODEL="ornith-ai/Ornith-1.5-35B-A3B"
|
| 436 |
```
|
| 437 |
|
| 438 |
-
|
| 439 |
-
#### Atomic.chat / Ollama / llama.cpp
|
| 440 |
-
```bash
|
| 441 |
-
# Both runtimes load a GGUF build of Ornith (publish one at ornith-ai/Ornith-1.5-35B-A3B-GGUF).
|
| 442 |
-
|
| 443 |
-
# llama.cpp — serve an OpenAI-compatible API on port 8000.
|
| 444 |
-
llama-server -hf ornith-ai/Ornith-1.5-35B-A3B-GGUF --port 8000 -c 262144
|
| 445 |
-
|
| 446 |
-
# Ollama — pull and chat with the same GGUF straight from Hugging Face.
|
| 447 |
-
ollama run hf.co/ornith-ai/Ornith-1.5-35B-A3B-GGUF
|
| 448 |
-
```
|
| 449 |
-
|
| 450 |
#### OpenClaw
|
| 451 |
|
| 452 |
```bash
|
|
@@ -470,18 +424,6 @@ pip install unsloth
|
|
| 470 |
# )
|
| 471 |
```
|
| 472 |
|
| 473 |
-
#### OpenHands
|
| 474 |
-
```bash
|
| 475 |
-
pip install openhands-ai
|
| 476 |
-
|
| 477 |
-
# OpenHands routes through LiteLLM; the "openai/" prefix selects the OpenAI-compatible path.
|
| 478 |
-
export LLM_MODEL="openai/ornith-ai/Ornith-1.5-35B-A3B"
|
| 479 |
-
export LLM_BASE_URL="http://localhost:8000/v1"
|
| 480 |
-
export LLM_API_KEY="EMPTY"
|
| 481 |
-
|
| 482 |
-
# Launch the CLI (or run the official OpenHands Docker image with the same env vars).
|
| 483 |
-
openhands
|
| 484 |
-
```
|
| 485 |
|
| 486 |
### Coding CLIs
|
| 487 |
|
|
|
|
| 225 |
<li><b>vLLM</b> ≥ 0.19.1</li>
|
| 226 |
<li><b>SGLang</b> ≥ 0.5.9</li>
|
| 227 |
</ul>
|
| 228 |
+
<p style="margin:0 0 6px">Recommended sampling parameters:</p>
|
| 229 |
+
<ul style="margin:0;padding-left:20px">
|
| 230 |
+
<li><b>For general tasks:</b> <code style="background:rgba(253,142,91,0.15);padding:1px 5px;border-radius:4px">temperature=0.6</code>, <code style="background:rgba(253,142,91,0.15);padding:1px 5px;border-radius:4px">top_p=0.95</code>, <code style="background:rgba(253,142,91,0.15);padding:1px 5px;border-radius:4px">top_k=20</code></li>
|
| 231 |
+
<li><b>To reproduce the reported benchmarks:</b> <code style="background:rgba(253,142,91,0.15);padding:1px 5px;border-radius:4px">temperature=1.0</code></li>
|
| 232 |
+
</ul>
|
| 233 |
</div>
|
| 234 |
|
| 235 |
|
|
|
|
| 266 |
--reasoning-parser qwen3
|
| 267 |
```
|
| 268 |
|
| 269 |
+
#### For Long-Context
|
| 270 |
|
| 271 |
+
Ornith-1.5-35B-A3B handles context windows of up to 262,144 tokens. When a task's combined input and output must go beyond this limit, we suggest extending the effective window with RoPE scaling — YaRN is the technique we validate against, and it is already built into both vLLM and SGLang. With a scaling factor of 4.0, the usable window grows to roughly 1M tokens.
|
| 272 |
|
| 273 |
+
You can turn YaRN on in either of two ways:
|
|
|
|
| 274 |
|
| 275 |
+
- **Edit the checkpoint's `config.json`.** Add a `rope_scaling` block to the model configuration:
|
| 276 |
|
| 277 |
+
```json
|
| 278 |
+
{
|
| 279 |
+
"rope_scaling": {
|
| 280 |
+
"rope_type": "yarn",
|
| 281 |
+
"factor": 4.0,
|
| 282 |
+
"original_max_position_embeddings": 262144
|
| 283 |
+
}
|
| 284 |
+
}
|
| 285 |
+
```
|
| 286 |
|
| 287 |
+
- **Override at launch time.** Leave the checkpoint untouched and extend the serve commands above with the equivalent flags.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 288 |
|
| 289 |
+
vLLM:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
|
| 291 |
+
```bash
|
| 292 |
+
VLLM_ALLOW_LONG_MAX_MODEL_LEN=1 vllm serve ornith-ai/Ornith-1.5-35B-A3B ... --hf-overrides '{"rope_scaling": {"rope_type": "yarn", "factor": 4.0, "original_max_position_embeddings": 262144}}' --max-model-len 1000000
|
| 293 |
+
```
|
|
|
|
| 294 |
|
| 295 |
+
SGLang:
|
| 296 |
|
| 297 |
+
```bash
|
| 298 |
+
SGLANG_ALLOW_OVERWRITE_LONGER_CONTEXT_LEN=1 python -m sglang.launch_server ... --json-model-override-args '{"rope_scaling": {"rope_type": "yarn", "factor": 4.0, "original_max_position_embeddings": 262144}}' --context-length 1000000
|
| 299 |
+
```
|
| 300 |
+
|
| 301 |
+
<div style="border-left:4px solid #FD8E5B;background:rgba(253,142,91,0.1);border-radius:6px;padding:12px 16px;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;font-size:14px;line-height:1.6">
|
| 302 |
+
<div style="font-weight:700;color:#FD8E5B;margin-bottom:6px">📝 NOTE</div>
|
| 303 |
+
<p style="margin:0">Open-source runtimes implement YaRN <i>statically</i>: the same scaling factor is applied to every request regardless of its length, which can slightly hurt quality on ordinary-length inputs. Only enable <code style="background:rgba(253,142,91,0.15);padding:1px 5px;border-radius:4px">rope_scaling</code> when your workload genuinely needs the longer window, and size <code style="background:rgba(253,142,91,0.15);padding:1px 5px;border-radius:4px">factor</code> to match it — the target window is roughly <code style="background:rgba(253,142,91,0.15);padding:1px 5px;border-radius:4px">factor</code> × 262,144, so if your requests top out around 524,288 tokens, <code style="background:rgba(253,142,91,0.15);padding:1px 5px;border-radius:4px">factor: 2.0</code> is the better setting.</p>
|
| 304 |
+
</div>
|
|
|
|
| 305 |
|
| 306 |
### Using Ornith-1.5-35B-A3B via the Chat Completions API
|
| 307 |
|
|
|
|
| 369 |
|
| 370 |
## Agentic Usage
|
| 371 |
|
| 372 |
+
Ornith-1.5-35B-A3B excels in tool-calling and agentic coding. It exposes an OpenAI-compatible endpoint with tool calling and works out of the box with standard agent frameworks.
|
| 373 |
|
| 374 |
+
**Examples of using Ornith with agents:**
|
| 375 |
|
|
|
|
| 376 |
|
| 377 |
+
#### Ollama
|
| 378 |
+
```bash
|
| 379 |
+
ollama run hf.co/ornith-ai/Ornith-1.5-35B-A3B-GGUF
|
| 380 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 381 |
|
|
|
|
| 382 |
|
| 383 |
+
#### Atomic.chat
|
| 384 |
+
```bash
|
| 385 |
+
# Atomic.chat loads a GGUF build of Ornith (ornith-ai/Ornith-1.5-35B-A3B-GGUF)
|
| 386 |
+
# through llama.cpp's OpenAI-compatible API on port 8000.
|
| 387 |
+
llama-server -hf ornith-ai/Ornith-1.5-35B-A3B-GGUF --port 8000 -c 262144
|
|
|
|
|
|
|
|
|
|
| 388 |
```
|
| 389 |
|
| 390 |
+
#### llama.cpp
|
| 391 |
+
```bash
|
| 392 |
+
# llama.cpp — serve an OpenAI-compatible API on port 8000.
|
| 393 |
+
llama-server -hf ornith-ai/Ornith-1.5-35B-A3B-GGUF --port 8000 -c 262144
|
| 394 |
+
```
|
| 395 |
|
| 396 |
#### Hermes Agent
|
| 397 |
```bash
|
|
|
|
| 401 |
export MODEL="ornith-ai/Ornith-1.5-35B-A3B"
|
| 402 |
```
|
| 403 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
#### OpenClaw
|
| 405 |
|
| 406 |
```bash
|
|
|
|
| 424 |
# )
|
| 425 |
```
|
| 426 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
|
| 428 |
### Coding CLIs
|
| 429 |
|