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

jeff-laya-routing-study

tiw

Compares Jeff and Laya for sub-agent routing using a stacking model and confidence cascade

0·GitHub repo

jev-lens

xi029

A local workbench uses Laya, Jev, or Ollama to inspect RAG evidence decisions and replay policies

0·GitHub repo

reflex

priyansh19

A decision gateway combines Laya or Jev decisions with LLM escalation and human guardrails

0·GitHub repo

ai-frontend-guide-kit

urben88

Provides a reusable UI catalog and guided workflow with optional local Laya ranking

0·GitHub repo

laya-mcp

kaysermagnus

Exposes Laya typed decisions as MCP tools for agents, reranking, relevance gating and model routing

0·GitHub repo

jev-router-mcp

humayunkabir

An MCP server routes questions to tools through a Jev-compatible decision engine, including Laya

0·GitHub repo
C

n8n-nodes-ollaya

cogniwork-fr

An n8n node that routes workflow items using typed decisions from Ollaya or TypeSafe AI

0·npm package
K

calvino-laya

kevago

Banking customer-service decision engine with Laya multilingual as the System 1 classifier

0·HF Space

laya

mes1234

Provides a Python implementation of the multilingual Laya typed-decision model

0·GitHub repo

laya-seo

tomwugdgz

Audits websites for SEO using a local Laya model as a gate before escalating uncertain judgments to Jev

0·GitHub repo

laya-banking77

hari-hashing

Evaluates Laya decision-model classification and routing on the Banking77 intent dataset

0·GitHub repo

laya-agent-gateway

JohnGF

A local Laya gateway routes prompts and session modes for AI coding agents

0·GitHub repo

SmartCart-Laya

sanjanabhat846

A Flask-backed dashboard uses Laya to evaluate e-commerce promotions, order urgency, and manual-review decisions

0·GitHub repo

hybrid-decision-agent

musaugurlu

Tests a Laya-first agent architecture that routes requests to Gemini Flash and benchmarks its performance

0·GitHub repo
S

kronos-laya-engine

sdfafe

Combines Kronos forecasts with Laya decisions to produce crypto trading signals

0·HF Space

laya-decision-models

YunfanKang

Demonstrates and fine-tunes Laya for routing and tool selection in I-GUIDE AI

0·GitHub repo

RightDesk-Laya

Supankan

Evaluates support-request routing workflows with a local Laya inference adapter and baseline comparisons

0·GitHub repo

decision-model-benchmarks

asopitech-publishing

Benchmarks decision models including Laya and Jev on Japanese routing and support classification tasks

0·GitHub repo

jev-laya-model-use-cases

shridhar-galande

Jupyter notebooks demonstrate Jev and Laya for classification, routing, security checks, and business workflows

0·GitHub repo

smart-request-router

Leito2

A Python request router uses Laya for routine decisions and escalates hard cases to a LangGraph agent

0·GitHub repo

TypeSafe-Agent

Abhii-04

LangGraph agent that uses laya.Router to route between chat, Gmail, web and local tools

0·GitHub repo

laya-router

boss2236

Suggests intended terminal commands and apps using edit distance and the Laya decision model

0·GitHub repo

laya-support-ticket-triage

jilanikashif375

Demonstrates Laya-based classification, routing, and scoring of customer-support messages

0·GitHub repo

NLP-Support

decooding

Classifies and routes support tickets with Laya and escalates complex cases to Gemini

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