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

god-llm-decisions

surajvs2710-stack

A decision engine fuses Laya and Jev predictions with confidence weighting and auditable logs

1·GitHub repo

laya-studio-node

ajayjha1

Provides a Node.js and TypeScript toolkit for Laya classification, routing, CLI, and MCP use

1·GitHub repo

jevtpp

wiatrM

A C++20 library for typed model-backed decisions with optional ONNX Runtime and native Laya backends

1·GitHub repo

design-os-generative-ui

jangtrinh

Builds a generative UI engine using local Laya-MLX decisions and a TypeSafe JEV cascade router

1·GitHub repo
I

pi-laya-model-router

izolight

Routes Pi sessions to mapped models using task classifications from a local Laya server

145·npm package

laya-router

MiguelCarrascoB

A FastAPI router uses Laya typed decisions to route prompts by complexity

0·GitHub repo

laya-assist-proxy

dwyschka

A local Home Assistant bridge that classifies voice commands with Laya and routes uncertain requests to an LLM

0·GitHub repo

calibrated-decisions-iot-demo

javierdv7

An interactive smart-home demo compares local Laya inference with Jev using shared rules

0·GitHub repo

laya-hermes

pavlealeksic

Adds Laya decision tools, routing hints, and output filtering to the Hermes Agent

0·GitHub repo

laya-codex-triage

kanottonp

Evaluates local Laya recommendations for model tier and reasoning effort in Codex

0·GitHub repo

dsh-laya-router

ricardochen1996

Routes agent requests using a local Laya-MLX typed-decision model

0·GitHub repo

sag-laya-integration

DATN-SPRING2027

Integrates a local Laya router into the SAG application for question classification

0·GitHub repo

jev-skill-laya

applex250

Adapts Jev skills to use a local Laya decision API as their sole backend

0·GitHub repo

laya-routing-and-descision-making

khursheed33

Serves Laya predictions and routing decisions through a FastAPI service

0·GitHub repo

layaagent

rotsl

Routes tasks through Laya classification and deterministic mediation to local or API-based coding agents

0·GitHub repo

laya-genui

KevinBermudezC

Routes generative UI components and detects urgency with the Laya decision model

0·GitHub repo

laya-ai

vincent1986

Adds local Laya predictions to agent workflows for intent classification and tool routing

0·GitHub repo

laya-demo

clonekim

Provides a local server and browser interface for classifying text with Laya

0·GitHub repo

agentify-laya

hongyaok

Serves local Laya classifications through an OpenAI-shaped HTTP API and usage dashboard

0·GitHub repo

laya-agents

lesterppo

Integrates local Laya typed-decision tools into Hermes Agent and Muse for classification and routing

0·GitHub repo

laya-it-triage

m4rtian

A planned enterprise ticket-triage project and learning roadmap centered on Laya decisions

0·GitHub repo

laya-agent-skill

HunterXing

Provides agent integrations for typed decisions through Laya-compatible APIs

0·GitHub repo

laya-answer-router

ramb5144

A Chrome side panel and MCP bridge use local Laya to route page questions to OpenAI models

0·GitHub repo

laya-zh-eval

lzero07

Evaluates Laya checkpoints on Chinese skill-routing requests

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.

More ways to use Laya