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

LayaMail

Theani7

Prioritizes email locally by applying typed Laya decisions to messages

0·GitHub repo

layarank

akashmitra

Filters and reranks search results locally using Laya neural routers

0·GitHub repo

MedLaya

0xcemkurt

Adapts the Laya decision engine for clinical triage, routing, urgency scoring, and red-flag detection

0·GitHub repo

laya-experiments

RafaelJaime

Spanish notebooks evaluate Laya decision behavior, diagnostics, message routing, and product recommendation

0·GitHub repo

laya-jev-homeautomation

CoryHawkless

A home-automation command router and benchmark harness exercises Laya

0·GitHub repo

laya-ollama-demo

pyardley

Routes support tickets with Laya and uses Ollama to draft replies when needed

0·GitHub repo

herdr-laya-router

candidosales

Routes coding tasks to AI agents using a local Laya classifier

0·GitHub repo

toolhint

pedrocr83

A local Laya classifier ranks skills, connectors, and tools for coding prompts

0·GitHub repo

evidence-gate

AnotherMeatsack

A local workbench for evidence review, task routing, MCP tools, and reproducible Laya evaluations

0·GitHub repo

dsh-decision-layer

xbzbing

A structured decision plugin for DeepSeek Harness with configurable Jev-compatible backends

0·GitHub repo

Tiyakaloud

herveyyy

A Python server uses Laya and ModernBERT for support triage, classification, scoring, and routing

0·GitHub repo

laya-server

criguex

A local Jev-compatible server runs Laya and can cascade uncertain decisions to Jev

0·GitHub repo
N

laya-trial

ngdghfdc

Tests Laya as a choice and confidence router for exam-processing pipelines

0·HF Space

laya-router

Kaytm93

Routes requests to OpenAI-compatible models using local decisions from Laya

0·GitHub repo

laya-plugin

Andrei-cloud

Provides an offline Laya decision plugin for coding agents through MCP and native integrations

0·GitHub repo

laya-orchestrator

emanuelediluzio

Combines Laya decisions with code-generation models to orchestrate autonomous software development

0·GitHub repo

laya-gateway

amanjoshi2002

Uses Laya to classify prompt safety and route prompts to suitable models

0·GitHub repo

laya-fast-router

pramitsaha123

Demonstrates using Laya to route customer-support requests by department, urgency, and cancellation risk

0·GitHub repo

laya-opencode-router

Wauuuuuu

A macOS OpenCode plugin routes tasks using local Laya classification and optional MLX models

0·GitHub repo

s1cap

Jaffe2718

Uses System-1 decision models to manage agent context recall and rank candidate plans

0·GitHub repo

laya-langchain-examples

nkon123

Provides offline LangChain and LangGraph examples for using Laya to classify, route, and guard text

0·GitHub repo
G

laya-demo

gen24AI

Demonstrates Laya decision workflows for routing, triage, guardrails, RAG filtering, and moderation

0·HF Space
S

laya-demo

Slothwolf

Demonstrates typed decisions, multilingual routing, triage, guardrails, RAG filtering, and moderation with Laya

0·HF Space

laya-router

suradisworkspace

Routes Claude Code turns between model tiers using a local Laya classifier

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