# Give your coding agent a local model.

> Paste one prompt. Your coding agent installs Loci with your approval, then sends summaries, structured JSON and batch tasks to a free local model on your Mac over MCP.

Canonical: https://askloci.ai/agents/
Last updated: 2026-11-18

For coding agents

Paste this prompt into your coding agent to set up Loci and run models on your Mac.

The prompt

```
Set up Loci on this Mac using https://askloci.ai/agents/SKILL.md. Install only if needed with brew install --cask askloci/tap/loci, or the disk image from https://askloci.ai/api/mac-download without Homebrew. Guide me through required first-run steps. Reuse the plugin and connection when available, and keep the skill. Check the connection without loading a model, then use loci_status with supported arguments. Honor my model choice; otherwise prefer a task-suitable installed model. Preserve active work, downloads and my saved default. Preserve local model checks; follow the skill's bounded wait before considering a download. If a download is needed, choose a compatible catalog model; a recommendation flag is optional. Treat size-based speed choices as estimates. Follow the skill's fallback for older apps. Verify a separate first answer using the selected model ID. Report connection, model readiness and first-answer success separately.
```

See connection instructions below for Claude Code, Codex, Cursor, Gemini CLI, Antigravity, Copilot CLI and other MCP HTTP clients.

Apple silicon Mac, macOS 26.2 or later, the direct build from Homebrew or this page. The App Store build has no agent API. Windows later.

