DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to export a fresh ONNX bundle from a newer Laya checkpoint with Laya

Rebuild the ONNX bundle from the Hugging Face checkpoint and check it against PyTorch.

Short answer: Run cd export and then uv venv -p 3.12 .venv in the cloned repo; then run uv pip install -p .venv/bin/python torch transformers safetensors onnx onnxscript onnxruntime huggingface_hub to install the export dependencies; run the snapshot_download('convaiinnovations/laya', local_dir='model', ...) command from the README to fetch the checkpoint. All steps.

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

  1. Run cd export and then uv venv -p 3.12 .venv in the cloned repo.
  2. Run uv pip install -p .venv/bin/python torch transformers safetensors onnx onnxscript onnxruntime huggingface_hub to install the export dependencies.
  3. Run the snapshot_download('convaiinnovations/laya', local_dir='model', ...) command from the README to fetch the checkpoint. (inferred, check the README)
  4. Run .venv/bin/python export_onnx.py model ../onnx and check that the printed max logit difference is about 1e-5.
  5. Call Laya.load({ modelDir: "./onnx" }) and run LAYA_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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer