Open Source
Explore the latest AI open-source projects from GitHub and HuggingFace.
Explore the latest AI open-source projects from GitHub and HuggingFace.
Laya is a non-autoregressive 'System 1' decision engine that answers typed choice, score, and yes/no ('noul') questions over any text or JSON state in a single forward pass, released under the Apache-2.0 license and installable from PyPI (pip install laya) or as the laya-ts TypeScript package for Node and the browser. It ships three checkpoints: laya, a 421M-parameter ModernBERT-large encoder with a 512-token context for English; laya-multilingual, a 322M-parameter mmBERT-base encoder with a 1,024-token context covering 100+ languages at roughly twice the speed; and laya-typed-decisions, a 421M ModernBERT-large checkpoint tuned for typed-decision workflows. A built-in Router detects the input's script and language in under 0.5 ms and dispatches to the matching checkpoint, returning routing metadata that explains the choice. On the project's own 17,416-question benchmark (single T4 GPU, identical questions per model), routing lifts MASSIVE intent accuracy on 13 non-English languages from 0.306 (English-only checkpoint) to 0.451, and XNLI accuracy on 14 non-English languages from 0.521 to 0.731, while the English checkpoint alone reads only 23 of 51 languages above 3x random accuracy versus 45 of 51 for the routed setup; on non-Latin scripts such as Khmer, the English checkpoint scores 0.000 accuracy at 0.952 confidence, which the README cites as evidence that confidence alone cannot substitute for routing. Measured on the same T4 GPU, one routed question takes 32.8 ms and a batch of ten takes 72.3 ms total (7.2 ms/question); in the default lazy mode, switching languages after each language's first load adds only detection overhead (under 1 ms), while preloading all checkpoints removes model reloads entirely. Training uses Reinforcement Learning for Calibrated Decisions (RLCD) against strictly proper scoring rules, and because Laya scores predefined answers rather than generating free text, the project describes it as having nothing to parse and nothing to hallucinate. Version 0.3.11 adds Router.predict_batch for routing and batching heterogeneous requests together, opt-in prediction hooks for auditing, tracing, redacting, caching, or gating results, and a hardened self-hosted HTTP server (laya-serve) with timing-safe API key checks. The project also ships a command-line tool, an optional MCP server, LangChain/LangGraph integrations, and native ARM64/DGX Spark container builds.