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

Smart-Support-Ticket-Classifier-Using-Laya

affanhyder-diggit

Routes support tickets with Laya and benchmarks the results against a Gemini-only pipeline

0·GitHub repo

Reflex

dimpu47

Routes infrastructure alerts using Jev or local Laya decision model APIs

0·GitHub repo

Intelligent-Email-Routing-at-Local-Speed-Using-Laya

hasif154

Uses Laya to route emails with typed decisions and a checkpoint-selecting router

0·GitHub repo

KVev

AdudodlaVarish

Serves cached long-document chat and uses Laya for offline routing experiments

0·GitHub repo

jgent

Sube-py

Routes on-demand tool access in Pi using Jev or a local Laya model

0·GitHub repo

Wayfinder

manish-9245

Serves Laya decisions through an HTTP gateway with policies, a web console and an MCP server

0·GitHub repo

model-router

gbaeke

Routes prompts to inexpensive or powerful language models using Laya complexity decisions

0·GitHub repo

sparky-reflex

Applied-AI-Solutions-hub

Routes desktop app messages locally with the Laya decision model through a Windows service

0·GitHub repo

leanroute

kdandu001-arch

Provides a Laya-powered decision SDK and gateway for blocking attacks and routing LLM requests

0·GitHub repo

laya

HydriaOne

Serves Laya routing predictions in Docker and includes an offline scenario inspector

0·GitHub repo

Laya

samyakb32-sys

Routes requests to prompt-configured task sub-agents using the Laya model on CPU

0·GitHub repo

Laya-Firehose

AdityaRawat00189

Ingests incoming data, classifies it with Laya, and routes items by urgency

0·GitHub repo

laya-integration

SanjaySathish

Routes Claude Code tasks to Claude tiers using a locally served Laya decision model

0·GitHub repo

laya-ecosystem

MiguelFAraujo

Provides utilities for supervision, context compaction, search, and UI decisions using Laya and Jev

0·GitHub repo

laya-studio

felix-homelab

Wraps Laya in a web panel for schema authoring, evaluation, automation, and calibration monitoring

0·GitHub repo

Laya_wrapper

ugelucero

Wraps Laya checkpoints in a command-line tool and FastAPI service for request routing

0·GitHub repo

laya-call-router

riefer02

Demonstrates fine-tuned Laya decisions in an inspectable dealership call-routing workflow

0·GitHub repo

laya-code-router

SupremeDreamZ

Routes Claude Code and Codex turns using a local Laya model

0·GitHub repo

pi-laya-router

codenamekt

Routes Pi coding-agent prompts to mapped models using a local Laya intent classifier

0·GitHub repo

laya-v2-agent-routing

mdad-elec

Fine-tunes a Laya System-One router to select the price tier for each agent turn

0·GitHub repo

intents

ezeike

Documents and sketches decision-model patterns for routing user input to application actions

0·GitHub repo

synthetic-ehr-decision-evals

MadCodeTX

Benchmarks decision models on synthetic EHR administrative-routing tasks

0·GitHub repo

handoff

kingd2925-beep

A local router learns from chat history to direct requests to cheaper or stronger models

0·GitHub repo

nexus-decisor-laya

janiojandson

A JavaScript Nexus decision component built around the Laya System 1 model

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