# pi-inception-provider

A [pi](https://pi.dev) provider plugin for [Inception Labs](https://inceptionlabs.ai) (Mercury).

Registers the `inception` provider against `https://api.inceptionlabs.ai/v1` using pi's built-in `openai-completions` streaming API. Models are discovered at startup from `GET /v1/models`, with a static fallback so the provider still loads when discovery fails (offline, rate limited, no key yet).

## Setup

```bash
export INCEPTION_API_KEY="your_api_key_here"
```

Get a key from the [Inception dashboard](https://docs.inceptionlabs.ai/get-started/models).

## Use

```bash
export INCEPTION_API_KEY="your_api_key_here"

# quick test, no install
pi -e /path/to/pi-inception-provider

# then /model -> inception/mercury-2
```

> Models only appear in `/model` and `--list-models` once `INCEPTION_API_KEY`
> is set — pi filters the catalogue to providers with configured auth.

Or install as a package:

```bash
pi install /path/to/pi-inception-provider
```

### Project / team settings

Add to `.pi/settings.json`:

```json
{
  "packages": ["/path/to/pi-inception-provider"]
}
```

## Models

| Model | Context | Max Output | Input $/M | Output $/M | Cached Read $/M |
| ----- | ------: | ---------: | --------: | ---------: | --------------: |
| mercury-2 | 128K | 50K | $0.25 | $0.75 | $0.025 |

The full list and pricing are resolved dynamically from `/v1/models` at startup.

## Notes

- `authHeader: true` sends `Authorization: Bearer $INCEPTION_API_KEY`.
- `maxTokensField: "max_tokens"` — Inception uses the OpenAI classic `max_tokens` field, not `max_completion_tokens`.
- `supportsDeveloperRole: false` — system prompts use the `system` role.
- Mercury is a diffusion LLM; the chat completions endpoint does not expose extended-thinking controls, so pi reasoning levels are not advertised.

## Test

```bash
node --import tsx test.ts discover   # print resolved models
node --import tsx test.ts chat       # stream a one-shot completion (needs INCEPTION_API_KEY)
```
