Skip to content

feat(release): bundle the code embedding model in release binaries - #763

Merged
ajianaz merged 1 commit into
developfrom
feat/bundled-model
Nov 16, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/bundled-model

Conversation

@ajianaz

@ajianaz ajianaz commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

What

  • New cargo feature bundled-model (off by default). With it the three potion-code-16M-v2 files are compiled into the binary (include_bytes! from CORA_BUNDLED_MODEL_DIR); model_store::ensure installs them into the data directory on first use: size and SHA-256 verified against the pinned values, written to a temporary directory and renamed in one step, under the same lock as a download. No network, so CORA_EMBED_OFFLINE=1 works.
  • scripts/fetch-model.sh fetches the pinned files and verifies their hashes. The release workflow runs it, builds with --features tree-sitter,bundled-model, and smoke-tests the binary with CORA_EMBED_OFFLINE=1 and an empty data directory (index, then cora brain must return the symbol with a vector signal) on all four platforms.
  • A unit test keeps the script's pins identical to model_store; the Check CI job also compiles the feature (with the tiny fixture model).
  • crates.io builds are unchanged (no bundle, 10 MB package limit): cargo install still downloads once.
  • Docs (README, installation, configuration) and the changelog say what a release binary contains.

Why

A fresh download of cora should work right away, offline or behind a firewall, instead of silently turning the vector signal off until the model can be downloaded. Closes #761.

Testing

  • cargo fmt --all -- --check, cargo clippy --all-targets --features tree-sitter -- -D warnings, and clippy with bundled-model (fixture model) clean; cargo test: new unit tests cover a verified atomic install, idempotence, a corrupted or incomplete bundle (refused, nothing left behind) and the script pins.
  • Real run: release build with the real model (bundled-model, 69 MB binary, about 38.5 MB as tar.gz against 8 MB without) in an empty data directory with CORA_EMBED_OFFLINE=1: cora index unpacked the model into models/potion-code-16M-v2/, wrote the vector file, and cora brain "send a network request" returned send_request_to_server with fts and vector signals. A second run reuses the unpacked model.
  • Not run here: the release workflow itself (it needs a tag); its fetch step and smoke test mirror the commands above.

Generated by Claude Code

New bundled-model feature compiles the pinned potion-code-16M-v2 files into the
binary; the first use installs them into the data directory, verified, with no
network. The release workflow fetches the files with scripts/fetch-model.sh and
smoke-tests the binary offline with an empty data directory.

Refs #761.
@ajianaz
ajianaz merged commit 3474bc7 into develop Nov 16, 2026
13 checks passed
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.

feat(release): bundle the code embedding model in the release binaries so a fresh download works offline

1 participant