Instructions to use MubitLabs/Mubit-Qwen3-8B-Policy-Router with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MubitLabs/Mubit-Qwen3-8B-Policy-Router with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MubitLabs/Mubit-Qwen3-8B-Policy-Router") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MubitLabs/Mubit-Qwen3-8B-Policy-Router") model = AutoModelForCausalLM.from_pretrained("MubitLabs/Mubit-Qwen3-8B-Policy-Router", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MubitLabs/Mubit-Qwen3-8B-Policy-Router with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MubitLabs/Mubit-Qwen3-8B-Policy-Router" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MubitLabs/Mubit-Qwen3-8B-Policy-Router", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MubitLabs/Mubit-Qwen3-8B-Policy-Router
- SGLang
How to use MubitLabs/Mubit-Qwen3-8B-Policy-Router 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 "MubitLabs/Mubit-Qwen3-8B-Policy-Router" \ --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": "MubitLabs/Mubit-Qwen3-8B-Policy-Router", "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 "MubitLabs/Mubit-Qwen3-8B-Policy-Router" \ --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": "MubitLabs/Mubit-Qwen3-8B-Policy-Router", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MubitLabs/Mubit-Qwen3-8B-Policy-Router with Docker Model Runner:
docker model run hf.co/MubitLabs/Mubit-Qwen3-8B-Policy-Router
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("MubitLabs/Mubit-Qwen3-8B-Policy-Router")
model = AutoModelForCausalLM.from_pretrained("MubitLabs/Mubit-Qwen3-8B-Policy-Router", 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=256)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))Mubit-Qwen3-8B-Policy-Router
Overview
Mubit-Qwen3-8B-Policy-Router is a standalone BF16 8B structured triage model built from Qwen/Qwen3-8B via Mubit direct weight-space programming (ROM-nullspace-projected 2D highway updates baked directly into standard .safetensors weights โ no runtime adapter required). It is optimized for fast, single-pass non-thinking (enable_thinking=False) JSON incident routing, compliance flag tagging (PCI, PII, HIPAA, SOC2, GDPR), and prompt-injection resistance while preserving general instruction-following and MMLU capability.
Key Highlights (Paired Independent Stress Benchmark vs. Base โ enable_thinking=False)
All evaluations use greedy decoding (temperature=0.0) on identical prompts with 95% paired bootstrap confidence intervals (* = statistically significant).
- Significant full-schema routing lift in production non-thinking mode (
enable_thinking=False):hand/router(n=172): exact all-field match29.1% โ 39.0%(+9.9 pp [+2.9, +16.9]*,31W / 14L), cross-policy generalization10.0% โ 50.0%(5ร), prompt-injection resistance4.5% โ 21.7%(4.8ร), compliance exact69.8% โ 76.7%(+7.0 pp*).
- Strong perturbation & compliance robustness (
n=440):hand/router_perturbcompliance exact jumps65.0% โ 79.3%(+14.3 pp [+11.1, +17.7]*,65wins /2losses!), escalation accuracy rises80.9% โ 85.2%(+4.3 pp*), andexact_allrises36.4% โ 39.5%. - Zero general-capability forgetting (both general suites improved):
IFEval(n=541)81.5% โ 83.2%(+1.7 pp),MMLU(n=969)75.6% โ 76.8%(+1.1 pp).
Full Evaluation Table (greedy, temperature=0.0)
| Benchmark | Mode | Metric | n |
Base Qwen3-8B |
Mubit Router-8B | Paired ฮ [95% CI] |
Wins / Losses |
|---|---|---|---|---|---|---|---|
hand/router |
think=off |
exact_all |
172 |
29.1% |
39.0% |
+9.9 pp [+2.9, +16.9]* |
31 / 14 |
hand/router |
think=off |
compliance_exact |
172 |
69.8% |
76.7% |
+7.0 pp [+1.7, +12.8]* |
18 / 6 |
hand/router |
think=off |
escalate_acc |
172 |
79.7% |
81.4% |
+1.7 pp [-2.3, +5.8] |
8 / 5 |
hand/router_perturb |
think=off |
compliance_exact |
440 |
65.0% |
79.3% |
+14.3 pp [+11.1, +17.7]* |
65 / 2 |
hand/router_perturb |
think=off |
escalate_acc |
440 |
80.9% |
85.2% |
+4.3 pp [+1.6, +7.3]* |
29 / 10 |
hand/router_perturb |
think=off |
exact_all |
440 |
36.4% |
39.5% |
+3.2 pp [-1.4, +8.2] |
67 / 53 |
hand/router (see note below) |
think=on |
exact_all |
171 |
56.1% |
43.3% |
-12.9 pp [-21.6, -4.1]* |
20 / 42 |
IFEval (general retention) |
think=off |
Strict all | 541 |
81.5% |
83.2% |
+1.7 pp [-0.7, +4.1] |
28 / 19 |
MMLU (general retention) |
think=off |
Accuracy | 969 |
75.6% |
76.8% |
+1.1 pp [-1.1, +3.3] |
57 / 46 |
Quickstart (Required Mode: enable_thinking=False)
vllm serve MubitLabs/Mubit-Qwen3-8B-Policy-Router --dtype bfloat16 --max-model-len 32768
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "MubitLabs/Mubit-Qwen3-8B-Policy-Router"
tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=False)
model = AutoModelForCausalLM.from_pretrained(
model_id, dtype=torch.bfloat16, device_map="auto", trust_remote_code=False
)
msgs = [
{"role": "system", "content": "Route the incoming alert according to policy and return ONE raw JSON object with keys severity, primary_team, secondary_teams, compliance_flags, escalate, summary."},
{"role": "user", "content": "Alert: EU checkout billing webhook returning HTTP 502 for 9m; PCI retry queue at 88%."},
]
# IMPORTANT: Always pass enable_thinking=False (see Honest Notes below)
ids = tok.apply_chat_template(
msgs, add_generation_prompt=True, enable_thinking=False, return_tensors="pt"
).to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=256, do_sample=False)[0][ids.shape[-1]:], skip_special_tokens=True))
Honest Notes & Limitations
- Use
enable_thinking=Falseonly (do NOT run withenable_thinking=True): Inthink=onmode,hand/routerexact_alldrops-12.9 pp(56.1% โ 43.3%) vs. baseQwen3-8B(clear:56.7% โ 36.7%,boundary:72.0% โ 48.0%) because the edit compresses<think>traces (though prompt-injection resistance still beats Base inthink=on,27.3% โ 36.4%). If you want verbose chain-of-thought routing (think=on) and can afford~5รhigher latency, use baseQwen3-8B. This checkpoint is specifically for fast, single-passenable_thinking=Falsestructured JSON routing and compliance/injection hardening. - Scope limits: Designed for single-turn policy-grounded JSON routing; freeform routing (
0%) and long multi-turn routing (10%) remain weak. Always validate emitted payloads against your production JSON Schema before taking downstream actions. - Evaluation scope: General retention was verified on
541-itemIFEvaland969-itemMMLUunder greedy decoding; separate safety suites (HarmBench/XSTest) were not re-run on this v3 checkpoint. - License: Apache 2.0.
- Downloads last month
- 633
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MubitLabs/Mubit-Qwen3-8B-Policy-Router") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)