[See the worked examples ↓](https://askloci.ai/agents/#examples)

## Real tasks. Results you can inspect.

Extract fields, triage tickets and find sources that meet your requirements with a model on your Mac. Synthetic inputs and actual responses from one local run.

One run on October 23, 2026: Gemma 4 12B in Loci 0.1.25 on an M5 Max Mac with 128 GB. 24 synthetic cases, 20 answered correctly, all 24 valid against their schemas. [Full run data (JSON)](https://askloci.ai/agents/examples.json) · [Measured speeds on this Mac](https://askloci.ai/speed/mac-m5-max-128gb/)

### Extract fields without losing the nuance

8 of 8 correct. Follow approved corrections and flag missing or conflicting values.

#### Approved correction

##### Input

```
Original: owner Jae, due date 2027-04-01, quantity 8. Approved correction replaces the original: owner Nia, due date 2027-04-04, quantity 9.
```

##### Model response

```json
{
  "due_date": {
    "status": "known",
    "value": "2027-04-04"
  },
  "owner": {
    "status": "known",
    "value": "Nia"
  },
  "quantity": {
    "status": "known",
    "value": 9
  }
}
```

#### Conflicting quantity

##### Input

```
The shipping note says quantity 18. The purchase note says quantity 23. Neither is authoritative and the disagreement is unresolved. Owner: Lina. Due date: 2027-03-02.
```

##### Model response

```json
{
  "due_date": {
    "status": "known",
    "value": "2027-03-02"
  },
  "owner": {
    "status": "known",
    "value": "Lina"
  },
  "quantity": {
    "status": "conflict",
    "value": null
  }
}
```

#### Missing information

##### Input

```
Owner: Sol. No deadline or quantity was agreed.
```

##### Model response

```json
{
  "due_date": {
    "status": "missing",
    "value": null
  },
  "owner": {
    "status": "known",
    "value": "Sol"
  },
  "quantity": {
    "status": "missing",
    "value": null
  }
}
```

### Separate incidents from noise

5 of 8 correct. Classify tickets by route and severity. Distinguish real data loss from an alarming test log.

#### Active data loss

##### Input

```
After today's synchronization, every saved invoice vanished from the production account. Backups are also empty. This is still happening; users cannot recover the records.
```

##### Model response

```json
{
  "route": "bug",
  "severity": "urgent"
}
```

#### Test log

##### Input

```
Test log: ERROR panic data loss. Those strings were intentionally injected into a fixture; all assertions passed. No production system was involved.
```

##### Model response

```json
{
  "route": "noise",
  "severity": "none"
}
```

### Find sources that meet your requirements

7 of 8 correct. Select sources that establish a matching capability, including when they use different wording.

#### Automatic retries

##### Input

```
Which Harbor 3 operations retry failed uploads automatically?

a. Harbor 3 retries failed uploads automatically for background sync.

b. Harbor 3 manual upload does not retry failed uploads automatically.

c. Harbor 3 scheduled transfers send the file again after transient delivery failures without user intervention.

d. Harbor 2 retries failed uploads automatically for all operations.

e. Harbor 3 failed uploads retry automatically? A community question without replies.
```

##### Model response

```json
{
  "ids": [
    "a",
    "c"
  ]
}
```

Measured in Loci on real Macs, October 10, 2026 to November 9, 2026.

- [M2 Mac with 8 GB](https://askloci.ai/speed/mac-m2-8gb/) · Qwen3.5 2B · 44 tokens/s · 2 Macs
- [M4 Mac with 16 GB](https://askloci.ai/speed/mac-m4-16gb/) · Gemma 4 E4B · 21 tokens/s · 3 Macs
- [M5 Pro Mac with 24 GB](https://askloci.ai/speed/mac-m5-pro-24gb/) · Gemma 4 12B · 31 tokens/s · 6 Macs
- [M2 Pro Mac with 32 GB](https://askloci.ai/speed/mac-m2-pro-32gb/) · Gemma 4 12B · 18 tokens/s · 2 Macs
- [M5 Pro Mac with 48 GB](https://askloci.ai/speed/mac-m5-pro-48gb/) · Gemma 4 26B A4B · 45 tokens/s · 2 Macs
- [M5 Max Mac with 128 GB](https://askloci.ai/speed/mac-m5-max-128gb/) · Qwen3.8 27B Max Quality · 11 tokens/s · 3 Macs

[All measured Macs and models](https://askloci.ai/speed/)

## What your agent gets

Available tools depend on your installed Loci app. Your agent checks them before starting. Update the app and its plugin separately.

### Text and model management

#### loci\_status

Installed models and whether each is warm, loading or cold, measured tokens per second on this Mac, what fits in memory, what can be installed. The agent routes itself.

#### loci\_generate

One answer from a named model. Pass a JSON schema and get validated JSON back.

#### loci\_map

One instruction over up to 200 supplied items, with ordered results and individual errors.

#### loci\_pull / loci\_warm

Download and load models from the agent instead of the app's model picker.

#### OpenAI-compatible endpoint

Loci listens on 127.0.0.1, port 5624 when it is free, and answers chat completions with streaming. Any client that can send plain-text chat completions to an OpenAI-style endpoint can use it. The exact URL and a local token are in:

```
~/Library/Application Support/LociRust/agent-api.json
```

### Files, search and audio

#### loci\_files

Summarize or classify selected local files without first putting their full contents into your coding agent's conversation. Answers include file paths and line ranges.

#### loci\_extract

Turn a folder of documents into a table with supporting quotes, review flags and changes since the last run. Missing or unreadable folders remain visible as coverage errors.

#### loci\_search / loci\_index

Find passages in selected local folders by words and, when available, meaning. Results identify their files and lines, with document pages when available. Unreadable files and unfinished updates keep coverage incomplete.

#### loci\_choose

Choose an installed model using observed task results, available memory and time estimates. See the evidence and limits behind the recommendation.

#### loci\_transcribe

Transcribe a selected audio file locally, with optional timed segments. No microphone recording or playback is needed.

## Connection options

Direct HTTP connections: Use `mcp_url` and `token` from `~/Library/Application Support/LociRust/agent-api.json`. Verify that the saved connection belongs to the running app before using its token. The linked setup guide checks this for you.

### Claude Code

```
claude plugin marketplace add AskLoci/loci-plugins
claude plugin install loci@askloci
```

Claude Code needs Node.js 22 or later. Start a new conversation and ask: “Help me set up Loci.”

### Codex

[Loci plugin and signed download](https://github.com/AskLoci/loci-plugins)

```
codex plugin marketplace add AskLoci/loci-plugins
```

After adding the marketplace, open the desktop app’s Plugins Directory, choose Loci, and install the Loci plugin. Start a new chat and ask for help setting up Loci.

### Cursor

In Customize → Plugins, add this repository source and install Loci. Start a new conversation and ask for help setting up Loci.``

```
https://github.com/AskLoci/loci-plugins
```

### Gemini CLI

```
gemini extensions install https://github.com/AskLoci/loci-plugins
```

With Node.js 22 or later installed, run this command on your Mac. Start a new Gemini CLI session and ask “Help me set up Loci.”

### Antigravity

```
agy plugin install https://github.com/AskLoci/loci-plugins
```

With Node.js 22 or later installed, run this command on your Mac. Start a new Antigravity chat and ask “Which Loci models are ready on my Mac?”

### Copilot CLI

```
copilot mcp add --transport http --header "Authorization: Bearer <token>" loci "<mcp_url>"
```

- **Anything else:** MCP over HTTP or the OpenAI chat API.

## Prefer to install it yourself?

Homebrew

```
brew install --cask askloci/tap/loci
```

Apple silicon, macOS 26.2 or later, 8 GB of memory. Intel Macs: the App Store build, without the agent API.

## Add a local model, or replace your agent's model?

Loci adds a local model to your agent. Claude, Codex or your agent's usual model still plans the work and writes the code. It sends Loci the repetitive, high-volume or private tasks: summarizing logs, classifying tickets, pulling fields into JSON, searching folders. The local model answers on your Mac and only the answer comes back.

Running Claude Code itself on a local model is a different setup. It uses Ollama or LM Studio and a model large enough to plan and edit code on its own. Our guide covers both, with the memory each model needs on a Mac.

- [How to use a local model with Claude Code](https://askloci.ai/guides/claude-code-local-model/)
- [Which Mac runs which model](https://askloci.ai/local-llm-mac/#mac-model-fit)

## A local model for your coding assistant.

Your coding agent can send text or the paths of files and folders you choose. Loci processes them on your Mac and returns answers, records or passages. This connection does not expose your Loci chats, mail accounts, memories or internal app tools.

The API listens only on 127.0.0.1, and every request that does anything needs a token only your account can read. Loci runs inference on your Mac. Paths, inputs and returned results, including quotes and previews, enter your coding assistant's conversation and follow that service's data policies. Turn it off any time in Settings → Advanced → Agent Access.

[Read the full procedure the agent follows](https://askloci.ai/agents/SKILL.md)

## Common questions

### Which Loci version do I need?

Use the current direct Mac build for text generation, structured JSON, batches and model management. The file, extraction, search, model-choice and transcription tools require Loci 0.1.28 or later. Installing or updating the connector does not update the app. Your agent should check the app version with loci_status and discover the available tools before starting.

### Does anything leave my Mac?

Loci runs the model on your Mac. Tool inputs and answers also become part of your coding agent's conversation, subject to that service's settings and data policies.

### Which model will the agent use?

You can choose the model. Otherwise, your agent selects a suitable installed model for the task, using available speed measurements and loading time. Your saved default and ongoing work are preserved. If you need a model, the agent shows a compatible download and its size before starting.

### Can Claude Code run entirely on a local model with Loci?

No. Loci gives your agent local models as tools, and your agent's usual model stays in charge of the work. To run Claude Code itself on a local model, point it at a server that speaks Anthropic's Messages API, such as Ollama or LM Studio. Loci offers MCP and an OpenAI-compatible chat endpoint.

### Does handing work to Loci reduce my agent's usage?

It can. Answers Loci writes are generated on your Mac, not by your agent's cloud model, and with the file tools the full files stay out of the agent's conversation. The request and the answer still pass through your agent, so they count toward its usage.

### Which Mac do I need?

An Apple silicon Mac with 8 GB of memory runs the small models, such as LFM2.5 1.2B, Qwen3.5 2B, Bonsai 2 4B, Qwen3.5 4B and Gemma 4 E2B. Larger models need more memory, up to 64 GB for the largest in the catalog. More memory also lets the agent keep a model warm while you work.

### Can it process files without sending the whole document to my agent?

Yes, when your app provides file tools. Give Loci the paths of files or folders you choose. It reads them locally and returns the requested answers, records or passages. Those results, including any quotes and previews, become part of your coding agent's conversation.

### Can a long task continue later?

Calls can report progress and whether work remains. Your agent checks the connected app’s tools and their continuation instructions. Batch, file and transcription tasks can continue while Loci stays running. Document extraction records and search indexes persist across restarts. Review coverage errors and exceptions before treating a result as complete.

### What if Homebrew is missing?

The prompt falls back to the disk image, the same signed build.

### Do I have to do anything in Loci?

Finish its setup page once after the first launch; it downloads the first model. After that the agent pulls models itself.

### How do I turn it off?

Turn off the switch in Settings → Advanced → Agent Access.

