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

inematds

A Portuguese triage application wraps Laya with a local interface, API, CLI, and reproducible evaluation

0·GitHub repo

jev-laya

wuzhiping

Probes the multilingual Laya model on Apple Silicon and records machine-readable inference results

0·GitHub repo

laya-bot-det

koteitan

Classifies Nostr authors as bots with Laya running in the browser

0·GitHub repo

laya_filter

plitenh

Collects and annotates Laya-powered news decisions for corpus building and regression training

0·GitHub repo

system-one-api

jrmmendes

Exposes Laya for probabilistic text classification through a REST API

0·GitHub repo

laya-demo

tjpajala

Benchmarks Laya and Open-Jev on JevBench and PubMedQA with a Dockerized comparison interface

0·GitHub repo

claude-laya

jverhoeks

Scores local Claude Code session transcripts with Laya

0·GitHub repo

laya-email

sreekar2403

Tags Gmail messages locally with five Laya-powered classifications in one pass

0·GitHub repo

laya-crystalball

InteractiveNinja

Wraps Laya typed-choice inference in a FastAPI service with calibrated confidence and option probabilities

0·GitHub repo

Laya-test

LouisMoretti

Runs Laya locally for message classification and benchmarks its server and prediction performance

0·GitHub repo

laya-ems-test

frahlg

Tests Laya as a decision controller in a simulated Swedish home energy system

0·GitHub repo

sag-laya-integration

DATN-SPRING2027

Integrates a local Laya router into the SAG application for question classification

0·GitHub repo

laya-mlx-demo

knishika62

Uses laya-mlx to classify Japanese virtual streamer personas and compare results with an LLM

0·GitHub repo

laya_ai-test

sirogarasu

Runs Laya multilingual inference in a CUDA-enabled Docker environment

0·GitHub repo

jev-vs-laya

mouadse

Benchmarks hosted Jev, Kev-9B, and Laya on Moroccan Darija sentiment classification

0·GitHub repo

Laya_IAB_domain_classification_demo

BeeboLab

Classifies web-search entities into IAB domains using Laya and hierarchical taxonomy traversal

0·GitHub repo

omp-marketplace

F0Rextasy

Lists a local System-1 judge plugin for the oh-my-pi marketplace

0·GitHub repo

IOCArena

hc-nolan

Compares Jev, Von, and Laya decision models on VirusTotal data

0·GitHub repo

slop-finder

Code-Wizard-Wilson

Detects AI-like writing styles in social feeds using a local Laya-MLX helper

0·GitHub repo

before-you-send

roisol144

Checks message tone, formality and fight risk while users type, using Laya decisions

0·GitHub repo

mailaya

htpu

Uses a local Laya model to triage email, flag phishing, and check drafts in a browser extension

0·GitHub repo

job-classifier-search

NoNFake

Ranks Danish job listings against a candidate profile using the Laya decision model

0·GitHub repo

laya

Yahia-Raouf

Provides a self-hosted Laya inference API, key management, and an administration portal

0·GitHub repo

laya

pgarvie

Provides multilingual typed-decision models and a router for single-pass inference

0·GitHub repo

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