laya

A multilingual decision model library that makes choice, score and yes/no decisions over text in a single fast pass. It also includes a router that picks the right model per request, for classification and routing tasks.

Share on XLicense: Apache-2.0

Overview

Laya is a Python library for making typed decisions over text in a single forward pass, without generating tokens. It answers choice, score and yes/no questions in more than 100 languages, and the README quotes about 33 ms per request. A router picks the right checkpoint for each request, such as English or multilingual. You pass a piece of text and a set of questions, and get answers with probabilities. It installs with pip and has optional extras for an HTTP server, MCP, LangChain, LlamaIndex, CrewAI and ONNX.

Key features

  • Choice, score and yes/no decisions in one forward pass
  • Works across 100+ languages
  • Router selects the checkpoint per request
  • Optional extras: HTTP server, MCP, LangChain, LlamaIndex, CrewAI
  • TypeScript version in laya-ts

Best for

Developers building classification or routing steps, such as sending a support message to a department. Long documents need max_len set to 8192, and the README advises checking accuracy on your own data.

Upstream
NandhaKishorM/laya
Fork on GitHub
Guo-astro/laya
Upstream stars
28k
Category
AI agents and LLM tools
Language
Python
License
Apache-2.0
Forked
2026-09-22
Sync status
In syncLast synced 2026-09-29