# Quick Start — Use the Fork TODAY

## 1. Install Extension

```bash
pi install npm:@kylebrodeur/pi-model-router
```

## 2. Initialize Config

```
/router init
```

This scaffolds a default configuration at `~/.pi/agent/model-router.json`.

## 3. Use in Pi

In Pi, run:

```
/reload
```

You should see the router initialize and report feature sync without an Ollama sync feature state.

## 4. Verify Features

### Model Discovery Note

Install `pi-model-discovery` when you want local Ollama models registered with Pi:

```bash
pi install npm:@kylebrodeur/pi-model-discovery
```

Then run:

```
/providers sync
```

Use `/router ollama-sync` only as a delegation shortcut to `/providers sync`.

### Fallback Test

```
# In Pi — switch to a cloud model first
/model anthropic/claude-sonnet-4

# Then trigger fallback
/router fallback
```

Expected: switches to best available model matching your `fallbackSequence` (for example, an Ollama model registered by pi-model-discovery)

```
# Restore
/router restore
```

## 5. New Commands

| Command               | What it does                               |
| --------------------- | ------------------------------------------ |
| `/router ollama-sync` | Delegate to /providers sync                |
| `/router fallback`    | Switch to fallback model sequence (manual) |
| `/router restore`     | Restore original cloud model               |
| `/router init`        | Scaffold default config file               |
| `/router scope apply` | Sync router profiles to Pi enabled models  |
| `/router scope reset` | Clear router profiles from Pi enabled list |
| `/router scope show`  | Show current Pi scoped models settings     |

All existing `/router *` commands still work unchanged.

## 6. Daily Workflow

```bash
# Pull a new Ollama model when using local fallback models
ollama pull qwen3.5:7b
```

```
# In Pi — model registration belongs to pi-model-discovery
/providers sync

# Optional router compatibility shortcut
/router ollama-sync
```

## Troubleshooting

**Ollama models missing**
→ Install/run pi-model-discovery and check `/providers status`

**Models not in registry**
→ `/providers sync` from pi-model-discovery, then `/reload` if the Pi UI needs a refresh

**TypeScript errors**
→ Requires Pi 0.67+ for rate-limit fallback (uses `after_provider_response` event)

**Config not applying**
→ Verify `~/.pi/agent/model-router.json` exists
→ Check with `cat ~/.pi/agent/model-router.json`
