Text Generation
Transformers
Safetensors
English
qwen3
structured-output
policy-routing
json
mubit
conversational
text-generation-inference
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
Update model card with independent paired mubit-stress benchmarks and honest notes
Browse files15 unmodified lines161718191920212223242122232624252627282829303132293034313233343536373839404142434445465 unmodified lines525354465556575848495960616263646566676869535455707172737415 unmodified lines# Mubit-Qwen3-8B-Policy-Router
## Overview**Mubit-Qwen3-8B-Policy-Router** is an 8B-parameter structured triage model derived from `Qwen/Qwen3-8B` (distilled live from frozen `Qwen/Qwen3-32B` with zero human labels) that converts unstructured operational alerts into strict, multi-field JSON routing payloads at 8B speed (`4Γ` smaller than `32B`).**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- **Unlocks strict JSON routing at 8B:** Jumps from **`0.0% β 62.5%` exact schema match** and **`0.8% β 80.8%` field accuracy (`101Γ` lift)** on unseen held-out `ENTERPRISE_POLICY_ROUTING_24` alerts.- **Lifts instruction following to `100%`:** Improves `IFEval` strict from `0.875 β 1.000` (`+12.5 pp`) while keeping `LongHealth` at **`1.000`** and `HarmBench` refusal at **`1.000`** (`0.0%` over-refusal).- **Near-zero off-topic drift:** Holds median off-topic KL to **`0.0001` nats** (`0.0135` P95) in standard BF16 weights.## 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).
## Evaluation (`ENTERPRISE_POLICY_ROUTING_24` + 5 General & Safety Canaries)- **Significant full-schema routing lift in production non-thinking mode (`enable_thinking=False`):** - `hand/router` (`n=172`): exact all-field match **`29.1% β 39.0%` (`+9.9 pp [+2.9, +16.9]`***, `31W / 14L`), cross-policy generalization **`10.0% β 50.0%` (`5Γ`)**, prompt-injection resistance **`4.5% β 21.7%` (`4.8Γ`)**, compliance exact **`69.8% β 76.7%` (`+7.0 pp`*)**.- **Strong perturbation & compliance robustness (`n=440`):** `hand/router_perturb` compliance exact jumps **`65.0% β 79.3%` (`+14.3 pp [+11.1, +17.7]`***, **`65` wins / `2` losses!**), escalation accuracy rises **`80.9% β 85.2%` (`+4.3 pp`*)**, and `exact_all` rises `36.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`)**.
| Model | Exact Schema Match | Field Accuracy | `CUAD` F1 | `IFEval` | `LongHealth` | `HarmBench` Refuse | Off-Topic `KL` || --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: || **Mubit-Qwen3-8B-Policy-Router** | **`62.5%`** | **`80.8%`** | `0.810` | **`1.000`** | **`1.000`** | **`1.000`** | **`0.0001`** || Zero-Shot `32B β 8B` Transfer | `0.0%` | `1.7%` | `0.841` | `0.875` | `1.000` | `1.000` | `0.0000` || Base `Qwen3-8B` | `0.0%` | `0.8%` | `0.841` | `0.875` | `1.000` | `1.000` | `0.0000` |## Full Evaluation Table (`greedy`, `temperature=0.0`)
## Quickstart| 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`)*
```bashvllm serve MubitLabs/Mubit-Qwen3-8B-Policy-Router --dtype bfloat16 --max-model-len 327685 unmodified lines
model_id = "MubitLabs/Mubit-Qwen3-8B-Policy-Router"tok = AutoTokenizer.from_pretrained(model_id, trust_remote_code=False)model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=False)model = AutoModelForCausalLM.from_pretrained( model_id, dtype=torch.bfloat16, device_map="auto", trust_remote_code=False)
msgs = [{"role": "user", "content": "Alert: EU checkout billing webhook returning HTTP 502 for 9m; PCI retry queue at 88%. Emit structured routing JSON."}]ids = tok.apply_chat_template(msgs, add_generation_prompt=True, enable_thinking=False, return_tensors="pt").to(model.device)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))```
## Intended Use & Limitations- **Intended for:** Automated incident triage, compliance escalation routing, and strict JSON extraction on single-GPU `8B` deployments.- **Not intended for:** Unvalidated downstream production actions without JSON Schema verification.## Honest Notes & Limitations- **Use `enable_thinking=False` only (do NOT run with `enable_thinking=True`):** In `think=on` mode, `hand/router` `exact_all` **drops `-12.9 pp` (`56.1% β 43.3%`)** vs. base `Qwen3-8B` (`clear`: `56.7% β 36.7%`, `boundary`: `72.0% β 48.0%`) because the edit compresses `<think>` traces (though prompt-injection resistance still beats Base in `think=on`, `27.3% β 36.4%`). If you want verbose chain-of-thought routing (`think=on`) and can afford `~5Γ` higher latency, use base `Qwen3-8B`. This checkpoint is specifically for **fast, single-pass `enable_thinking=False` structured 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`-item `IFEval` and `969`-item `MMLU` under greedy decoding; separate safety suites (`HarmBench`/`XSTest`) were not re-run on this v3 checkpoint.- **License:** **Apache 2.0**.README.md+36-18