Downloads · 30 days
0
tgupj/tiny-router
tiny-router is a machine learning model from tgupj. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
tiny-router is a compact experimental multi-head routing classifier for short, domain-neutral messages with optional interaction context. It predicts four separate signals that downstream systems or agents can use for…
Downloads · 30 days
0
Access
Public
Updated Mar 20, 2026
Repo size
1.3 GB
Likes
56
Public
Click a slice to open those files.
.onnx738 MB · 56%
From the Hugging Face model README
tiny-router is a compact experimental multi-head routing classifier for short, domain-neutral messages with optional interaction context. It predicts four separate signals that downstream systems or agents can use for update handling, action routing, memory policy, and prioritization.
relation_to_previous: new | follow_up | correction | confirmation | cancellation | closure
actionability: none | review | act
retention: ephemeral | useful | remember
urgency: low | medium | high
The model emits these heads independently at inference time, plus calibrated confidences and an overall_confidence.
Good use cases:
Not good use cases:
This checkpoint was trained on the synthetic dataset split in:
data/synthetic/train.jsonldata/synthetic/validation.jsonldata/synthetic/test.jsonlThe data follows a structured JSONL schema with:
current_textinteraction.previous_textinteraction.previous_actioninteraction.previous_outcomeinteraction.recency_secondslabelsmicrosoft/deberta-v3-smallprevious_action embeddingprevious_outcome embeddinglog1p(recency_seconds)This checkpoint was trained with:
batch_size = 32epochs = 20max_length = 128encoder_lr = 2e-5head_lr = 1e-4dropout = 0.1pooling_type = attentionuse_head_dependencies = trueHeld-out test results from artifacts/tiny-router/eval.json:
macro_average_f1 = 0.7848exact_match = 0.4570automation_safe_accuracy = 0.6230automation_safe_coverage = 0.5430ECE = 0.3440Per-head macro F1:
relation_to_previous = 0.8415actionability = 0.7982retention = 0.7809urgency = 0.7187Ablations:
current_text_only = 0.7058current_plus_previous_text = 0.7478full_interaction = 0.7848Interpretation:
{
"relation_to_previous": { "label": "correction", "confidence": 0.94 },
"actionability": { "label": "act", "confidence": 0.97 },
"retention": { "label": "useful", "confidence": 0.76 },
"urgency": { "label": "medium", "confidence": 0.81 },
"overall_confidence": 0.87
}
This repo uses a custom checkpoint format. Load it with this project:
from tiny_router.io import load_checkpoint
from tiny_router.runtime import get_device
device = get_device(requested_device="cpu")
model, tokenizer, config = load_checkpoint("artifacts/tiny-router", device=device)
Or run inference with:
uv run python predict.py \
--model-dir artifacts/tiny-router \
--input-json '{"current_text":"Actually next Monday","interaction":{"previous_text":"Set a reminder for Friday","previous_action":"created_reminder","previous_outcome":"success","recency_seconds":45}}' \
--pretty