Build · Create · Engineering
Model router that sends each query to the right LLM
A routing function that dispatches each query to the right model by its type, normalizing case and falling back to a default for any unlisted type.
You receive: A reviewed router function + the passing test report.
Part of Ship MVP
What's verified: STUD verifies your router dispatches each query by its query_type on held-out cases: the type string is trimmed and lowercased before it is looked up in your routing table, any type not in the table (or an empty type) falls back to your default model, and the query text itself never changes the route. STUD does NOT judge whether your routing table sends queries to the best model, nor evaluate any model's answers.
Opens soon
This play is verified and ready. It opens soon, once sign-in and payments are live.
Example
A sample of what this play produces. Your result is generated for your inputs.
DEFAULT_MODEL = "gpt-4o"
ROUTING_TABLE = {
"factual": "mistral-7b",
"creative": "claude",
"analytical": "gpt-4o",
}
def route_to_model(inp):
"""Return the model id for inp['query_type'] (trimmed, case-insensitive),
with a deterministic default fallback. The query text never changes the
route: only query_type drives the decision."""
query_type = (inp or {}).get("query_type", "")
if not isinstance(query_type, str):
return DEFAULT_MODEL
return ROUTING_TABLE.get(query_type.strip().lower(), DEFAULT_MODEL)
# route_to_model({"query": "What year did Apollo 11 land?", "query_type": "factual"}) -> "mistral-7b"
# route_to_model({"query": "Translate this.", "query_type": "translation"}) -> "gpt-4o"Get early access to STUD the day it goes live.