# pi-model-sync > omp (oh my pi) / upstream pi extension: routes subagent models by the spawning session's current model — omp-native subagents plus pi-subagent's `subagent` tool. Profiles can be grouped into named presets (one active per config layer). Zero dependencies; the hosts load the TypeScript sources directly. Managed via the `/model-sync` command. ## Install (pick the user's host) - omp: `omp plugin install npm:@sencha930511/pi-model-sync` - upstream pi: `pi install npm:@sencha930511/pi-model-sync` - git, tag-pinned (either host): `omp plugin install git:github.com/SenCha930511/pi-model-sync@v0.4.2` / `pi install git:github.com/SenCha930511/pi-model-sync@v0.4.2` - omp marketplace: `omp plugin marketplace add SenCha930511/omp-marketplace`, then `omp plugin install pi-model-sync@sencha930511` Verify after installing: start the host and run `/model-sync list` — it prints the active config layer, the active preset, and that preset's profiles. ## Minimal config Global `~/.omp/agent/pi-model-sync.json` (or `~/.pi/agent/pi-model-sync.json` when the `~/.omp` file is absent), project `/.omp/pi-model-sync.json`; `PI_MODEL_SYNC_CONFIG` overrides the path. ```json { "activePreset": "default", "presets": { "default": [ { "main": "provider/main-model", "subagents": { "explore": "provider/child-model", "*": "provider/default" } } ] } } ``` `activePreset` picks the preset whose profile list is in effect for that layer; a missing or dangling name routes nothing (fail closed, no fallback). Legacy `{ "profiles": [...] }` files still work as a virtual `default` preset, and the first successful `preset create`/`preset copy` converts them. `main` matches the spawning session's model (`provider/id`, bare id, or `*` glob); per-agent selector via exact key then `*` default; first matching profile in file order wins. An agent key with no `*` default is not intercepted. An explicit per-call `model` in a pi-subagent call is never overwritten. ## Commands - `/model-sync [list]`, `/model-sync show`, `/model-sync add
`, `/model-sync set
`, `/model-sync remove
[agent]` - `/model-sync preset list`, `/model-sync preset create `, `/model-sync preset copy `, `/model-sync preset use `, `/model-sync preset remove ` - Writes target the global file; add `--project` to write the project file. `add`/`set`/`remove` edit only the active preset; `preset remove` refuses the active preset. - Typing the command shows argument completion for subcommands and existing preset names (`preset use`, `preset remove`, and the source of `preset copy`). ## Docs - [README](README.md): install variants, named-preset and legacy config schema, active-preset selection, matching rules, pi-subagent routing rules, `/model-sync` commands, updating - [CONTRIBUTING](CONTRIBUTING.md) - [License](LICENSE): MIT - [Releases](https://github.com/SenCha930511/pi-model-sync/releases)