---
slug: chat
kind: recipe
status: ran
sh: https://insidethemachine.ai/install/chat.sh
ps1: https://insidethemachine.ai/install/chat.ps1
json: https://insidethemachine.ai/install/chat.json
page: https://insidethemachine.ai/do/chat
---

# Install: A private ChatGPT

A ChatGPT-style chat app that runs fully on your computer, even offline.

**Run status: Checked: the commands were run end to end by us.** Run end to end by hand on an Apple M4 Mac with 16 GB on 2026-10-15.

**This script:** The wrapper scripts are generated from the site data. Every .sh passed bash -n and shellcheck and ran in plan mode on Linux (Debian 13). Every .ps1 passed the PowerShell parser and chat.ps1 ran in plan, verify and rollback mode under PowerShell 7 on Linux with Windows calls mocked. Not run on macOS or real Windows.

**Run through this script:** 2026-10-16, Debian 13 box: step 1 (Ollama install) and the auto-start of `ollama serve` worked. The model download could not be tested: the box's network blocks Ollama's download host. Open WebUI step not reached (it needs python3.11, which Debian 13 lacks).

## One command

```bash
curl -fsSL https://insidethemachine.ai/install/chat.sh | bash
```

Windows (PowerShell):

```powershell
irm https://insidethemachine.ai/install/chat.ps1 | iex
```

Actions: `| bash -s -- plan` (print only), `verify`, `rollback --yes`. Env: ITM_RAM, ITM_MODEL. Read the script first: `curl -fsSL https://insidethemachine.ai/install/chat.sh | less`.

Lines marked YOU RUN are not run by the script (servers, interactive apps, your own files). The script prints them at the end, in order.

## Model by memory (picked automatically)

| memory GB (at least) | ollama tag |
|---|---|
| 8 | qwen3.5:4b |
| 16 | gemma4:12b |
| 24 | gemma4:12b |
| 32 | qwen3.8:27b |
| 48 | qwen3.8:27b |
| 64 | qwen3.8:27b |
| 96 | qwen3.8:27b |
| 128 | qwen3.8:27b |
| 192 | qwen3.8-flash-next:125b-a6b |
| 256 | qwen3.8-flash-next:125b-a6b |
| 512 | qwen3.8-flash-next:125b-a6b |

## Steps

### macOS and Linux (bash; brew lines are macOS only)

Install:

1. **Install Ollama**
   - run: `curl -fsSL https://ollama.com/install.sh | sh`
2. **Download your model**
   - run: `ollama pull $MODEL`
3. **Say hi**
   - YOU RUN (interactive; run it yourself): `ollama run $MODEL`
4. **Add a ChatGPT-style window**
   - run (macOS only): `brew install python@3.11`
   - run: `python3.11 -m venv ~/.venvs/openwebui && source ~/.venvs/openwebui/bin/activate`
   - run: `pip install open-webui`
   - YOU RUN (starts a server that keeps running; run it in its own window): `open-webui serve`

Verify:

- `ollama --version` → expect: a version number
- `ollama list | grep -F "${MODEL%%:*}"` → expect: your model is in the list
- `ollama list | grep -qF "${MODEL%%:*}" && ollama run "$MODEL" "Say hi in five words."` → expect: a short answer, made on this computer
- `test -x ~/.venvs/openwebui/bin/open-webui` → expect: Open WebUI is installed

Rollback:

- run: `ollama rm $MODEL`
- run: `rm -rf ~/.venvs/openwebui`
- run: `rm -rf ~/Library/Caches/pip`

### Windows (PowerShell, not run by us)

Install:

1. **Install Ollama**
   - run: `irm https://ollama.com/install.ps1 | iex`
2. **Download your model**
   - run: `ollama pull $MODEL`
3. **The rest of the recipe**
   - note: Install Ollama with this PowerShell command, or the installer from ollama.com/download. On Linux, the install command above works as it is. After that, every ollama command on this page is the same. For the chat window on Windows, LM Studio (lmstudio.ai) is the easiest. Open WebUI also runs on Windows; see its page. Steps: https://insidethemachine.ai/do/chat

Verify:

- `ollama --version` → expect: a version number
- `ollama list` → expect: your model is in the list

Rollback:

- run: `ollama rm $MODEL`
