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
|
Download README.md from MubitLabs/Mubit-Qwen3-8B-Policy-Router: direct link, hf CLI and curl.
- Browser
- Download file 5.59 kB
-
https://huggingface.co/MubitLabs/Mubit-Qwen3-8B-Policy-Router/resolve/main/README.md
- Command line
-
hf download hf://MubitLabs/Mubit-Qwen3-8B-Policy-Router/README.md
-
curl -L -o README.md https://huggingface.co/MubitLabs/Mubit-Qwen3-8B-Policy-Router/resolve/main/README.md
5.59 kB
| language: | |
| - en | |
| license: apache-2.0 | |
| base_model: Qwen/Qwen3-8B | |
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - structured-output | |
| - policy-routing | |
| - json | |
| - qwen3 | |
| - mubit | |
| # 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 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`)**. | |
| ## 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`)* | |
| ```bash | |
| vllm serve MubitLabs/Mubit-Qwen3-8B-Policy-Router --dtype bfloat16 --max-model-len 32768 | |
| ``` | |
| ```python | |
| 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=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**. | |