# Local models

The **Local models** page shows every AI model that runs on your own server, has a session install what is missing,
and gives you
**one address and API keys** to use them from anywhere your Harness is reachable: your laptop, your phone, n8n, a
script, another app. They are free to use, and nothing leaves your server.

Every model is shown **by use**, and every one of them answers at the same address with your key, whatever runs it
([Ollama](https://ollama.com), [LocalAI](https://localai.io), llama.cpp, LM Studio, vLLM, or Harness itself for the
voice).

Local models are good for the small, repetitive jobs: translating, summarizing, sorting, extracting, searching your
documents, a private chat, images for a draft, dictation. They do not replace Claude in your sessions.

## Turning it on

The page is off until you turn it on: **Settings -> Features -> Local models** (or `maxxing local-models enable`). It
then has its entry in the sidebar.

## The page

The list on the left of the page:

- **Overview**: this server (memory, processor, graphics card), one tile per use (which engine serves it, how many
  models), and the address;
- **Models**, one entry per use, with the number of models and a dot (green: something is installed, grey: nothing yet):
  - **Text**: chat, writing, code (the **Code** filter keeps the models made for code);
  - **Vision**: text models that also read images (screenshots, photos, scanned documents);
  - **Search**: embedding and rerank models, to search your documents by meaning (RAG);
  - **Images**: image generation;
  - **Dictation**: speech to text (Whisper, Parakeet, Canary, Voxtral, Moonshine...);
  - **Voice**: reading text aloud (Piper, Kokoro...);
  - **Video**: only once an engine serves a video model (they answer on their engine, not yet at the address);
- **Use them**: **Address and keys**, **Engines**.

A model's use comes from what its engine says about it (Ollama, LocalAI); engines that do not say (vLLM, Speaches,
LM Studio...) are read from the model's name.

Every use has the same tab: its **Models**, **Suggestions**, **Ask a session**, and **Try it** (the request that calls
one of its models, once there is one).

### The models of your own computer

A computer of yours running Harness Link (Settings -> Devices) can lend its models, and its graphics card: turn its
**Models** function on in Settings -> Devices and on the computer (`harness-link allow models`). Harness Link finds the
model servers running on the computer itself (Ollama, LM Studio, llama.cpp, Jan, vLLM) and they appear here, named
`<device>/<model>` (`laptop/qwen3:8b`), through the same address and keys, while the computer is online. Nothing opens
on your network: the requests go through Harness Link's own connection, and only to those servers of that computer.
See [Devices](devices.md).

### Without a graphics card

Everything works on a server without a graphics card, more slowly: small text models (up to about 8B) answer at a usable
speed, and **an image takes several minutes**. A server with a graphics card (or a Mac with Apple Silicon, for text)
makes it a matter of seconds. The page says it where it matters.

## Installing: a session does it

