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

# Oh My Pi

> Route Oh My Pi (omp) through Valar, and what the CLI writes to its ~/.omp/agent config files

[Oh My Pi](https://omp.sh) is a fork of Pi, and ValarCode routes it the same way: the CLI registers its own `valar` provider with a pinned model list, so the picker offers exactly Valar's models (Auto plus the open-weight models). omp reports to Valar as Pi, so its routing and usage attribution are Pi's. See [Set up ValarCode](/valarcode/setup) for the shared setup and the client-id model.

## Prerequisites

* Oh My Pi installed and launched at least once (so `~/.omp/agent` exists).
* A Valar coding key (`vlrcode_...`) and the `valar` CLI ([install](/valarcode/setup#install-the-cli)).

## Enable routing

Run once per machine:

```bash theme={"system"}
valar ohmypi on --api-key <your-coding-key>
```

omp reads its config at startup, so **restart omp** for the change to take effect. Check the state any time:

```bash theme={"system"}
valar ohmypi status
```

`omp models` lists the Valar catalog; pick a model with `/model` in a session or `--model valar/<id>` on the command line. Auto (`valar-auto`) is the default.

## What gets written

omp keeps its config in YAML under `~/.omp/agent/`. `valar ohmypi on` edits two files, preserving other providers, roles and unrelated keys:

**`models.yml`** declares the `valar` provider against the gateway, with the key, the model list and the headers that attribute your traffic:

```yaml theme={"system"}
providers:
  valar:
    baseUrl: https://api.valarhq.ai
    apiKey: vlrcode_...
    api: anthropic-messages
    auth: apiKey
    headers:
      X-Valar-Client-Id: jdoe
      X-Valar-Harness: pi
      X-Valar-Cli-Version: 1.4.2
    models:
      - id: valar-auto
        name: Valar Auto
        ...
```

**`config.yml`** points the default model role at it:

```yaml theme={"system"}
modelRoles:
  default: valar/valar-auto
```

A default already on a Valar model is kept when Valar still offers it, along with any thinking selector you appended to it (`valar/zai-org/GLM-5.2:high`).

`auth: apiKey` is required. Without a declared auth mode, omp treats a custom `anthropic-messages` provider as a Claude Code proxy and changes the request: it places Claude Code's system prompt ahead of yours and caps `max_tokens` at 64000. Declaring the mode turns that off, so your models get omp's own prompt and the full output length.

If you run omp under a profile (`OMP_PROFILE`, `PI_PROFILE`) or with a relocated config (`PI_CONFIG_DIR`, `PI_CODING_AGENT_DIR`), the CLI follows it and writes that profile's files, so run `valar ohmypi on` with the same environment your omp sessions use. Both files are written user-only (`0600`), since they hold the key. Before the first change, the originals are snapshotted to `~/.valar/ohmypi/backup.json`, so `off` can restore them.

<Note>
  The files are rewritten as plain YAML, so comments in them do not survive `on`. `off` restores the originals byte-for-byte when nothing else changed while routed; otherwise it removes only the `valar` provider and default role and keeps your other edits.
</Note>

## Turn off routing

```bash theme={"system"}
valar ohmypi off
```

Restart omp for the change to take effect.

## Next steps

<CardGroup cols={2}>
  <Card title="Model routing" icon="route" href="/valarcode/routing">
    How cohorts and the split decide which model serves each request.
  </Card>

  <Card title="Pi" icon="microchip" href="/valarcode/pi">
    The original Pi harness, which omp mirrors.
  </Card>
</CardGroup>
