# pi-gearshift

> Automatic per-turn model and thinking-level routing for Pi, powered by Jev

Latest version **0.2.0** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install pi-gearshift
pnpm add pi-gearshift
yarn add pi-gearshift
bun add pi-gearshift
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2026-09-24 |
| First published | 2026-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 2 |
| Unpacked size | 630.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | iharuya |
| Maintainers | iharuya |
| Keywords | pi-package, pi-extension, jev, typesafe, model-routing |

## Links

- npm: https://www.npmjs.com/package/pi-gearshift
- Repository: https://github.com/iharuya/pi-gearshift
- Homepage: https://github.com/iharuya/pi-gearshift#readme
- Issues: https://github.com/iharuya/pi-gearshift/issues
- npm.io page: https://npm.io/package/pi-gearshift

## Dependencies (2)

- [zod](https://npm.io/package/zod.md) ^4.6.5
- [@typesafe-ai/sdk](https://npm.io/package/@typesafe-ai/sdk.md) ^0.6.0

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2026-09-24
- 0.1.0 — 2026-09-23

## README

# pi-gearshift

![pi-gearshift routes every request to the right gear](assets/what-is-this.png)

Let [Jev](https://typesafe.ai/) choose the model and thinking level for each turn in the Pi Coding Agent.

- `light` — straightforward, low-risk work
- `standard` — typical implementation and debugging
- `heavy` — deep, ambiguous, broad, or high-risk work

## Get started

```bash
pi install npm:pi-gearshift
pi
```

The setup wizard guides you through choosing models and thinking levels for each gear. It asks for a [TypeSafe API key](https://console.typesafe.ai/) for automatic routing.

You can configure by `/gearshift settings` or editing `~/.pi/agent/pi-gearshift/settings.json` manually.

## Commands

| Command | Purpose |
| --- | --- |
| `/gearshift status` | Show current configuration and authentication status |
| `/gearshift settings` | Configure gears and routing bias |
| `/gearshift use light\|standard\|heavy` | Switch gears manually, even when automatic routing is disabled |
| `/gearshift enable` | Enable automatic routing |
| `/gearshift disable` | Disable automatic routing |
| `/gearshift login` | Save a TypeSafe API key |
| `/gearshift logout` | Remove the saved key and disable automatic routing |

You can also supply your key through `TYPESAFE_API_KEY`. Set `PI_GEARSHIFT_DATA_DIR` to change the data directory.

## How it works

Before each turn, Jev evaluates the request and Gearshift selects a model and thinking level. If routing fails, Pi continues with its current setting without retrying.

Routing sends your complete request and a limited number of recent user or assistant messages to TypeSafe. Recent messages are shortened to a limited length; thinking blocks, tool calls, and tool results are excluded.

## License

MIT

---
_Source: https://npm.io/package/pi-gearshift · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
