Skip to content

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

Closed

Description

@ajianaz

What

Release binaries (GitHub Releases, install.sh, cora upgrade) should contain the potion-code-16M-v2 model, so a fresh download can index and search by meaning with no network. Today the first command that needs embeddings downloads 33.5 MB from Hugging Face; offline or behind a firewall the vector signal stays off.

How

  • New cargo feature bundled-model (off by default). With it, the three model files are compiled in (include_bytes! from CORA_BUNDLED_MODEL_DIR), and model_store::ensure installs them into the data directory on first use: size and SHA-256 verified against the pinned values, atomic, same lock as the download. No network, so CORA_EMBED_OFFLINE=1 works.
  • crates.io keeps the default (no bundle, 10 MB package limit); cargo install still downloads once.
  • scripts/fetch-model.sh fetches the pinned files and verifies their hashes; the release workflow runs it before building with --features tree-sitter,bundled-model and smoke-tests the binary offline with an empty data directory. A unit test keeps the script's pins identical to model_store.

Acceptance

  • A release-profile build with the feature indexes and answers cora brain with CORA_EMBED_OFFLINE=1 and an empty data dir.
  • Without the feature nothing changes.
  • Docs (installation, configuration, code-intelligence) and the changelog say what the release binary contains and its size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions