@cad0p/pi-pioneer-provider

Pi coding agent provider for Pioneer AI API

Packages

Package details

extension

Install @cad0p/pi-pioneer-provider from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@cad0p/pi-pioneer-provider
Package
@cad0p/pi-pioneer-provider
Version
0.2.3
Published
Jun 13, 2026
Downloads
1,423/mo · 922/wk
Author
cad0p
License
MIT
Types
extension
Size
16.3 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

@cad0p/pi-pioneer-provider

A Pi provider extension that connects to Pioneer AI's OpenAI-compatible API.

Fork of jalyfeng/pi-pioneer-provider that opts out of Pioneer's inference retention by sending store: false on every request (see Privacy).

Installation

Install the package via Pi's package manager:

pi install npm:@cad0p/pi-pioneer-provider

Or pin to a specific version:

pi install npm:@cad0p/pi-pioneer-provider@0.2.0

Authentication

Choose one of the following methods:

1. Interactive Login (Recommended)

Run /login inside Pi, select Pioneer AI, and enter your API key when prompted. The key is stored securely by Pi's auth system.

2. Environment Variable

Set the PIONEER_API_KEY environment variable before starting Pi:

export PIONEER_API_KEY=pio_sk_xxxxxxxxxxxxxxxx
pi

Supported Models

Models are discovered dynamically at startup from Pioneer's /base-models endpoint. Only chat-capable decoder models with inference support are exposed.

Plus the pioneer/auto router model (added statically — not exposed via /base-models), which automatically routes tasks to the cheapest model meeting quality thresholds.

The following model capabilities are reported:

  • Reasoning: Enabled for all discovered concrete models
  • Router thinking: Disabled for pioneer/auto. Pioneer's /v1/messages router can select upstreams that reject Anthropic extended-thinking payloads, so the provider clamps Pi thinking off for the router while leaving concrete Pioneer models reasoning-capable.
  • Context window: Fetched from Pioneer API. For the router model, derived dynamically as the maximum context window among all discoverable models (currently 1M tokens)
  • Max tokens: Set to min(context_window / 4, 131072) for all models

Note: The router model's limits are computed at startup from the live /base-models catalog. Since the router can route to any candidate model, its effective limits equal the maximum of the pool.

Configuration

The provider uses https://api.pioneer.ai/v1 as the default base URL. You can override it via the PIONEER_BASE_URL environment variable:

export PIONEER_BASE_URL=https://your-custom-endpoint.com/v1

Prompt Caching

Pioneer honors prompt caching on /v1/chat/completions, /v1/messages, /v1/responses, and native generate endpoints. This provider routes Pioneer Claude models, GPT/OpenAI-family models, and the pioneer/auto router through Pioneer's Anthropic-compatible /v1/messages endpoint because its usage accounting exposes cache reads and writes cleanly (cache_read_input_tokens / cache_creation_input_tokens). Other models continue to use OpenAI-compatible chat completions. The provider caps advertised output at 128K tokens to stay within Pioneer's streaming limits for models such as gpt-5.5.

  • Claude/Anthropic models: Sent through /v1/messages with Anthropic cache_control markers
  • OpenAI/GPT models (GPT-4, GPT-5 families): Sent through /v1/messages so cached prompt tokens are reported as cache reads instead of full prompt input.
  • pioneer/auto: Sent through /v1/messages so router choices, including GPT routes, get the cleaner cache accounting

Router caveat: pioneer/auto remains available, but Pioneer's router can be less reliable than selecting a concrete model on very long, mixed agent conversations (for example sessions with large context, prior tool calls/results, and prior responses from multiple model APIs). The provider disables Pi extended-thinking for pioneer/auto because router-selected upstreams can reject Anthropic thinking payloads; use concrete models such as pioneer/gpt-5.5 or specific Claude models when you need explicit thinking blocks/tokens. Concrete models still use /v1/messages and preserve the clearer prompt-cache accounting.

See Pioneer's prompt caching guide for details.

Usage

After installation and authentication, select a Pioneer model via /model or Ctrl+L inside Pi.

Example prompt:

Write a TypeScript function that fetches JSON from an API and retries on failure.

Privacy

By default, Pioneer persists every inference — input, output, and metadata — to drive evaluation, use-case clustering, and adapter training. This fork sets compat.supportsStore: true on each model so Pi emits store: false on every request, disabling that retention.

If you want retention enabled, use the upstream package instead.

Requirements

  • Pi coding agent (@earendil-works/pi-coding-agent)
  • Pioneer AI API key (starts with pio_sk_)

License

MIT