Who it is forA machine learning engineer who needs a bundle from a newer checkpoint or a variant that is not published under receptron/laya-onnx.
The problemThe published bundle may lag the upstream checkpoint, and a custom variant cannot be used without an export.
The outcomeA local ./onnx folder with the five bundle files, verified to match PyTorch to within about 1e-5 in max logit difference, that Laya.load() can read.
What you need first
- Node.js 20 or newer
- About 2 GB of RAM for the loaded model, plus a few hundred MB per batch of questions
- About 1.7 GB of free disk space for the ONNX weights cached under ~/.cache/receptron-laya
- Network access to Hugging Face for the first download
Steps
- Run
cd exportand thenuv venv -p 3.12 .venvin the cloned repo. - Run
uv pip install -p .venv/bin/python torch transformers safetensors onnx onnxscript onnxruntime huggingface_hubto install the export dependencies. - Run the
snapshot_download('convaiinnovations/laya', local_dir='model', ...)command from the README to fetch the checkpoint. (inferred, check the README) - Run
.venv/bin/python export_onnx.py model ../onnxand check that the printed max logit difference is about 1e-5. - Call
Laya.load({ modelDir: "./onnx" })and runLAYA_MODEL_DIR=./onnx yarn example.
Prompt for your agent
In the receptron/laya repo, follow the export section of the README to build an ONNX bundle from convaiinnovations/laya into ../onnx. Expected output: the export script prints a max logit difference against PyTorch that is about 1e-5 and the five bundle files exist. Verify by running `LAYA_MODEL_DIR=./onnx yarn example` and confirming it completes.
Caveat. The README notes that the published bundle uses a different temperature for choice questions with 11 or more options than the upstream checkpoint, so a rebuilt bundle will not match published confidences unless you keep the same calibration values.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for receptron/laya and "Export a fresh ONNX bundle from a newer Laya checkpoint"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer