better-custom

Pi and Oh My Pi extension for managing custom providers through an interactive wizard.

Packages

Package details

extension

Install better-custom from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:better-custom
Package
better-custom
Version
0.4.1
Published
Jul 26, 2026
Downloads
958/mo · 572/wk
Author
glammm
License
MIT
Types
extension
Size
60.1 KB
Dependencies
1 dependency · 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

better-custom

A better way to add custom providers for Pi and Oh My Pi (OMP).

Features

  • Add, edit, or delete custom providers from an interactive wizard
  • Supports:
    • OpenAI-compatible endpoints
    • Anthropic-compatible endpoints
    • Ollama-compatible endpoints
  • Uses the running host's agent directory automatically
    • Pi: models.json
    • OMP: models.yml / models.yaml
  • API key modes:
    • API key (stored verbatim in the active models config)
    • none (writes a placeholder so the provider still loads)
    • existing $ENV and !command keys are still resolved when re-probing
  • Auto-probe /models for OpenAI-compatible endpoints
  • Multi-select model picker for probed models
  • Unique provider names — the wizard refuses to overwrite an existing provider
  • Image input enabled by default (input: ["text", "image"]) so vision-capable models receive images instead of having them silently dropped
  • Reasoning enabled by default at the xhigh ceiling for newly added models
  • Safe delete flow for whole providers or individual models

Install

From npm:

pi install npm:better-custom

From GitHub:

pi install https://github.com/ratatulieoi/better-custom

Usage

After installing, reload pi if needed, then run:

/better-custom

The wizard can:

  1. Add a provider
  2. Edit a provider
  3. Delete a provider

Add a provider

Guides you through:

  • provider style (OpenAI / Anthropic / Ollama)
  • endpoint
  • provider name (must be unique)
  • API key method (API key or none)
  • model discovery (auto-probe /models) or manual model entry

Newly added models default to input: ["text", "image"] and reasoning: true at the xhigh ceiling. Tune any of this later via Edit provider.

Edit a provider

Pick a provider, then choose:

  • Re-probe for new models — query /models again and add ones not yet configured
  • Set context window (all models) — apply one contextWindow to every model
  • Edit per model — pick a model and edit a single field:
    • Reasoning ceiling (offxhigh)
    • Vision (text+image vs text-only)
    • Context window
    • Max output tokens
    • Headers / endpoint override (per-model baseUrl and JSON headers)
    • Delete this model
  • Add models manually
  • Rename provider — change the provider name (key) in the active models config

Per-model edits change one field in place, so untouched fields (cost, headers, overrides) are preserved.

Delete a provider

Lists configured providers and removes the selected one after confirmation.

How reasoning maps to pi

pi exposes six thinking levels: off, minimal, low, medium, high, xhigh. When a model has reasoning: true, pi treats minimal through high as available. xhigh is opt-in and only unlocked when explicitly mapped, and any level set to null is removed. The wizard writes a thinkingLevelMap to unlock xhigh or to cap reasoning below high.

Configuration

The extension uses the host-provided agent directory instead of hard-coding ~/.pi/agent. Existing models.yml, models.yaml, or models.json files are kept in their current format. A fresh OMP config is created as models.yml; normal Pi continues to use models.json.

Saving YAML rewrites its formatting and does not preserve comments.

Files

  • index.ts — extension entry point
  • package.json — pi package manifest

License

MIT