Skip to main content

pi and omp

One command points pi or omp at the gateway. Both keep their own model catalogs, and a subscription you are already signed in to stays where it is.

omp is a fork of pi, so Anyray configures them the same way: it re-points the built-in anthropic and openai providers at your gateway and leaves every other provider alone.

Connect

npx anyray-connect@latest --gateway http://<gateway>:8787 --tools pi,omp

Enroll first with --enroll <link> or --sso. Connect makes no changes without a valid personal ark_… client key. Add --dry-run to preview, or omit --tools to configure every tool it finds (Connect your tools).

Both read their config once per run, so the next pi or omp picks up the change. Nothing to restart.

Confirm it worked

Run pi --list-models (or omp models). Every built-in Anthropic and OpenAI model should still be listed: that is the override working, since Anyray re-points the providers without touching their catalogs. Your next request then shows up on the Agents card.

What Connect writes

ToolFileWhat it owns
pi~/.pi/agent/models.jsonproviders.anthropic, providers.openai
omp~/.omp/agent/models.ymlthe same two, plus mcp.json for retrieval

Each entry gets a baseUrl, your key as apiKey, and the x-anyray-api-key and x-anyray-metadata headers. None of them gets a models array, and that omission is the design: each tool keeps its own bundled catalog, so a new Claude or GPT release arrives with the right context window and price without waiting on an Anyray update.

Connect backs the file up before its first change and preserves everything else in it, including comments in omp's YAML. --revert removes only what Connect wrote and restores your previous values.

If you are signed in to a Claude or ChatGPT subscription

Connect leaves that provider on its own sign-in and reports the tool as held. Routing it would move your inference off a subscription you already pay for and onto the org's API bill, so it never happens implicitly. Pass --org to route it anyway.

This works per provider: a Claude subscription with no ChatGPT sign-in leaves anthropic alone and still routes openai. If you later sign in to a subscription for a provider Connect had been routing, the next run withdraws its own entry rather than leaving you billed twice.

Profiles and relocated config

omp honors PI_CONFIG_DIR (a directory name under your home, default .omp), OMP_PROFILE / PI_PROFILE, and PI_CODING_AGENT_DIR. pi honors PI_CODING_AGENT_DIR as its whole agent path. Connect resolves the same paths each tool does, so a profile or a relocated config is written where that tool actually reads it.

omp also still reads a legacy ~/.omp/agent/models.json when neither YAML file exists. Connect edits whichever file omp would load, and keeps a JSON one valid JSON.

Setting it up by hand

If Connect cannot write the config, it prints these steps.

1
Open the config
~/.pi/agent/models.json for pi, ~/.omp/agent/models.yml for omp. Create it if it does not exist.
2
Re-point the two providers
Under providers, give anthropic a baseUrl of http://<gateway>:8787 and openai a baseUrl of http://<gateway>:8787/v1. Set apiKey to your ark_… key on each.
3
Leave out `models`
Omitting it keeps the built-in catalog for that provider.

The two base URLs differ on purpose. Both tools append /v1/messages to the Anthropic one themselves, so it takes a bare origin; the OpenAI transport appends /chat/completions to a base that already ends in /v1.

Context retrieval

omp ships an MCP client, so Connect registers the Anyray retrieval server in ~/.omp/agent/mcp.json. That gives the model anyray_retrieve, which lets the optimizer replace a long tool result with a marker the model can read back on demand.

pi ships no MCP client, by design. There is nothing to register, so Anyray keeps irreversible trimming off that lane rather than discarding output the model could never recover. You do not configure this and there is no step to finish:

  • anyray-connect doctor reports "no MCP client" for pi, not a problem to fix.
  • The console shows a pi agent as Active · client has no MCP, in green.

pi still gets every reversible optimization, and both tools are metered and attributed the same way.