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

0·GitHub repo

laya-demo

mkhante

Provides a standalone Go server and client that embed native Laya inference

0·GitHub repo

mcp-laya

tijo95

Provides local Laya decision tools through an MCP server for routing, checks, and custom typed questions

0·GitHub repo

LAYA_finetune

ameerhmz

Fine-tunes Laya into a multilingual, non-autoregressive decision model and provides deployment formats

0·GitHub repo

opencode-laya-plugin

PedroZia

Adds a local Laya decision tool to OpenCode for classifications, routing, scoring, and yes/no decisions

0·GitHub repo

hybrid-intent-router

indranildchandra

Routes intents through a local cascade that includes Laya and other decision models

0·GitHub repo

pi-auto-model

Jonathan0823

A Pi virtual model that routes decisions through Laya or Jev

0·GitHub repo

jev-smart-home-lab

SafalFrom2050

A smart-home simulation that compares Jev API and local Laya decisions

0·GitHub repo

clara

TheWiderLensInitiative

A private desktop AI assistant pairs a Hermes agent with a Laya router and Android app

0·GitHub repo

laya

csr9497

A browser interface for designing and evaluating semantic decisions with the Laya library

0·GitHub repo

Fraudshield-Laya

23f3004075

A real-time fraud prevention engine with Laya and other decision-model backends

0·GitHub repo

laya-router

gia-uh

Routes text to supplied labels with calibrated probabilities using Laya

0·GitHub repo

laya-plugin

theo-odore

Routes coding-agent tasks to models based on task type and complexity

0·GitHub repo

laya-desktop-agent

royaldynamo128-gif

Runs a local voice desktop agent with Convai Laya as a decision-routing component

0·GitHub repo

laya-rhoai-demo

rrbanda

Routes cross-border data using Laya classification, policy rules, and Gemini explanations

0·GitHub repo

laya-auto-mode

tuncer-byte

Adds Laya-powered automatic model routing to the GitHub Copilot Chat model picker

0·GitHub repo

llama-mcp-router

u9401066

Routes requests to relevant MCP tools using Laya and BM25 selectors before forwarding them to llama-server

0·GitHub repo

Laya

SaYm0n

Uses Laya as a local decision engine and routes uncertain cases to language models or human reviewers

0·GitHub repo

laya-react

dungdq4

Implements a React demo of Laya's typed decision patterns for routing, filtering, and moderation

0·GitHub repo

laya-pipeline

trifleen

Uses Laya to route, compress, and check requests sent to local language models

0·GitHub repo

jev-laya-dsh

alexdoandev

Adds a local Laya decision layer for routing prompts and gating risky agent actions

0·GitHub repo

intent-router-laya

anujgupta9860

Routes queries to worker agents using self-hosted Laya, with optional training and review

0·GitHub repo

laya-incident-triage

curtiscovington

Evaluates Laya against rule-based and trained baselines for incident triage and routing

0·GitHub repo

litellm-gemini-laya-router

derrickqin

Uses a local Laya model to route coding-agent requests to Gemini models on Vertex AI

0·GitHub repo

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_task MCP 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