Use cases· Last updated

Model routing with Jev

The use-case map lists model routing as a first-class job: classify intent and domain, estimate difficulty and risk, escalate only what needs a more expensive model.

You implement that as a Choice (and maybe a difficulty Score) on the latest user message or the full state. Your code maps choice → provider id. Jev is the router, not the actor that generates the answer.

LangChain documents ModelRouterMiddleware in langchain_typesafe.experimental.middleware: you declare named ModelChoice entries with criteria strings, plus instructions such as “choose the least costly model that can complete the task.” The router reads the latest user message and selects a model for the run. Probabilities and confidence remain in agent state. Those APIs are LangChain’s. They still consume a TypeSafe key. If the package moves, believe current LangChain docs.

Gate low-confidence routes to the safer (usually costlier) model or to a human. That is cheaper than sending every prompt to the frontier chat model “just in case.”

See intent routing when the first cut is handler class, not model class. See agent loops when people want Jev to be the agent.

Hub: Use cases. Official: docs.typesafe.ai.

Sources

Public TypeSafe or adjacent documentation only. No private claims.