# Run PanCode against a model on your own GPU

https://akougkas.io/journal/2026/pancode-on-your-own-gpu/

Author: Anthony Kougkas

Published: 2026-08-26

Updated: 2026-11-25

**November 25, 2026:** I ran this walkthrough end to end with PanCode 0.3.7 on August 26, 2026. The commands below now follow the current PanCode guides, and I have not rerun the whole walkthrough against the current release. Since 0.5.6, `default` and `yolo` are the only autonomy levels, and read-only is a separate `--read-only` flag. Interfaces can still change between minor releases; `pancode <command> --help` is the reference for the version you have.

Most of the scientists I work with have exactly one GPU and code they cannot send to a cloud API. [PanCode](https://akougkas.io/work/pancode/) was built for that room: a coding agent that runs against a model on your own hardware and seals a record of each run that you can read afterwards.

PanCode treats a model connection as a named **target**: a runtime, an endpoint, a model id, and credentials. Everything below is in the PanCode README, its guides, and `--help`; I have only put it in the order I actually follow on a fresh machine.

## Prerequisites

- Linux, macOS, or WSL. Native Windows is best effort.
- No root. The install script brings its own Node.js; the npm route needs Node.js 22.19 or newer.
- A local inference server. Any of llama.cpp, Ollama, LM Studio, vLLM, SGLang, or Lemonade works; the runtime ids are `llamacpp`, `ollama`, `lmstudio`, `vllm`, `sglang`, and `lemonade`.
- A model that supports tool calling, loaded in that server. If you have one GPU with 24 GB or more, PanCode 0.3.7 was hardened against **Qwen3.8-27B** (the `unsloth/Qwen3.8-27B-GGUF` quantizations) on llama.cpp and LM Studio. A 4-bit quantization at 131072 context fits in 24 GB with a q8_0 KV cache. The server side of that model on a 32 GB card is its own story, in [Serving Qwen3.8-27B on a Radeon AI PRO R9700 is not a one-liner](https://akougkas.io/journal/2026/serving-qwen38-27b-on-a-radeon-ai-pro-r9700/).

The version I tested, on August 26, 2026, was PanCode 0.3.7. Check yours with `pancode --version`.

## 1. Install

```
curl -fsSL https://pancode.dev/install.sh | sh
pancode --version
```

The installer puts the launcher at `~/.local/bin/pancode` and does not edit your shell profile. If your shell cannot find `pancode`, add `~/.local/bin` to `PATH` as the installer tells you. With Node.js 22.19 or newer already installed, npm works too:

```
npm install -g pancode
command -v pancode
```

`command -v pancode` shows which file the bare name reaches, which matters when an older install is still on your `PATH`.

## 2. Start the model server

For llama.cpp, the 0.3.7 README asked for these flags so tool calls and reasoning parse cleanly:

```
llama-server --jinja --reasoning on -m /path/to/Qwen3.8-27B-Q4_K_M.gguf -c 131072
```

LM Studio needs nothing beyond loading the model. Note the port your server listens on; 8080 is llama.cpp’s default and 1234 is LM Studio’s. Those are also the loopback ports PanCode looks at when it searches for a local server.

## 3. Configure a target

The interactive way:

```
pancode configure
```

The guided setup lists what it found on this machine first, asks for the endpoint and model, and sends one short test request before it saves. Bare `pancode` opens the same setup when nothing usable is configured.

The scripted way, which does the same thing without prompts:

```
pancode configure --id local-lmstudio --runtime lmstudio \
  --url http://localhost:1234 --model your-model-id \
  --set-orchestrator --set-fleet-default --verify
pancode targets --probe
```

`--set-orchestrator` makes the target the chat default and `--set-fleet-default` makes it the default for workers. `--verify` sends one test request and saves only if the model answers. `pancode targets` lists every configured target with its health, auth, and capabilities, and `--probe` actually connects. The model id has to be one the server serves; `pancode models --target local-lmstudio` lists them, and `pancode configure --list` lists every runtime and what it needs.

## 4. Run one headless turn

From any repository:

```
pancode run --read-only --output-format stream-json \
  "Summarize this repository layout and its entry points."
```

`--output-format stream-json` streams JSONL on stdout: a `session` frame first; `agent_start`, `turn_start`, `message_start`, the text deltas, `message_end`, `turn_end`, and `agent_end`; tool events in between when the model calls tools; and one `run_end` envelope last. Judge the run from `run_end`. It carries the `exitCode`, an `outcome`, typed `causes`, the route that answered, and `usage` split into the main turn, side calls, dispatched workers, and the total. Measured, estimated, and unknown amounts stay apart, so a cost nothing measured never reads as zero. `--output-format json` writes the envelope alone.

`--read-only` is the guarantee that this turn changes no user file: writes and edits are refused, and shell commands run only in a read-only OS sandbox. The envelope counts tool calls, refusals, and writes, so you can see what was attempted.

To hand the same task to a fleet worker instead of the main agent:

```
pancode run --agent coder "<task>"
```

`coder` is one of the shipped worker recipes. That run is sealed on its own.

## 5. Read the evidence

```
pancode evidence list
pancode evidence inspect <runId>
```

`evidence inspect` shows what a run ran, changed, and verified: its assessment, findings, and gate verdicts, and the verdict of its seal. It exits 1 when the seal was checked and rejected or the run has not settled. Inside an interactive session, `/view verify <runId>` shows the same thing. `pancode telemetry verify --run <runId>` rechecks the sealed record, and it can do that on another machine.

## 6. Go interactive

```
cd your-project
pancode context init     # drafts PANCODE.md from the source tree
pancode
```

`context init` writes `PANCODE.md`, the project handbook PanCode loads as standing context. When the tree already has a `CLAUDE.md` or `AGENTS.md`, it reads them, reports each of their rules it dropped, merged, or found contradicted, with the source file and line, and never modifies those files. In the session, `/model` switches the model, `/settings` opens the rest of the configuration, `/context` and `/usage` show what is in the window and what it costs, and `/help` lists the rest.

## Limitations

- PanCode is pre-1.0. Commands and settings can change between minor releases, and model-specific behavior varies by target. Keep the repository under version control and review what it proposes.
- A local model’s usefulness depends on the quantization, the context length you can afford, and whether tool calls parse cleanly. PanCode’s model profiles record capabilities and quirks per model family; other models may need `--jinja` or a different chat template.
- The sealed record shows what the harness observed. It does not make the model’s reasoning correct.
- PanCode can also connect a ChatGPT or Claude subscription. Using subscription credentials outside a vendor’s own apps may not align with their terms. That is your call, not PanCode’s.
- Native Windows is best effort.

If something in here does not match what you see, `pancode doctor` plus `pancode --version` is what I need in a bug report. `pancode report bug --title "<title>" --dry-run` previews a report with paths, host names, and secrets masked and sends nothing. Remove private prompts before you send it.

## Where this fits

The sealed record is the point. Why one harness should run on whatever model you have is the argument of [Why PanCode, part 1 of 5: your models, your machines](https://akougkas.io/journal/2026/why-pancode-1-your-models-your-machines/). If a local model is useful here, it is because the harness around it does the work a model cannot do for itself.
