Skip to content

fix(prebuild): do not embed the 142 MiB AIST model in published Node addons - #13

Merged
gabewillen merged 1 commit into
mainfrom
fix/disable-aist-embed-in-prebuilds
Aug 18, 2026
Merged

gabewillen merged 1 commit into
mainfrom
fix/disable-aist-embed-in-prebuilds

Conversation

@gabewillen

Copy link
Copy Markdown
Contributor

The six-host release matrix now produces verified addons, but the npm
tarball is 541 MB because CORTEXT_EMBED_AIST_MODEL defaults ON and the
Unix addons each bake in the ~142 MiB AIST GGUF (MSVC cannot .incbin, so
Windows stays ~4 MB). npm publish then fails with ERR_STRING_TOO_LONG
(and the registry would reject a 541 MB package anyway).

Published Node addons should be thin bindings. The model is loaded at
runtime, not vendored in the npm tarball. This passes
-DCORTEXT_EMBED_AIST_MODEL=OFF and -DCORTEXT_FETCH_AIST_MODEL=OFF to the
prebuild CMake configure.

Copilot AI lite review requested due to automatic review settings August 18, 2026 03:21
@gabewillen
gabewillen merged commit 13f735c into main Aug 18, 2026
6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the prebuild pipeline to ensure published Node addons are “thin” bindings by preventing the AIST GGUF model from being embedded or fetched during the CMake configure/build step, avoiding oversized npm tarballs and publish failures.

Changes:

  • Pass -DCORTEXT_EMBED_AIST_MODEL=OFF and -DCORTEXT_FETCH_AIST_MODEL=OFF when configuring CMake for prebuild addons.
  • Extend the prebuild script provenance/contract test to assert those flags are present in the build script.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/prebuilds.test.mjs Adds assertions ensuring the prebuild script includes the new CMake flags.
scripts/build-prebuild.mjs Adds the new CMake configure flags to disable embedding/fetching the AIST model.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 289 to 292
"-DCORTEXT_GGML_OPENMP=OFF",
"-DCORTEXT_EMBED_AIST_MODEL=OFF",
"-DCORTEXT_FETCH_AIST_MODEL=OFF",
"-DCORTEXT_NODE_EXECUTABLE=" + args.node,
Comment on lines +290 to +291
"-DCORTEXT_EMBED_AIST_MODEL=OFF",
"-DCORTEXT_FETCH_AIST_MODEL=OFF",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants