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
laya
ai-2-m
Provides a multilingual, non-autoregressive model for typed decisions in a single forward pass
laya-server
falk-werner
Serves Laya predictions through a local web server with prepared-question support
laya-laravel
maeandrew
Adds a Laravel AI classification provider that sends typed questions to a self-hosted Laya server
laya-test
jafs
Provides a web playground for testing Laya typed decisions on text or JSON
laya-studio
song-chaoyang
Provides a web interface for Laya inference, language detection, email tools, and shortlist demos
laya-agent
adhishthite
Benchmarks ConvAI Laya against TypeSafe Jev with and without live web grounding
laya-demo
clonekim
Provides a local server and browser interface for classifying text with Laya
agentify-laya
hongyaok
Serves local Laya classifications through an OpenAI-shaped HTTP API and usage dashboard
laya-kit
FrancyJGLisboa
Provides a local Python interface for Laya typed judgements and confidence calibration
laya-burmese
aungthuhein2005
Studies Laya zero-shot transfer, calibration, and fine-tuning for Burmese topic classification
laya-todo
firede
Classifies to-do items locally with Laya and compares its predictions with an optional Kev backend
laya-noul
samiwolf
Runs Laya yes/no decisions on customer-support statements and records calibrated results
obsidian-laya-tagger
tyPhoon-collab
Automatically tags Obsidian notes using the local Laya MLX typed-decision model
laya-trader-binance
XSirch
Builds leakage-aware crypto trading datasets and fine-tunes Laya for typed trading decisions
jev-vs-laya
janagarajsn
A Flask app benchmarks Jev and local Laya on synthetic customer-support tickets
laya-issue-triage
manyamkarthik
A fine-tuned Laya model triages GitHub issues using a CPU-ready GitHub Action
laya-jev-eval
yuvrajrox
Evaluates Laya against Jev on email intent and explores text generation with Laya’s backbone
laya-vs-llms
Ujjwal3115
Benchmarks Laya against hosted language models on developer commit triage and CI safety decisions
laya-support-ticket-triage
IshaanLabs
A local Laya system triages customer-support tickets and benchmarks results in an interactive dashboard
Laya-System-1-Model
JayanGupta
Showcases Laya for text classification, urgency scoring, and ticket triage with Hugging Face Transformers
salt
rtuszik
Scores messages from coding-agent transcripts with an on-device Laya model and produces reports
ai-update-radar-lab
starhunt
Tests Laya-based project relevance decisions and compares results with saved Jev evaluations
EmotionCat
kmu9842
A desktop Bongo Cat uses local Laya inference to change expressions based on typed text
yks-bench
UgurcanAkkok
Benchmarks local Laya checkpoints and hosted Jev on Turkish university entrance exam questions
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