← Catalog

pi-provider-ampersand-bridge

Unofficial ai& (api.aiand.com) model provider for Pi with live model discovery

Extension

Install

Install with PiG

pig install npm:pi-provider-ampersand-bridge

Install with Pi

pi install npm:pi-provider-ampersand-bridge
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "image": "https://raw.githubusercontent.com/grikomsn/pi-provider-ampersand-bridge/main/assets/cover.jpg",
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.0 (README.md). PiG does not review it.

Ampersand Bridge provider for Pi

pi-provider-ampersand-bridge

npm CI License: MIT

An unofficial Pi provider for the ai& OpenAI-compatible API at api.aiand.com. Not affiliated with or endorsed by ai&; it just talks to the public service with your own API key.

Features

  • Discovers every model available to your key from ai&'s authenticated GET /v1/models endpoint
  • Ships the current ai& catalog as an offline fallback (DeepSeek, GLM, Kimi, Qwen, Gemma, GPT OSS, Motif)
  • Uses live context, output, modality, reasoning-effort, and pricing metadata when ai& returns it
  • Supports Pi's thinking selector through the standard OpenAI reasoning_effort request field
  • Uses Pi's built-in OpenAI Chat Completions transport—no custom protocol or runtime dependency

Install

pi install npm:pi-provider-ampersand-bridge

To try a local checkout:

pi -e ./src/index.ts

Authenticate

Create a key in the ai& console and export it before starting Pi:

export AMPERSAND_API_KEY="your-key"
pi

You can instead store an API-key credential for the ampersand provider in Pi's auth.json, or override the provider in models.json.

Select a model with /model. Refresh the remote catalog with Pi's normal model refresh flow (pi update --models). If discovery is temporarily unavailable, the extension retains the last successful catalog, or the bundled fallback on first use. The provider registers the catalog Pi last persisted (models-store.json in the agent directory), so a saved defaultModel that only the live catalog lists resolves from the first moment the provider exists. As with every authenticated Pi provider, models become selectable after a key is configured.

Thinking effort

Use Pi's thinking-level control as usual. Each model advertises its own accepted efforts from the live catalog, and Pi never sends a level the model refuses:

  • deepseek-ai/*, google/gemma-4-31b-it, motif-technologies/motif-3, qwen/qwen3.6-27b expose off, high, and (where listed) max
  • zai-org/glm-5.3* and moonshotai/kimi-k3* are always-on reasoners with low, high, and max
  • qwen/qwen3.8-27b and meta/muse-spark-open run up to xhigh; openai/gpt-oss-120b runs low to high

DeepSeek V4 Flash, Kimi K2.7 Code, and GLM 5.2 reached end of support on 2026-10-27 and are filtered from live listings (their replacements are DeepSeek V4.1 Flash, Kimi K3, and GLM 5.3 Flash).

Models that do not accept medium natively map Pi's default medium level to the catalog's reasoning_effort_default (for example Kimi K3 defaults to max, Gemma 4 to none), so a fresh session starts at the effort ai& nominates.

Model metadata

The fallback catalog mirrors the live GET /v1/models response (USD per million tokens):

ModelContextMax outputInputReasoning efforts
deepseek-ai/deepseek-v4.1-flash1,048,576384,000text, imagenone, high, max
deepseek-ai/deepseek-v4.1-flash-10171,048,576384,000text, imagenone, high, max
zai-org/glm-5.31,048,576131,072textlow, high, max
zai-org/glm-5.3-flash1,048,550131,072text, imagelow, high, max
qwen/qwen3.8-27b262,14432,768text, imagenone, low, medium, xhigh
moonshotai/kimi-k31,048,576131,072text, imagelow, high, max
moonshotai/kimi-k3.1-pro1,048,576131,072text, imagelow, high, max
meta/muse-spark-open1,048,576943,718text, imagelow, medium, high, xhigh
google/gemma-4-31b-it262,14432,768text, imagenone, high
motif-technologies/motif-3262,144262,144textnone, high
qwen/qwen3.6-27b262,14465,536text, imagenone, high
deepseek-ai/deepseek-v4-pro1,048,576384,000textnone, high, max
openai/gpt-oss-120b131,07232,768textlow, medium, high

An authenticated /models response replaces this list, so newly released or account-specific models appear without an extension release.

Account balance

Run /ampersand-balance in a session to fetch GET /billing/balance for your configured key. The command reports remaining credits (USD or JPY) or, for pay-as-you-go accounts, the number of requests remaining in today's allowance.

Catalog hardening

The live discovery pipeline mirrors the companion VS Code bridge so both projects see the same catalog:

  • Default reasoning effort: the catalog's reasoning_effort_default (or the bundled per-model default) steers Pi's default medium thinking level whenever a model does not accept medium natively, so a fresh session lands on the effort ai& nominates.
  • Chat models only: listings for embedders, rerankers, and image/audio/video models are filtered out, and model ids are canonicalized (trimmed, lowercased) before matching the bundled catalog.
  • Field aliases: context_length / max_context_tokens / max_model_len are accepted alongside context_window, max_completion_tokens alongside max_output_tokens, and pricing is read from a nested pricing object (prompt / completion / cache_prompt) or the flat per-million strings. Image input falls back to architecture.input_modalities and vision-style names when no modality data is present.
  • Transient-failure retry: /models and /billing/balance requests retry 429/502/503/504 responses and transient network errors up to three attempts with capped exponential backoff, honoring Retry-After (≤5s). Discarded responses are released before retrying, backoff stops as soon as the request is aborted or times out, and both requests refuse redirects (redirect: "error") so the bearer key is never forwarded; a refused redirect is not retried.

Development

npm install
npm run check
npm run package

Project

License

MIT