laya-coreml
Copyright 2026 laya-coreml contributors

This product includes software adapted from Laya (Apache-2.0):
https://github.com/NandhaKishorM/laya
Copyright Convai Innovations and Laya contributors.
Upstream source revision: 573e5b62696ba441230cd6be71d593331b5d23af

Prompt construction, tokenization, result formatting, validation fixtures,
the ModernBERT architecture implementation, and the Snake game, policy, terminal
UI, recording/export and benchmark tools are adapted from laya-mlx:
https://github.com/mizorewww/laya-mlx
Copyright 2026 laya-mlx contributors. Licensed under Apache-2.0.
Adapted revision: fc1df62828a3fedf4d8229fdac1cbd85f1cdf337
Changes: Core ML runtime, export-only PyTorch graph, fixed/ranged shape input
handling, Core ML validation, device planning, and performance measurement;
ANE graph/runtime, portable model bundles and offline Core ML Snake integration.

The model follows Laya's DecisionModel and Hugging Face Transformers ModernBERT.
Original checkpoint weights belong to their respective upstream authors and
are downloaded separately. No weights are included in this repository.
This is an independent project, not an official Convai Innovations or Apple release.

Selected prompt validation, noul labels, truncation diagnostics and answer-confidence
fixes synchronized through upstream 4aa6761be8173de4ce6d92c31b3e40b6eaf59a7c,
via laya-mlx ca5940aa9286dbbdfaacbecbdb7b337295ad36a2.
The architecture and model weights remain based on the original pinned revision.

Runtime routing, lifecycle synchronization, custom checkpoint registration,
confidence gating, tournament/shortlist decisions, language detection and email
cleaning synchronized through upstream 1adc59f7e371deb601fcfa18a14e25db238addcc
(v0.4.1), via laya-mlx 9f00d592fcf843753e6d3edd2eab63ec2b44f3c9.
Parallel option layout adapted for the export-only PyTorch graph and Core ML
input signatures. Existing sequential Core ML and ANE bundles remain supported;
parallel checkpoints require a matching newly converted general Core ML graph.

Version 0.4.0 host inference, routing, hooks, structured decisions, calibration,
confidence, shortlist, language, email, revision/integrity and framework integration
code is ported directly from official Laya v0.4.1 at
1adc59f7e371deb601fcfa18a14e25db238addcc, replacing the selective host port.
Adaptations: NumPy collation and fixed-shape Core ML transport; lazy optional
PyTorch fitting/training imports; converted-artifact resolution and context limits;
Core ML resource cleanup. See docs/UPSTREAM.md for compatibility boundaries.

Host behavior synchronized directly with official Laya v0.4.17 at
fe9a6c35023a7d94102e7feaaeaae8857d9d1b07, from the v0.4.12 baseline
ffc142012af63d015fa19f05f29f9c5ff329a2cc. Reviewed host regression and
attribution-helper adapter patterns also adapted from laya-mlx 0e8c0e51f8914908cc99591576ff1deeed205c82.
Core ML tensors, artifacts, compute units, compiled models and shape caches retain
their native implementations.

Host behavior synchronized with official Laya v0.4.34 at
80a1da1fa5448ea12163f4d977935625a0aea670 (Apache-2.0). The vegaml engine, media
readers and signed policies are not included. See docs/UPSTREAM.md for scope.

Host behavior synchronized with official Laya v0.4.35 at
b1d656952f0f9581ea691a70cb6f38abf3eb13a9 (Apache-2.0). That release changed
only upstream's TypeScript SDK, packaging and tests; no host code changed.

Host behavior synchronized with official Laya v0.4.37 at
d1282e791d71e92f24f816ff3836e4fd1c2ded4a (Apache-2.0). Releases v0.4.36 and
v0.4.37 changed only upstream's README, version strings and packaging; no host
code changed.

Host behavior synchronized with official Laya v0.5.0 at
182a4eb85b15b92391c3f8be093a92b6db83a722 (Apache-2.0). That release makes
vegaml's engine the default and re-exports vegaml's continuous learner; neither
is included, so the classic checkpoint stays the default here.

Host behavior synchronized with official Laya v0.5.1 at
090c540ec4cd0e5c71d539d952f0250e97399fcb (Apache-2.0). That release hardens
the vegaml policy manifest checks, which are not included here, and updates a
uvicorn log-level note and test.

Host behavior synchronized with official Laya v0.5.2 at
e150aa92a0d4059ac621875b39b620847cf1b88a (Apache-2.0). That release re-exports
vegaml's Escalator and vllm_teacher for the continuous learner; neither is
included here, and no host code changed.

Host behavior synchronized with official Laya v0.5.3 at
abefd7d955008a59287b0fa8c5753cb323307693 (Apache-2.0). That release adds
Spanish and Portuguese stopwords for short unaccented text, which are included
here, and translates vegaml choice labels back to the caller's labels, which is
not included.

Host behavior synchronized with official Laya v0.5.4 at
60a6ce910b4a2edb2b77e00d8fddeb24349610c8 (Apache-2.0). That release moves the
continuous learner (Learner, Escalator, vllm_teacher) to the separately
licensed vegaml-learn package; none is included here, and no host code changed.

Host behavior synchronized with official Laya v0.5.5 at
8f445c623453f7514f30fe958a73878296aea9af (Apache-2.0). That release changes only
upstream's README and version strings; no host code changed.

Host behavior synchronized with official Laya v0.5.8 at
3ae0152e3646563e2002839979bc4f739fc1e607 (Apache-2.0). That release labels
boolean choice options with their JSON spelling, omits structured choice
answers that name none of the field's options, and warns when laya-serve binds
a non-loopback address without LAYA_API_KEY; all three are included here. Its
removal of the continuous learner re-exports changes nothing here, where they
were never exported.
