{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "receptron-laya--bake-laya-weights-into-a-container-image",
 "repo": "receptron/laya",
 "repo_url": "https://github.com/receptron/laya",
 "repo_slug": "receptron-laya",
 "title": "Bake Laya weights into a container image at build time",
 "page_title": "How to bake Laya weights into a container image at build time with Laya",
 "summary": "Fetch the 1.7 GB ONNX bundle during the image build so containers start without a download.",
 "who": "A DevOps engineer deploying a Node.js service that uses Laya and needs fast, predictable container start-up.",
 "problem": "The first Laya.load() downloads about 1.7 GB, which can stall or fail a container health check at start-up.",
 "outcome": "A build step caches the weights, so a running container loads the model from the local cache and only sends a cheap freshness check.",
 "steps": [
  "Add `npm install @receptron/laya` to the image build.",
  "Add `node -e 'import(\"@receptron/laya\").then((m) => m.ensureBundle())'` as a build step so the weights are cached.",
  "Set `LAYA_CACHE` to a path that the runtime user can read if you want the cache in a fixed location.",
  "Pass `revision` with a commit hash to `Laya.load()` to pin the model version for reproducible results.",
  "Start the service and time the first `Laya.load()` call to confirm it reads from the cache."
 ],
 "agent_prompt": "In the receptron/laya repo, write a Dockerfile for a Node.js 20 service at <service-dir> that installs @receptron/laya and runs ensureBundle() during the build. Expected output: an image where the first Laya.load() in the container finishes without a network download. Verify by running the container with networking disabled and confirming that the model loads.",
 "agents": [
  "any"
 ],
 "difficulty": "Advanced",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "The README says the weights are about 1.7 GB in fp32 and the model needs roughly 2 GB of RAM, so size the container memory limit above that before deploying.",
 "category": "Work and operations",
 "tags": [
  "Work and operations"
 ],
 "lang": "typescript",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/receptron-laya/bake-laya-weights-into-a-container-image/",
 "md": "https://dedupedai.com/use-cases/receptron-laya/bake-laya-weights-into-a-container-image/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/receptron-laya--bake-laya-weights-into-a-container-image.json",
 "api_version": "v1"
}
