Share local indexes
A share point is a Git repository with Git LFS, through which the Air Context CLI exchanges locally stored indexes. Anyone with push access to the repository can publish the index of a revision, and other machines download it instead of computing the embeddings for that revision again. Whoever can read the share point repository can use the indexes.
Prerequisites
A share point works with local storage only. You need the following:
gitand Git LFS on every machine that publishes or downloads indexes.Credentials for the share point repository that work without a prompt, such as an SSH key or a Git credential helper.
A Git remote in the project that you index.
Set up a share point
Create a Git repository for the indexes on a host that supports Git LFS.
In the project directory, set the repository URL as the share point and switch the project to local storage:
jbcontext config set --shared share.url git@github.com:example-org/jbcontext-indexes.git jbcontext config set --shared storage localThe commands save the settings to the project's .jbcontext.json file. The settings apply to everyone who works on the project only after you commit this file. Don't put a token or password in the URL.
Index the project and publish the index:
jbcontext index jbcontext share pushshare pushpublishes the index ofHEAD. You can run both commands in a CI job. By default, the share point keeps the 10 most recently published revisions of the repository.On the other machines, run
jbcontext indexin the project directory.The command checks the share point first. If it holds the index of the revision or of one of its ancestors, the command downloads that index and computes the embeddings only for what has changed since.
How indexing uses the share point
After the setup, jbcontext index keeps checking the share point:
A downloaded index replaces the local index of the repository, because indexes can't be merged. If the repository already has a local index, the command downloads a shared one only when it saves at least 50 commits of indexing.
If the share point can't be reached, the command indexes locally. To skip the share point for one run, add
--no-share.Shared indexes are kept separately for each embedding model. llama.cpp and MLX run the same model, so an index published with one runtime can be downloaded on a machine that uses the other. An index computed on the Air Context server can't be used with local inference, and the other way around.
For the commands that list, download, and delete shared indexes, see jbcontext share.