Downloads · 30 days
89
43% of all-time downloads
NamanAgnih0tri/AlphaRoute-0.8B-v1.5
AlphaRoute-0.8B-v1.5 is a text generation model from NamanAgnih0tri. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
AlphaRoute-0.8B-v1.5 is an instruction-conditioned Small Language Model (SLM) engineered specifically for high-speed semantic routing, dynamic ontology classification, and constrained multi-field JSON extraction.
Downloads · 30 days
89
43% of all-time downloads
All-time downloads
206
Public
Parameters
752M
1.5 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.5 GB · 99%
From the Hugging Face model README
AlphaRoute-0.8B-v1.5 is an instruction-conditioned Small Language Model (SLM) engineered specifically for high-speed semantic routing, dynamic ontology classification, and constrained multi-field JSON extraction.
Trained on a curated 17,898-row instruction blend, AlphaRoute v1.5 learns the meta-task of routing: it does not have hardcoded static labels. At runtime, developers supply an arbitrary task instruction, a dynamic ontology (with descriptions), and an arbitrary JSON schema; AlphaRoute outputs valid JSON matching the requested schema at edge-level latencies.
All evaluations are conducted with greedy decoding (temperature = 0.0) on standardized fixed test splits:
| Benchmark Dimension | AlphaRoute-0.8B v1.5 | AlphaRoute-0.8B v1.1 | AlphaRoute-0.8B v1.0 | DeepSeek-V4 Flash | Azure GPT-5.4-nano |
|---|---|---|---|---|---|
| Golden 300 Enterprise (300 Scenarios) | 97.67% | 95.67% | 89.33% | 94.00% | 92.33% |
| Banking77 Intent (500 Fixed Samples) | 95.40% | 92.60% | 91.80% | 93.00% | 85.40% |
| CLINC150 Multi-Domain (500 Fixed Samples) | 94.00% | 73.20% | 75.20% | 71.40% | 54.40% |
| HWU64 Zero-Shot (1,076 Held-Out) | 89.96% | 83.18% | 83.92% | 85.40% | 81.20% |
| Adversarial OOS Rejection (20 Probes) | 100.00% | 55.00% | 35.00% | 75.00% | 65.00% |
| Multi-Target Compound (117 Split) | 62.39% | 52.14% | 22.22% | 64.10% | 58.12% |
| CLINC150 OOS Recall (94 OOS Queries) | 85.11% | 96.81% | 95.74% | 98.94% | 94.68% |

At initial glance, AlphaRoute v1.5 records an 85.11% OOS recall on CLINC150, whereas earlier models and frontier APIs scored between 94.68% and 98.94%. A granular breakdown of the 500 benchmark episodes (406 In-Scope user requests vs. 94 Out-of-Scope queries) clarifies why this reflects a deliberate optimization trade-off rather than an architectural regression:
| Model Backbone | OOS Recall (94 Out-of-Scope) | In-Scope Intent Accuracy (406 Real Requests) | Overall Benchmark Accuracy (500 Total) |
|---|---|---|---|
| Azure GPT-5.4-nano | 94.68% (89/94) | 45.07% (183/406) | 54.40% |
| DeepSeek-V4 Flash | 98.94% (93/94) | 65.02% (264/406) | 71.40% |
| AlphaRoute-0.8B v1.1 | 96.81% (91/94) | 67.73% (275/406) | 73.20% |
| AlphaRoute-0.8B v1.5 | 85.11% (80/94) | 96.06% (390/406) | 94.00% |
Elimination of False-Rejection Bias:
out_of_scope: true.Lexical Proximity in 10-Category Sampling:
oil_change_how, or "distance between football goal posts" paired with distance). Because v1.5 is trained to route confidently rather than defensively drop requests, it selected the overlapping label.Enterprise Boundary Precision:
AlphaRoute-0.8B v1.5 was developed through a structured, multi-phase research progression:
AlphaRoute-0.8B v1.0 (Baseline Exploration):
AlphaRoute-0.8B v1.1 (Internal Research Iteration):
Qwen/Qwen3.5-0.8B-Base) designed specifically to address the core behavioral issues identified in v1.0.AlphaRoute-0.8B v1.5 (Public Release):
import json
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "NamanAgnih0tri/AlphaRoute-0.8B-v1.5"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16,
device_map="auto"
)
task = "Triage enterprise infrastructure incident. Disentangle primary root cause, determine responding operational team, and extract urgency."
categories = {
"db_deadlock": "Postgres/MySQL lock contention, exclusive table locks, query timeouts.",
"k8s_oom": "Kubernetes OOMKilled exit code 137, cgroup memory exhaustion, pod evicted.",
"tls_cert_expired": "TLS handshake failure, expired origin cert on ALB/Cloudflare.",
"iam_privilege_escalation": "Compromised access keys, unauthorized IAM role modification."
}
output_schema = {
"root_cause": "db_deadlock | k8s_oom | tls_cert_expired | iam_privilege_escalation | null",
"assigned_team": "dba_sre | k8s_platform | secops | netops",
"severity": "SEV0_critical | SEV1_high | SEV2_medium",
"out_of_scope": "boolean"
}
query = "CRITICAL: Checkout service is stuck in CrashLoopBackOff. Logs show: `FATAL: deadlock detected Process 8912 waiting for ExclusiveLock on relation orders`."
# Construct Canonical Routing Prompt (Zero-Shot)
cat_str = "\n".join([f"- {k}: {v}" for k, v in categories.items()])
schema_str = json.dumps(output_schema, indent=2)
prompt = f"""You are a precise semantic routing engine. Analyze the input against the provided categories and output only a valid JSON object matching the requested schema. Do not output conversational text or markdown code fences.
TASK:
{task}
CATEGORIES:
{cat_str}
OUTPUT SCHEMA:
{schema_str}
INPUT:
"{query}"
JSON:"""
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=120,
temperature=0.0,
do_sample=False,
pad_token_id=tokenizer.pad_token_id
)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True).strip()
lm-format-enforcer)For production environments requiring strict schema guarantees, token generation can be physically constrained at each step using a grammar/FSM parser such as lm-format-enforcer:
pip install lm-format-enforcer
from lmformatenforcer import JsonSchemaParser
from lmformatenforcer.integrations.transformers import build_transformers_prefix_allowed_tokens_fn
# Formal JSON schema representing your target fields and enums
json_schema = {
"type": "object",
"properties": {
"root_cause": {
"anyOf": [
{"type": "string", "enum": ["db_deadlock", "k8s_oom", "tls_cert_expired", "iam_privilege_escalation"]},
{"type": "null"}
]
},
"assigned_team": {"type": "string", "enum": ["dba_sre", "k8s_platform", "secops", "netops"]},
"severity": {"type": "string", "enum": ["SEV0_critical", "SEV1_high", "SEV2_medium"]},
"out_of_scope": {"type": "boolean"}
},
"required": ["root_cause", "assigned_team", "severity", "out_of_scope"],
"additionalProperties": False
}
parser = JsonSchemaParser(json_schema)
prefix_function = build_transformers_prefix_allowed_tokens_fn(tokenizer, parser)
# Pass prefix_allowed_tokens_fn directly into model.generate
outputs = model.generate(
**inputs,
prefix_allowed_tokens_fn=prefix_function,
max_new_tokens=120,
temperature=0.0,
do_sample=False
)
response = tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True).strip()
print(response)
Constrained decoding ensures 100% JSON validity, eliminates any markdown formatting leaks, and enforces allowed enum values at runtime.
AlphaRoute v1.5 is trained on a mixture of zero-shot and dynamic few-shot (1 to 3 exemplars) instruction templates.
You are a precise semantic routing engine. Analyze the input against the provided categories and output only a valid JSON object matching the requested schema. Do not output conversational text or markdown code fences.
TASK:
<task description>
CATEGORIES:
- <category_1>: <description_1>
- <category_2>: <description_2>
OUTPUT SCHEMA:
<json_schema>
[OPTIONAL] EXAMPLES:
Input: "<representative query 1>"
Output: {"target_field": "category_1", ...}
Input: "<representative query 2>"
Output: {"target_field": "category_2", ...}
INPUT:
"<runtime input query>"
JSON:
While AlphaRoute achieves high accuracy out of the box in zero-shot mode, incorporating 1 to 3 few-shot examples is recommended for specialized edge cases:
temperature = 0.0 (Greedy Decoding / do_sample=False) for deterministic routing decisions and valid JSON schema fidelity.If you have any questions, evaluation inquiries, or feedback regarding AlphaRoute, feel free to reach out: