# @carlosgtrz/pi-project-model

Pi extension that adds `/project-model` to save or remove project-local model defaults.

Use it when different project folders should start with different provider/model/thinking combinations.

Requires Pi 0.80.10 or newer.

## Install

```bash
pi install npm:@carlosgtrz/pi-project-model
```

Try without installing permanently:

```bash
pi -e npm:@carlosgtrz/pi-project-model
```

For one-off testing from this repo:

```bash
pi -e ./packages/project-model
```

## Usage

Open Pi in the project folder, select the model/thinking level you want, then run:

```text
/project-model save
```

This writes the current selection to `.pi/settings.json` in the current folder:

```json
{
  "defaultProvider": "openai",
  "defaultModel": "gpt-5.4",
  "defaultThinkingLevel": "medium"
}
```

Remove those local overrides with:

```text
/project-model clear
```

Show the current local override with:

```text
/project-model show
```

Running `/project-model` with no arguments opens an interactive menu.

When Pi starts or `/reload` reloads the extension, it shows a notification if the current folder has a project model override in `.pi/settings.json`.

Aliases:

- Save: `save`, `set`, `pin`
- Clear: `clear`, `remove`, `unset`, `unpin`
- Show: `show`, `status`

## Notes

- `/project-model` updates only the current folder's `.pi/settings.json`. Any other settings already in that file are preserved. Rebranded Pi distributions use their configured project directory name instead of `.pi`.
- The command reads or changes project settings only when the current project is trusted.
- Project-local settings take precedence over `~/.pi/agent/settings.json` when Pi starts in that folder.
- When Pi starts in a folder with a project-local model override, Pi loads that provider/model/thinking-level combination and also persists it to the global `~/.pi/agent/settings.json`. As a result, simply starting Pi in an overridden project can change your global default model/thinking settings.

## License

MIT
