File size: 3,352 Bytes
f0686c7
89b1d96
f0686c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c25f48
 
486c87f
 
 
f0686c7
 
 
 
3c25f48
 
 
 
 
f0686c7
 
 
 
 
 
 
 
 
 
 
 
 
 
3c25f48
 
f0686c7
 
3c25f48
 
f0686c7
 
89b1d96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3c25f48
89b1d96
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
license: apache-2.0
library_name: transformers
pipeline_tag: text-classification
base_model: jhu-clsp/mmBERT-small
base_model_relation: finetune
inference: false
tags:
  - routing
  - llm-routing
  - prompt-classification
  - modernbert
  - multilingual
---

# s1d1-router, six sources, tiny, PyTorch fp16 (safetensors)

A "System 1" router: it reads a user prompt and returns its complexity score (0.01 to 1.00), its task type (19 classes)
and whether it needs tools. It never picks a model; the deployer maps these outputs to models with rules. The method,
the training data, the full results and the limitations are in the card of the main repository,
[scombat/s1d1-router](https://huggingface.co/scombat/s1d1-router). An open, replayable bench of the variants against three local LLM
judges on 360 multilingual prompts, with confidence intervals and witnesses, is
[s1d1-bench](https://github.com/scombat/s1d1-bench).

- Variant: `v7_small_l6-fp16`, mmBERT-small cut to 6 layers, 32k vocabulary, distilled from the full model.
- Format: PyTorch fp16 (safetensors), 85 MB.
- Outputs: 21 logits. Output 0 is the complexity in tier units (score = 0.5 + 0.25 x output, clipped to 0.01..1.00),
  outputs 1 to 19 are the task logits (order in `task_names` of `config.json`), output 20 is the needs_tools logit.
- Pruned vocabulary variants ship `vocab_map.npy` (full tokenizer id -> pruned id); the loader below applies it.
- **Do not read it through `pipeline("text-classification")` with its defaults, nor through Text Embeddings
  Inference**: both apply one softmax over the 21 outputs. `config.json` declares `problem_type: regression`, so
  `pipeline(..., top_k=None)` returns the raw outputs; decode them as the main card shows.

## Measures (validation, 4,914 rows, six sources, unweighted)

| complexity QWK | complexity MAE | task accuracy | task macro-F1 | needs_tools F1 | needs_tools AUROC |
|---|---|---|---|---|---|
| 0.649 | 0.091 | 0.782 | 0.662 | 0.484 | 0.904 |

Agreement with the full fp32 model on validation: same complexity tier 79.6%, same task
81.3%, same needs_tools 96.7%.
Latency, batch 1, transformers backend on an Apple M4 Max: p50 3.1 ms, p95 8.0 ms.
Full results and method: `docs/15-catalog-v4-v7.md` in the project; `eval.json` in this repo.

## Use

`s1d1_router.py` from [scombat/s1d1-router](https://huggingface.co/scombat/s1d1-router) loads this repository directly (Python >= 3.10,
`tokenizers`, `huggingface_hub` and `torch`):

```python
from s1d1_router import Router
router = Router("scombat/s1d1-router-6src-tiny")
router.route(["Quelle est la capitale de l'Australie ?"])
```

## License

Apache-2.0. The base model, [mmBERT-small](https://huggingface.co/jhu-clsp/mmBERT-small), is MIT-licensed; its
notice is kept in `NOTICE`. The license requires you to keep `LICENSE` and `NOTICE` when you redistribute the weights or
a derivative; it does not require attribution when you merely use the model in a product or behind an API. If you use
it in published work or a product, a mention of the author and the citation below are appreciated (a request, not a
condition).

## Citation

```bibtex
@misc{s1d1_router_2026,
  title  = {s1d1-router: a one-pass multilingual router for LLM requests},
  author = {scombat},
  year   = {2026},
  howpublished = {\url{https://huggingface.co/scombat/s1d1-router}}
}
```