Instructions to use switchboardllm/switchboard-router-0.5b-ONNX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use switchboardllm/switchboard-router-0.5b-ONNX with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'switchboardllm/switchboard-router-0.5b-ONNX');
switchboard-router-0.5b-ONNX
The browser build of Switchboard v0.1 (switchboardllm/switchboard-router-0.5b), for Transformers.js. It runs on the visitor's device with WebGPU or WebAssembly, so prompts never leave the browser.
Use it
import { AutoModelForCausalLM, AutoTokenizer } from "@huggingface/transformers"; // 4.2.0 or later
const repo = "switchboardllm/switchboard-router-0.5b-ONNX";
const tokenizer = await AutoTokenizer.from_pretrained(repo);
const model = await AutoModelForCausalLM.from_pretrained(repo, { dtype: "q8", device: "webgpu" });
const inputs = tokenizer.apply_chat_template(
[{ role: "user", content: "Write a haiku about rain" }],
{ add_generation_prompt: true, return_dict: true },
);
const out = await model.generate({ ...inputs, max_new_tokens: 24, do_sample: false });
const text = tokenizer.batch_decode(out.slice(null, [inputs.input_ids.dims[1], null]), { skip_special_tokens: true })[0];
console.log(JSON.parse(text)); // { tier: "small", domain: "writing" }
Transformers.js 3.x can't run this file. Use 4.2.0 or later.
The file
| File | onnx/model_quantized.onnx, 660 MB |
| Quantization | 8-bit asymmetric weights (block size 32) for every linear layer, 4-bit embedding table |
| Speed | about 350 ms per routing decision with WebGPU in desktop Chrome |
Does it route like the full model?
Measured in desktop Chrome (WebGPU) against the full-precision model, October 12, 2026:
| Same decision as full precision | |
|---|---|
| 300 random held-out prompts | 299 of 300 |
| 47 borderline prompts (picked to cover all three tiers) | 45 of 47 |
| Domain label | 347 of 347 |
| Valid JSON | 347 of 347 |
Smaller builds broke the router: 4-bit linear layers matched only 66% of decisions, so this build keeps them in 8 bits. For exact decisions on your own machine, use the GGUF build, which matched 347 of 347.
Results, training data and limitations are in the full model card.
- Downloads last month
- 907
Model tree for switchboardllm/switchboard-router-0.5b-ONNX
Base model
Qwen/Qwen2.5-0.5B Finetuned
Qwen/Qwen2.5-0.5B-Instruct Finetuned
switchboardllm/switchboard-router-0.5b