@benvargas/pi-synthetic-provider

extensionmaintained

Synthetic (synthetic.new) model provider for pi - Dynamic model fetching with reasoning, vision, and tools support

by · v1.2.3 · published 2d ago

$ pi install npm:@benvargas/pi-synthetic-provider
downloads/mo
0
stars
104
last push
1d ago
open issues
0

Signals

license: MITtestspi manifest: missinginstall size: —deps: 0peer deps: 0

Download trend

No downloads in the last 12 weeks.

README

@benvargas/pi-synthetic-provider

Synthetic model provider for pi, the AI coding agent.

Features

  • Dynamic model discovery -- models fetched live from the Synthetic API at each session start
  • OpenAI Completions API -- reuses pi's built-in streaming, no custom implementation
  • Tool calling -- full support via OpenAI-compatible tool use
  • Vision support -- image input for models that support it (e.g., Kimi-K3)
  • Reasoning support -- extended thinking for reasoning-capable models
  • Cost tracking -- accurate per-token pricing parsed from the API
  • Graceful degradation -- fallback model list if the API is unreachable

Installation

pi install npm:@benvargas/pi-synthetic-provider

Or try without installing:

pi -e npm:@benvargas/pi-synthetic-provider

Setup

Option 1: Environment Variable

export SYNTHETIC_API_KEY="syn_your_key_here"
pi

Option 2: Auth Storage (persistent)

Add to ~/.pi/agent/auth.json:

{
  "synthetic": {
    "type": "api_key",
    "key": "syn_your_key_here"
  }
}

Option 3: Runtime CLI Flag

pi --model synthetic/hf:moonshotai/Kimi-K3 --api-key syn_your_key_here

Usage

# Interactive model selection
pi /model

# Direct model selection
pi --model synthetic/hf:moonshotai/Kimi-K3

# Or use provider + model flags separately
pi --provider synthetic --model hf:moonshotai/Kimi-K3

Extension Command

  • /synthetic-models -- display all available models with pricing and capabilities
  • /synthetic-quota -- display current Synthetic API quota usage, including rolling five-hour, weekly token, and search limits when available

Available Models

Models are fetched at startup from the Synthetic models endpoint. If the startup fetch fails, times out after three seconds, or returns no supported models, the provider falls back to the following hardcoded defaults:

Prices are $ per million tokens, current as of 2026-07-28.

ModelIDReasoningVisionContextMax OutputIn / Out / Cache
Synthetic Large Textsyn:large:textYesNo524K65K1.00 / 3.00 / 0.16
Synthetic Small Textsyn:small:textYesNo196K65K0.10 / 0.50 / 0.02
Synthetic Large Visionsyn:large:visionYesYes524K65K3.00 / 15.00 / 0.45
Synthetic Small Visionsyn:small:visionYesYes262K65K0.45 / 3.60 / 0.09
GLM 5.2hf:zai-org/GLM-5.2YesNo524K65K1.00 / 3.00 / 0.16
GPT OSS 120Bhf:openai/gpt-oss-120bYesNo131K65K0.10 / 0.10 / 0.02
Kimi K3hf:moonshotai/Kimi-K3YesYes524K65K3.00 / 15.00 / 0.45
Qwen 3.6 27Bhf:Qwen/Qwen3.6-27BYesYes262K65K0.45 / 3.60 / 0.09
MiniMax M3hf:MiniMaxAI/MiniMax-M3YesYes262K65K0.60 / 1.20 / 0.12
GLM 4.7 Flashhf:zai-org/GLM-4.7-FlashYesNo196K65K0.10 / 0.50 / 0.02
Nemotron 3 Super 120Bhf:nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-NVFP4YesNo262K65K0.30 / 1.00 / 0.06

The syn:* ids are permalinks that Synthetic re-points as models rotate, so configs using them survive model retirements — syn:large:vision moved from Kimi K2.7-Code to Kimi K3 in this release. The hf:* ids pin a specific model and break when it is retired.

Thinking levels on permalinks

When models are discovered live, a syn:* permalink inherits its current target's thinking-level support, resolved from the catalog's hugging_face_id. Selecting syn:large:vision gives you the same levels as hf:moonshotai/Kimi-K3.

This follows a re-point automatically only when the new target is one of the models already in the verified override table. Those maps come from live probing — which reasoning_effort values a model accepts, and which silently disable reasoning — and cannot be derived from the catalog, since supported_features reports only that a model reasons, not how it can be steered. If Synthetic re-points a permalink to a model this package has not probed, the permalink stops emitting reasoning_effort until a release adds it.

That is the deliberate failure mode: when the target is unrecognized, or the catalog row declares no reasoning support, the permalink emits nothing rather than guessing. A rejected value fails the whole request, while omitting it simply runs at the server-side default.

In the offline fallback list, permalinks never emit reasoning_effort at all — with no catalog row there is no way to know what the alias currently points at. Note that pi still displays thinking levels off through high for them, because those entries set reasoning: true; the selections just have no effect on the request.

Kimi K3 is at beta launch pricing; Synthetic expects to lower it as engine optimization improves. Run /synthetic-models inside pi for the live catalog.

API Key Priority

When multiple sources are configured, pi checks in this order:

  1. CLI runtime flag (--api-key)
  2. Auth storage (~/.pi/agent/auth.json)
  3. OAuth credentials (if configured)
  4. Environment variable (SYNTHETIC_API_KEY)

Requirements

Notes

  • On newer Synthetic accounts, /synthetic-quota prefers the current rolling five-hour and weekly token limits over the legacy subscription bucket, while still showing search usage when present.
  • The provider refresh path is compatible with current pi releases that expect dynamic provider updates to go through pi.registerProvider(...).

Uninstall

pi remove npm:@benvargas/pi-synthetic-provider

License

MIT