nuhmanpk/semantic-router-dataset
Viewer β’ Updated β’ 485 β’ 22 β’ 1
How to use nuhmanpk/toolscout-bge-small with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("nuhmanpk/toolscout-bge-small")
sentences = [
"That is a happy person",
"That is a happy dog",
"That is a very happy person",
"Today is a sunny day"
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [4, 4]A tiny (33M params) embedding model that routes a user request to the best tool from any list of tools,
including tools it never saw during training. Fine-tuned from BAAI/bge-small-en-v1.5 on
nuhmanpk/semantic-router-dataset using each example's candidate pool as hard negatives.
Fast enough to run on CPU in milliseconds, so it can sit in front of an LLM agent and trim a large tool list down to the top few candidates before the LLM sees it.
Each test query is ranked against all 36 tools in the catalog.
| Model | Seen top-1 | Seen MRR | Unseen top-1 | Unseen top-3 | Unseen MRR |
|---|---|---|---|---|---|
| BAAI/bge-small-en-v1.5 (no tuning) | 98.0% | 0.990 | 95.7% | 100.0% | 0.979 |
| ToolScout v0.1 | 100.0% | 1.000 | 98.6% | 100.0% | 0.993 |
audio_transcriber, code_debugger, creative_writer, equation_solver, file_reader, git_manager) were removed from training entirely, so this measures generalization to new tools.code_debugger instead of code_executor, even though code_debugger was not in training.from sentence_transformers import SentenceTransformer
model = SentenceTransformer("nuhmanpk/toolscout-bge-small")
PREFIX = "Represent this sentence for searching relevant passages: "
tools = {
"weather_lookup": "Gets current weather and forecasts for a city.",
"email_sender": "Sends emails to contacts.",
"calculator": "Performs arithmetic calculations.",
}
q = model.encode(PREFIX + "will it rain tomorrow?", normalize_embeddings=True)
t = model.encode([f"{k}: {v}" for k, v in tools.items()], normalize_embeddings=True)
print(list(tools)[(t @ q).argmax()]) # -> weather_lookup
Tips
name: short description.BAAI/bge-small-en-v1.5A v2 with harder, more natural queries, confusable tool groups and 100+ tools is planned.
Built by Nuhman PK
If you find this useful, a β€οΈ on the repo helps!
@misc{toolscout2026,
author = {Nuhman PK},
title = {ToolScout: A Tiny Embedding Model for Tool Routing},
year = {2026},
url = {https://huggingface.co/nuhmanpk/toolscout-bge-small}
}
Base model
BAAI/bge-small-en-v1.5