Text Classification
Transformers
Safetensors
ONNX
multilingual
modernbert
routing
llm-routing
prompt-classification
complexity-estimation
text-embeddings-inference
Instructions to use scombat/s1d1-router with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use scombat/s1d1-router with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="scombat/s1d1-router")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("scombat/s1d1-router") model = AutoModelForSequenceClassification.from_pretrained("scombat/s1d1-router", device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download tutorials/01-http-and-curl.md from scombat/s1d1-router: direct link, hf CLI and curl.
- Browser
- Download file 1.14 kB
-
https://huggingface.co/scombat/s1d1-router/resolve/main/tutorials/01-http-and-curl.md
- Command line
-
hf download hf://scombat/s1d1-router/tutorials/01-http-and-curl.md
-
curl -L -o 01-http-and-curl.md https://huggingface.co/scombat/s1d1-router/resolve/main/tutorials/01-http-and-curl.md
1.14 kB
| # The router as a local HTTP service (works with anything) | |
| ```bash | |
| pip install "transformers>=5" torch pyyaml | |
| python integrations/serve.py --model scombat/s1d1-router --policy integrations/policy.example.yaml --port 8787 | |
| ``` | |
| ```bash | |
| curl -s localhost:8787/route -H 'content-type: application/json' \ | |
| -d '{"prompt": "Fix the failing test in utils/", "profile": "generic", "session_id": "demo"}' | |
| ``` | |
| Response: `route` (complexity_score, complexity_tier, task, needs_tools, needs_tools_probability, prompt_tokens) and | |
| `decision` (tier, model, effort, rule, reason). Profiles are in the policy file (`claude_code`, `codex`, `generic`). | |
| Status: run with the real model on a Mac (PyTorch on `mps`): the server starts, answers and logs, 10 to 19 ms per | |
| request after the first one. Without installing anything, `integrations/serve_variant.sh MODEL` starts it with the | |
| packages the variant needs (requires [uv](https://docs.astral.sh/uv/); MODEL is a Hub repo id or a local folder). | |
| Python, without the server: | |
| ```python | |
| from s1d1_router import Router | |
| print(Router("scombat/s1d1-router").route(["Summarise this contract in five bullets."])) | |
| ``` | |