# Share local indexes

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/air/llms.txt).

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.

<a id="share-point-prerequisites"></a>

## Prerequisites

A share point works with [local storage](https://www.jetbrains.com/help/air/context-local-storage.html.md) only. You need the following:

* `git` and [Git LFS](https://git-lfs.com) 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.

<a id="set-up-share-point"></a>

Procedure: Set up a share point

1. Create a Git repository for the indexes on a host that supports Git LFS.

2. In the project directory, set the repository URL as the share point and switch the project to local storage:

```BASH
jbcontext config set --shared share.url git@github.com:example-org/jbcontext-indexes.git
jbcontext config set --shared storage local
```

The 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.

3. Index the project and publish the index:

```BASH
jbcontext index
jbcontext share push
```

`share push` publishes the index of `HEAD`. You can run both commands in a CI job. By default, the share point keeps the 10 most recently published revisions of the repository.

4. On the other machines, run `jbcontext index` in 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.

> **Note:**
> Run this command manually on each machine. Session hooks don't create the first index and don't download a shared one into a repository that has no index yet.

<a id="how-indexing-uses-share-point"></a>

## 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](https://www.jetbrains.com/help/air/context-cli-reference.html.md#ref-share).

