@aarvay/pi-synthetic-provider

pi extension for the Synthetic model provider

Packages

Package details

extension

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

$ pi install npm:@aarvay/pi-synthetic-provider
Package
@aarvay/pi-synthetic-provider
Version
1.0.1
Published
Jun 5, 2026
Downloads
53/mo · 13/wk
Author
aarvay
License
MIT
Types
extension
Size
11.5 KB
Dependencies
0 dependencies · 1 peer
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

@aarvay/pi-synthetic-provider

pi extension that registers Synthetic as a custom model provider.

Installation

Try it once without installing:

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

Install permanently into your user settings:

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

Or install into a project (.pi/settings.json):

pi install -l npm:@aarvay/pi-synthetic-provider

Features

  • Dynamically discovers available models from Synthetic's public /models endpoint at startup
  • Falls back to hardcoded documented models if the fetch fails
  • Supports text and image input models
  • Tracks per-token pricing for cost estimation
  • Handles reasoning/thinking levels
  • Normalizes context overflow errors for automatic compaction and retry

Authentication

Synthetic requires an API key for inference. pi resolves the key in this priority order:

  1. ~/.pi/agent/auth.json entry:
    {
      "synthetic": {
        "type": "api_key",
        "key": "syn-..."
      }
    }
    
  2. SYNTHETIC_API_KEY environment variable

Models

The extension exposes all models returned by Synthetic's API. The documented aliases are:

  • syn:large:text — Large text model (GLM-5.1)
  • syn:small:text — Small text model (GLM-4.7-Flash)
  • syn:large:vision — Large vision model (Kimi-K2.6)
  • syn:small:vision — Small vision model (Qwen3.6-27B)

Use /model in pi to select a model.

Development

Test locally from the repo root without publishing:

pi -e ./packages/synthetic-provider

Troubleshooting

Models not loading: If the Synthetic API is unreachable at startup, the extension falls back to hardcoded models. Check your network connection with:

curl https://api.synthetic.new/openai/v1/models

API key errors: Verify your key is set via echo $SYNTHETIC_API_KEY or configured in ~/.pi/agent/auth.json.

License

MIT