Routing with Laya
A router runs before every request, so its own latency and cost land on the critical path. Laya answers a routing question in one forward pass with no generated tokens, which makes it a natural fit for choosing an LLM tier, a support queue or a tool.
342 projects
laya-lab
InfiniteXyy
A playground demonstrates Laya-powered routing, browser tests, and semantic log filtering
laya-escalate
Sidharth-06
A Python package audits Laya confidence calibration and provides repairs and escalation policies
Laya-model-router
MikkelCardon
Routes prompts to Claude models by task type using Laya classification
warden-laya-service
tanishqsharmaa
Serves Laya typed-decision inference through gRPC and HTTP APIs for routing and reranking
laya-intent-router
vrajnotviraj
Provides an ONNX intent router distilled from Laya, with training and inference code
laya-agentic-triage
PrashantMali07
A LangGraph incident-triage system uses Laya for typed classification and routing
hybrid-pg-laya-poc
JadELHAJJ-prog
Routes a refund-support agent with Laya and calls local Qwen when generation or tool use is needed
decide.js
asertyui1
Provides a typed SDK and CLI for routing decisions across Jev, Laya, local models, and offline heuristics
railsync
devadarshmay-eng
Railway maintenance block planner that triages requests with Laya before OR-Tools scheduling
routewise-support-agent
sami-rk
Routes customer-support messages with local Laya decisions and handles replies, tools, and knowledge retrieval
@molecule/api-ai-decisions
vialoh
Defines a provider interface for typed AI decisions, with Laya as a supported backend
laya
ManavShar
Provides the multilingual Laya typed-decision model and Python tooling for classification, scoring, and routing
laya-linear-assigner
DamengRandom
Assigns unassigned Linear tickets to engineers using the local Laya decision model
RLP
senghan1992
Uses Laya to triage coding requests and route work to parallel agents
laya-mcp
kennedyshead
Serves local Laya routing decisions to coding agents through an MCP server
claude-laya
marcellbaan
Routes Claude Code turns among Haiku, Sonnet, and Opus using local Laya decisions
laya-studio
eformat
Provides a local web workbench for exploring Laya checkpoints, decisions, and routing
litellm-laya-demo
amkhrjee
Routes LiteLLM requests by complexity scores produced by Laya
hermes-laya-router
rengaryang
Routes Hermes Agent model tiers and provides per-turn model selection using Laya
docker-ai-router
Gio53
OpenAI-compatible proxy that uses Laya difficulty scores to route requests between two LLM APIs
JevRouter-for-OpenCode
husnain381a
An OpenCode plugin that uses Laya or Jev to route prompts to downstream models
GLaDOS
bearcut
Routes LLM requests using Laya-based security, intent, and complexity decisions
laya-tools
teamswyg
Implements a Go-based local Laya router for code search and experimental model selection
turnhelm
milhous
A local-first CLI uses Jev or Laya to select models and reasoning effort for coding tasks
Built-in router preset
The core package ships a question set for small-versus-frontier model routing:
import laya
agent = laya.load("convaiinnovations/laya")
routing = agent.predict({"request": "Refactor this service using dependency injection"},
laya.router_questions())
For LangGraph there is a conditional-edge router with a confidence fallback:
from laya.integrations.langchain import LayaRouter
router = LayaRouter(
criteria={"billing": "invoices, charges", "tech": "bugs, outages"},
confidence_threshold=0.80,
fallback="human_agent",
)
workflow.add_conditional_edges("triage", router)
Note that laya.Router is a different thing: it picks which Laya checkpoint answers, based on script and language.
Measured: Laya vs a reasoning model
laya_router put Laya and GPT-5 nano behind one endpoint and tested 180 labelled requests. Both scored 0.600 route accuracy, at 184 ms p50 for Laya and 6,415 ms for GPT-5 nano. The README also found that rewording the tier descriptions moved accuracy by 21 points.
git clone https://github.com/glukicov/laya_router && cd laya_router
uv sync --all-extras
uv run laya-router serve --backend laya
Projects
- system-one-router: an OpenAI- and Anthropic-compatible Go gateway where Laya or Jev answers topic, complexity, risk and private-data questions, then picks the cheapest adequate model.
- pi-pignon: a pi coding-agent extension that picks a model tier per prompt from a local
laya-serve(about 75 ms on Apple Silicon, per its README) or Jev. - laya-mcp (NVentimiglia): a
route_taskMCP tool for light vs frontier routing.
Caveats
In laya_router, Laya got 97% of small requests right but only 7 of 56 medium ones, so check each tier separately, not just overall accuracy. Write tier descriptions with concrete examples, and send low-confidence answers to a fallback.
Hosted option
layahost runs Laya behind the Jev-compatible /v1/systemone, plus /v1/decide templates for routing, support_intent and priority. Its decision flows chain questions in a visual editor (spam check, then intent, then team) and run the whole flow in one request, asking and billing only the questions on the path taken. Low-confidence answers can take their own branch to a person. layahost is run by the makers of laya.tools.
More ways to use Laya