Skip to main content
Oh My Pi 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 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).

Enable routing

Run once per machine:
omp reads its config at startup, so restart omp for the change to take effect. Check the state any time:
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:
config.yml points the default model role at it, and the smol and slow roles at Valar Auto when you have not set them:
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). Left unset, smol and slow make omp pick a model from its own built-in list, from any provider you are signed in to, for work such as commit messages and the advisor. Pointing them at Valar Auto keeps that work on Valar. A role you set yourself is never changed: if it names a model outside Valar, on says so, because requests that use it do not go through Valar. off removes the roles it set. 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.
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 the roles it set, and keeps your other edits.

Turn off routing

Restart omp for the change to take effect.

Next steps

Model routing

How cohorts and the split decide which model serves each request.

Pi

The original Pi harness, which omp mirrors.