Instructions to use ahmedandaloes/laya-CoreAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Laya
How to use ahmedandaloes/laya-CoreAI with Laya:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
laya β Apple Core AI conversion
Community conversion of convaiinnovations/laya to an Apple
Core AI .aimodel bundle, runnable on macOS 27 on Apple Silicon.
Laya is a non-autoregressive System 1 decision model: it takes a state and typed questions and
returns typed answers with calibrated probabilities in one forward pass. It never generates
text. That maps onto a Core AI graph exactly β one DecisionModel.forward, no KV cache, no
decoding loop β so the whole model is a single exported program here.
Use
pip install -r requirements.txt
import asyncio
from laya_coreai import LayaCoreAI
async def main():
model = await LayaCoreAI.load(".")
result = await model.predict(
state="Hi, we were billed twice for March. Please refund the duplicate today.",
questions={"department": {"type": "choice",
"instructions": "Which department should handle this?",
"criteria": {"billing": "invoices, payments, refunds",
"technical": "bugs, outages, system errors"}}},
)
print(result["answers"]["department"]["choice"]) # billing
asyncio.run(main())
The laya package is used for tokenization, question normalization and answer decoding, so the
prompts are byte-identical to the PyTorch path. Every neural forward pass runs through Core AI.
Shape
- One request per forward pass, padded to a fixed 512-token / 192-option-marker
graph. A request that does not fit raises
CapacityErrorβ nothing is silently truncated. - Host tensors are int32 (the Core AI runtime's integer type) and the marker mask is bool.
- Weights are the original FP32 encoder and decision head; nothing is quantized.
- The act head is exported too, but upstream reports its signal is not usable yet (issue #185),
so treat
act_logitsas present-for-completeness rather than something to gate on.
Numerical drift
Measured against Laya's own runtime on the same machine β the reference is the package's eager PyTorch forward fed the identical tensors, built with build_sequence, so the only difference is the conversion itself.
- 6 cases (choice, noul, score) β all selected answers matched: True
- largest absolute probability difference: 0.000001
This measures conversion drift only. It is not a benchmark of Laya's accuracy or calibration; see the upstream model card and issues for those.
Files
decision.aimodel/β the exported Laya forward (encoder + typed head + scorer + act head)laya_coreai.pyβ host adapter: tokenize, normalize, pad, call, decodemanifest.jsonβ source repo, pinned revision, shapes, precision, input/output namestokenizer/,encoder/config.json,config.json,rl_agent_config.jsonβ the checkpoint's own host-side files, including the shipped calibration temperaturesvalidation.jsonβ the measurement below, case by case
Independent community conversion β not an official Apple or Convai release. Converted on macOS 27.0.1 with coreai-core 1.0.0b3 / coreai-torch 0.4.3.
- Downloads last month
- 11
Model tree for ahmedandaloes/laya-CoreAI
Base model
convaiinnovations/laya