> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reason.bot/llms.txt
> Use this file to discover all available pages before exploring further.

# Use a model on your own machine

> Connect Ollama, vLLM, LM Studio or any OpenAI-compatible server on localhost, a private network or the internet.

This page covers a server on your own computer or private network. For a hosted endpoint, a provider API key, or setting any of this up with the CLI or the API, see [Add any model](https://docs.reason.bot/docs/add-models.md).

In **Settings → Models**, choose **Custom**. Set **Call the model from** to **Your computer** to call your inference server from the computer running the session, without exposing it to the internet. A Base URL on `localhost`, your LAN or Tailscale selects **Your computer** for you. The computer must be connected to Reason with `reason connect` (see [CLI](https://docs.reason.bot/docs/cli.md)).

For Ollama, start the server with a context window large enough for agent prompts:

```bash wrap theme={null}
OLLAMA_CONTEXT_LENGTH=32768 ollama serve
ollama list
```

Enter any API key for a keyless server, set **Base URL** to `http://localhost:11434/v1`, and enter the model IDs shown by `ollama list` in **Model IDs**. Separate multiple IDs with commas. Leave **API format** blank for OpenAI-compatible chat completions, or choose `openai-responses` or `anthropic-messages` if your server uses that format.

Run the session on the computer that can reach the server. Here `localhost` means that computer, not your browser or Reason's cloud. A LAN address such as `http://192.168.1.10:8080/v1`, an SSH tunnel on that computer, or a Tailscale address such as `http://100.101.102.103:11434/v1` or `http://gpu-box.tailnet-name.ts.net:11434/v1` also works if that computer reaches it. HTTP and HTTPS are supported; prefer HTTPS when sending credentials or session content across a network you do not trust.

Ollama listens only on `127.0.0.1` by default, and while it does, it refuses with HTTP 403 any request addressed to a hostname other than `localhost`, such as a `*.ts.net` name behind `tailscale serve` or `tailscale funnel`. When Ollama runs on the session's computer, use `http://localhost:11434/v1`. To reach it at any other address, including its `100.x` Tailscale address, start it with `OLLAMA_HOST=0.0.0.0` so it listens on every network interface; that also turns off the hostname check. With the Ollama Mac app, run `launchctl setenv OLLAMA_HOST "0.0.0.0"` and restart the app. Anyone on those networks can then reach the server.

**Model IDs are required with Your computer.** Reason does not resolve the private hostname or discover models from the cloud when you save. Check the server's model list yourself. A session in Reason cloud cannot use this connection: run the session on a computer that reaches the server, or connect the server at a public HTTPS URL with **Reason cloud** instead.

* For vLLM or LM Studio, use its OpenAI-compatible API port and model IDs.
* Agent prompts run past 20,000 tokens. Raise the server's context window, because Ollama's default silently cuts off the rest.
* The connected computer must be online and able to reach the inference server.
* Small models struggle with tool calls. If one makes up a tool result, start a new session instead of following up.

## Use the endpoint from a cloud session

**Reason cloud** is the default for a public Base URL and for existing Custom connections. It requires a public HTTPS URL and retains private-network protections. It cannot call your localhost, LAN or private tailnet address. If you want cloud sessions to use your server, expose it at a public HTTPS address, for example with a [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/trycloudflare/):

```bash wrap theme={null}
cloudflared tunnel --url http://localhost:11434 --http-host-header localhost:11434
```

Choose **Reason cloud** and set **Base URL** to the tunnel address plus `/v1`. Leave **Model IDs** blank to discover models when saving, or enter them explicitly.

* Ollama only answers requests addressed to `localhost`, which is why the tunnel needs `--http-host-header`.
* Anyone with a public tunnel address can use the server unless it checks a key. Put an authenticated proxy in front of it and enter that key in Reason if you need access control.
* A `trycloudflare.com` address changes whenever `cloudflared` restarts. To update the connection, use **Replace key** and enter the new base URL. A [named tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/) keeps the same address.

## FAQ

> [accordion] Can Reason reach a server on my private network or VPN?
>
> Yes, with **Your computer** and a session running on a computer that can reach that network or VPN. Reason cloud cannot reach private addresses; choose **Your computer** or give the server a public HTTPS address.

> [accordion] How do I connect a server I reach over Tailscale?
>
> Enter its `100.x` or `*.ts.net` URL (this selects **Your computer**) and its model IDs, and run the session on a computer in your tailnet. A `tailscale serve` URL works only inside your tailnet, so Reason cloud can't use it. To use the server from Reason cloud, run [`tailscale funnel 8080`](https://tailscale.com/kb/1223/funnel) with the server's port, then enter the printed public `https://….ts.net` address plus `/v1`. For Ollama, start it with `OLLAMA_HOST=0.0.0.0` first: Tailscale passes the `*.ts.net` name on to it, and Ollama refuses that name with HTTP 403 while it listens only on `127.0.0.1`.

> [accordion] Why does a session say my model server couldn't be reached or refused the request?
>
> The computer running the session tells Reason why its request failed, without the URL, key or response: the hostname did not resolve, the connection was refused or timed out, the secure (TLS) connection failed, or the server answered with an HTTP error such as 401, 403 or 404. A refused connection usually means the server is not running or listens only on `127.0.0.1` while the Base URL names another address. A 403 from Ollama means it refused the hostname; see above. If the session shows only "Connection error.", update the Reason CLI on that computer: older versions do not report why.

> [accordion] Why are model IDs required with Your computer?
>
> Saving happens in the cloud, which cannot inspect your local server. Enter the IDs reported by the server, such as the names from `ollama list`. Requests are sent only when a session runs on a computer that can reach it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.