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-hybrid-harness
Ra77Data
Runs a local Laya decision model and delegates uncertain cases to a cloud service
laya-demo
mkhante
Provides a standalone Go server and client that embed native Laya inference
mcp-laya
tijo95
Provides local Laya decision tools through an MCP server for routing, checks, and custom typed questions
LAYA_finetune
ameerhmz
Fine-tunes Laya into a multilingual, non-autoregressive decision model and provides deployment formats
opencode-laya-plugin
PedroZia
Adds a local Laya decision tool to OpenCode for classifications, routing, scoring, and yes/no decisions
hybrid-intent-router
indranildchandra
Routes intents through a local cascade that includes Laya and other decision models
pi-auto-model
Jonathan0823
A Pi virtual model that routes decisions through Laya or Jev
jev-smart-home-lab
SafalFrom2050
A smart-home simulation that compares Jev API and local Laya decisions
clara
TheWiderLensInitiative
A private desktop AI assistant pairs a Hermes agent with a Laya router and Android app
laya
csr9497
A browser interface for designing and evaluating semantic decisions with the Laya library
Fraudshield-Laya
23f3004075
A real-time fraud prevention engine with Laya and other decision-model backends
laya-router
gia-uh
Routes text to supplied labels with calibrated probabilities using Laya
laya-plugin
theo-odore
Routes coding-agent tasks to models based on task type and complexity
laya-desktop-agent
royaldynamo128-gif
Runs a local voice desktop agent with Convai Laya as a decision-routing component
laya-rhoai-demo
rrbanda
Routes cross-border data using Laya classification, policy rules, and Gemini explanations
laya-auto-mode
tuncer-byte
Adds Laya-powered automatic model routing to the GitHub Copilot Chat model picker
llama-mcp-router
u9401066
Routes requests to relevant MCP tools using Laya and BM25 selectors before forwarding them to llama-server
Laya
SaYm0n
Uses Laya as a local decision engine and routes uncertain cases to language models or human reviewers
laya-react
dungdq4
Implements a React demo of Laya's typed decision patterns for routing, filtering, and moderation
laya-pipeline
trifleen
Uses Laya to route, compress, and check requests sent to local language models
jev-laya-dsh
alexdoandev
Adds a local Laya decision layer for routing prompts and gating risky agent actions
intent-router-laya
anujgupta9860
Routes queries to worker agents using self-hosted Laya, with optional training and review
laya-incident-triage
curtiscovington
Evaluates Laya against rule-based and trained baselines for incident triage and routing
litellm-gemini-laya-router
derrickqin
Uses a local Laya model to route coding-agent requests to Gemini models on Vertex AI
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