Text classification with Laya

A Laya `choice` question is a zero-shot classifier. You name the labels, optionally describe each one, and get the top label with a probability for every option in one forward pass. Labels are defined at request time, so there is no training step to get started.

252 projects

A

laya-multilingual-typed-decisions

alfred361

Fine-tunes the Laya multilingual model on a typed-decisions dataset

3·HF model

zero-shot-ie-bench

umstek

Compares Laya and other zero-shot systems across information-extraction and classification tasks

3·GitHub repo

runtime-tutorials

Runtime-weekly

Provides runnable Python guides for Laya classification and a comparison of Laya with other systems

3·GitHub repo

Laya-Showcase

zamax14

Demonstrates and benchmarks multilingual Laya alongside Jev and GPT models

3·GitHub repo

jev-as-quant

jiayylu

Combines Laya and Jev with Claude in a quantitative research stack and evaluates trading experiments

3·GitHub repo

Laya

ljw98

Provides a local web console and HTTP API for running Laya typed-decision models

3·GitHub repo

chinese-laya

yanqiangmiffy

Fine-tunes Laya multilingual for Chinese typed decisions and evaluates the resulting checkpoints

3·GitHub repo

layaRustparser

guptchar

A Rust framework normalizes firewall logs and uses Laya for bounded triage

3·GitHub repo
A

laya-burmese-sib200

aungthuhein-dev

Fine-tunes Laya for calibrated seven-way Burmese topic classification on the SIB-200 dataset

2·HF model
T

laya-pt-es-typed

telepatia-ai

Fine-tunes multilingual Laya for typed decisions in Portuguese and Spanish

2·HF model

laya-onnx

gqgs

Exports the Laya model to quantized ONNX for browser inference

2·GitHub repo

laya-sdk

ryuzcorp

Provides a TypeScript SDK for running cached Laya decision models locally in browsers and Node

2·GitHub repo

laya-mcp

wsargent

Runs local Laya inference on Apple Silicon and exposes typed-decision tools through an MCP server

2·GitHub repo

laya-ara

ASNB-Smart-Solutions

Fine-tunes Arabic Laya models for NLU classification and short-list RAG

2·GitHub repo

laya.axera

AXERA-TECH

Exports and calibrates Laya models for AXERA NPU deployment

2·GitHub repo

laya-windows

Zuhair-01

Ports Laya typed-decision inference to Windows using ONNX Runtime and DirectML

2·GitHub repo

laya-search

giaphutran12

Searches YC companies using local Laya inference or the TypeSafe Jev API

2·GitHub repo

laya-rs

Fanaperana

Reimplements Laya in Rust for zero-shot text classification with verified numerical parity

2·GitHub repo

laya-demo

almodover

A local web app analyzes text and ebooks across 82 dimensions using Laya

2·GitHub repo

laya-candle

mannlohchab

Runs English Laya decision-model inference using the Candle framework

2·GitHub repo

openpave-jev

cnrai

Provides typed-decision commands for PAVE and Claude with local Laya and hosted Jev providers

2·GitHub repo
F

laya-multilingual-gguf

fr0stbit3

Provides F16 and quantized GGUF conversions of the multilingual Laya model for llama.cpp

665·HF model
W

laya-ara

Wouze

Fine-tunes multilingual Laya for Arabic intent classification, inference, and ranking

153·HF model
L

laya-LiteRT

litert-community

Converts Laya decision encoders into LiteRT graphs for Android GPU inference

152·HF model

Example

From the core README:

from laya import Router

router = Router()
questions = {
    "department": {"type": "choice", "instructions": "Which department should handle this?",
                   "criteria": {"billing": "invoices, payments, refunds",
                                "technical": "bugs, outages, system errors",
                                "other": "everything else"}},
}
result = router.predict("La aplicación se cierra cada vez que abro la configuración.", questions)
print(result["answers"]["department"]["choice"])  # technical

Each answer includes probabilities for every label and a confidence value you can gate on.

Label count matters

All options share a token budget (head_max_len: 192 on laya, 256 on the other two checkpoints). The README reports Banking77 (77 labels) at 0.425 for Laya against 0.870 for Jev on 72 labels, because each label gets only 3 to 4 tokens. Keep a question under about 20 options, or raise head_max_len, split into coarse and fine questions, or use predict_shortlist with embeddings.

Accuracy you can expect

  • The core README lists AG News 0.947 and DAIR Emotion 0.573 for the English checkpoint.
  • sysone-bench ran Laya and Jev on byte-identical inputs: AG News 0.940 vs 0.910, emotion 0.540 vs 0.550, and a 12-intent Banking77 subset 0.802 vs 0.906.
  • jevbench (dhruvmehra) compares Jev, Laya, LLMs, fine-tuned DistilBERT and zero-shot NLI on SST-2, AG News and Banking77.

Fine-tune when zero-shot is not enough

The base checkpoints score 0.362 and 0.352 on the README's typed-decisions benchmark. The fine-tuned laya-typed-decisions checkpoint reaches 0.766. The fine-tuning notebook runs on Kaggle's free 2x T4 GPUs.

Projects

ollaya serves Laya alongside zero-shot NLI and GLiClass classifiers behind one API. edgejev reports AG News accuracy for fp32 and INT8 CPU builds.

Caveats

The README warns against boolean-word labels such as yes/no or true/false in choice questions, and it reports failures on negated requests. Use descriptive labels and test on your own data.

More ways to use Laya