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.
114 projects
laya-codex-router
mcmcmcmmmc
Routes Codex model calls and thinking effort locally using Laya
Laya-System-1-Model
JayanGupta
Showcases Laya for text classification, urgency scoring, and ticket triage with Hugging Face Transformers
switchyard
mayur2109
A local decision service exposes Laya's typed answers to agents and automation systems
laya-vs-llm-benchmark
Shray15
Benchmarks Laya against a local LLM for selecting MCP tools
jev-router
drycool
Provides a multi-tier routing gateway for RAG and agent workflows with an optional Laya classifier
trust-router
NotoriousPOG
Compares rules, BERT, and Laya for shadow-mode AI security routing
opencode-system-1-router
jonasneustock
An OpenCode plugin routes tasks to cloud models with Jev or local Laya and routes subagents independently
decide
stackable-specs
Runs reusable typed decision templates across Jev, Laya, and general-purpose language models
gut-check
rfi-irfos
Uses Laya confidence to route uncertain agent-verification cases to a larger language model
laya
vk-alto-none
Provides a multilingual non-autoregressive Laya decision engine with checkpoint routing
system-one-poc
tonysprite
Integrates Laya-based typed decisions into DeepSeek Harness tool approvals and selection
pixel
adetbekov
Uses Laya to route robot-pet commands locally and Gemini for unknown requests
laya-api
hugomes14
Serves a multilingual ticket classification model through an HTTP API
pi-laya
Dephilia
Routes prompts among model tiers and gates confidential prompts using a local Laya sidecar
pi-laya
izhimu
Integrates local Laya decision-model guardrails and judging into pi and oh-my-pi
laya-multilingual-playground
pumpkinfadly
Provides a web playground and API for testing multilingual Laya typed decisions
laya-coding-router
0xSarnavo
Fine-tunes Laya to route coding-agent prompts to skills, tools, MCP servers, and models
maayaa
ToufiqQureshi
Implements a Laya-derived decision engine with order-stability abstention
Helpdesk-Laya-Router
stefanus-ai-tech
Classifies helpdesk tickets with Laya and produces Excel routing and evaluation reports
laya-cli-gate
uzuw
A head-only Laya fine-tune classifies terminal commands for safety review and tool routing
laya-claude-router
Harryagarwal
Routes requests between Laya decisions and Claude
jev-v-laya
rnunley
A held-out MMLU-Pro benchmark compares answer routing with local Laya and hosted Jev
synapse
Hduc
Tạo hệ thống ra quyết định và tự động hóa bằng Laya, kết hợp quy tắc, phê duyệt và phân giải giao diện động
Smart-Support-Ticket-Router-Using-Laya
affan1311
Routes support tickets with Laya and uses Gemini to draft replies, with a benchmark against a Gemini-only pipeline
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.
More ways to use Laya