The page reads; it never installs by itself. **Ask a session** opens a session draft in the topic `system/harness`,
with this server's memory, processor, graphics card and what was found, and a request ("Install a text model suited to
this server", "Install local dictation (Whisper)", or your own). Read it, send it: Claude picks the engine and the
model that suit the machine (usually Ollama for text, vision and search, LocalAI for images on a server without a
graphics card, Harness's own Whisper and Piper for dictation and voice), installs them closed to the internet, and
checks that the page sees them. The bin icon of a model opens a draft to remove it, the same way.

**Suggestions** lists a few models for each use, with their download size and **Too big for the memory** when this
server cannot hold them; **Install** opens a draft that names the model (the session may propose a newer version).
Installed ones are marked **Installed**.

Each model shows the engine that serves it, its size, **In memory** for the Ollama models loaded right now, and **Used
by Harness** for the one Harness itself uses.

## Dictation and voice

Harness has its own voice models: Whisper for dictation (the mic of the message box, Telegram voice notes, the voice
mode) and Piper for reading aloud (Listen, voice replies). They are listed like the others, as `harness/whisper-small`
or `harness/piper`, and they answer at the address too: your other apps can transcribe and speak with them.

```bash
curl https://ui.example.com/api/local-models/v1/audio/transcriptions \
  -H "Authorization: Bearer $LOCAL_MODELS_API_KEY" \
  -F model=harness/whisper-small \
  -F file=@recording.ogg
```

```bash
curl https://ui.example.com/api/local-models/v1/audio/speech \
  -H "Authorization: Bearer $LOCAL_MODELS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "harness/piper", "input": "Hello", "response_format": "mp3"}' \
  --output hello.mp3
```

Apps that ask for `whisper-1` or `tts-1` get them too, when no engine has a model of that name. The top of the
**Dictation** and **Voice** tabs says which model Harness uses; which one it uses is chosen in **Settings -> Voice**.

## Address and keys

- the **address**: `https://<your Harness>/api/local-models/v1` (it needs the public URL of Settings -> General;
  without it, the models answer only on this server);
- the **API key** (Show, Copy, New default key). It is also saved in **Settings -> Keys** as `LOCAL_MODELS_API_KEY`,
  so sessions, scheduled jobs and scripts on this server read it as `$LOCAL_MODELS_API_KEY`;
- an example to try it.

Any app that speaks the OpenAI API: base URL = the address, API key = the key, model = a name of the list.

### How a request finds its model

Every request names its model in its `model` field (for a transcription, the form field `model`): the exact name, as
`GET /v1/models` lists it (`qwen3:4b`, `harness/whisper-small`...). Harness sends the request to the engine that has
that model, and looks again once when the name is unknown (a model installed a moment ago). Two engines with the same
name: the first one found answers (Ollama first). An unknown name gets `model_not_found`; a model of a computer that is not connected right now gets `device_offline`.

It works with every engine that speaks the OpenAI API: Ollama, LocalAI, llama.cpp, vLLM, LM Studio, Speaches, and the
dictation and voice of Harness. Engines with an API of their own (ComfyUI, Automatic1111, the whisper.cpp server) are not
reachable through the address. The page says what each model does from what its engine reports (Ollama, LocalAI); for
the others it reads the model's name (Whisper, Parakeet, Canary, Voxtral, Moonshine... are dictation models).

```bash
curl https://ui.example.com/api/local-models/v1/chat/completions \
  -H "Authorization: Bearer $LOCAL_MODELS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "llama3.2:3b", "messages": [{"role": "user", "content": "Hello"}]}'
```

Apps that speak the Anthropic API: base URL = the address without `/v1`, the key as `x-api-key`.

What the address answers: the list of models (`GET /v1/models`, one model with `GET /v1/models/<name>`), chat (`/v1/chat/completions`, `/v1/messages`),
`/v1/completions`, `/v1/responses`, `/v1/embeddings`, `/v1/images/generations`, `/v1/audio/transcriptions` and
`/v1/audio/speech`, streamed answers included.
A few files or voice requests are handled at once; past that the address answers `429`: try again a moment later.
Installing, downloading or removing a model is never possible with a key.

The default key is made when you turn the page on. **New key** makes another one, for one app or one person: it is
shown once, copy it then. **Revoke** stops only that key. Each key shows when it was last used.

## Engines

Ollama, and the OpenAI-compatible engines running on this server on their usual port (LocalAI and llama.cpp on 8080,
LM Studio on 1234, llama.cpp on 9931, vLLM or Speaches on 8000, LocalAI on 8090) are found by themselves, and Harness
itself is listed when its voice models are installed. **Add a machine** adds another machine or port by its
OpenAI-compatible address (for example a computer with a graphics card on your private network:
`http://100.64.0.2:11434`). An added machine is reached without a key: one that asks for its own API key cannot be added
yet, and one that does not answer within a few seconds shows **Not answering**.
Any program on this server that answers `GET /v1/models` on one of those ports is listed and reachable with a key:
stop it or move it to another port if it should not be. This server's own address cannot be added as a machine.

## From the terminal

```
maxxing local-models status                      # models (text, vision, image...), engines, address, keys
maxxing local-models key                         # the default key
maxxing local-models server add http://127.0.0.1:7860   # serve an engine on another port
```

See the [command reference](cli-reference.md).
