@aihubmix/pi-provider-aihubmix

Official AIHubMix provider extension for the Pi coding agent

Packages

Package details

extension

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

$ pi install npm:@aihubmix/pi-provider-aihubmix
Package
@aihubmix/pi-provider-aihubmix
Version
0.1.0
Published
Aug 24, 2026
Downloads
155/mo · 155/wk
Author
chenxue
License
MIT
Types
extension
Size
55.6 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/index.ts"
  ]
}

Security note

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

README

@aihubmix/pi-provider-aihubmix

Official AIHubMix provider extension for the Pi coding agent.

The extension registers AIHubMix as the aihubmix provider, uses Pi's native API-key login, and keeps the model catalog current through the AIHubMix Models API. It is maintained by AIHubMix and does not add affiliate, referral, or tracking headers to model requests.

Install

pi install npm:@aihubmix/pi-provider-aihubmix

Set an API key:

export AIHUBMIX_API_KEY="AIHUBMIX_YOUR_API_KEY"

Alternatively, run /login in Pi and select AIHubMix.

Then choose a model with /model, or run Pi directly:

pi --provider aihubmix --model gpt-5.6-sol

Model Catalog

Pi can refresh the catalog from:

https://aihubmix.com/api/v1/models?types=llm

The package also includes an auditable fallback snapshot generated from the AIHubMix provider catalog on models.dev. This makes the provider usable when Pi starts offline before it has stored a live catalog.

Opening Pi's model selector refreshes dynamic provider catalogs. Pi persists successful refreshes and restores them on later offline starts.

Non-interactive local development runs such as pi -e ./extensions/index.ts -p ... use the committed snapshot or an already persisted catalog. Open the model selector once before testing a newly added live model that is not yet in the snapshot.

Only LLM records containing all metadata required by Pi are registered: model ID, text input support, context window, maximum output, and input/output pricing. Incomplete records are skipped rather than filled with guessed limits or prices. Pi currently accepts text and image inputs, so other advertised input modalities are not exposed by this extension.

Protocol routing uses the Models API's endpoints field:

Catalog endpoint Pi API Base URL
chat_completions or legacy empty value OpenAI Chat Completions https://aihubmix.com/v1
claude_api without Chat Completions Anthropic Messages https://aihubmix.com
gemini_api without Chat Completions Gemini native https://aihubmix.com/gemini/v1beta

When several endpoints are available, the unified OpenAI-compatible endpoint is preferred. Routing never depends on model-name prefixes.

Pi sends enabled coding tools with agent requests. If an upstream route rejects tools for a particular model, use --no-tools for text-only work or choose a model whose current route supports tool calling.

Updating the Snapshot

npm install
npm run catalog:update
npm run check

The generated file is committed so catalog changes remain reviewable.

All committed configuration examples use AIHUBMIX_XXX placeholders. Never commit a real API key. Start local configuration from .env.example and keep the populated file outside version control.

Local Development

npm install
npm run check
pi -e ./extensions/index.ts --list-models aihubmix

To test an actual request, set AIHUBMIX_API_KEY and run:

pi -e ./extensions/index.ts --provider aihubmix --model gpt-5.6-sol -p "Reply with exactly: AIHubMix OK"

Conflicting Extensions

Only one extension should register the aihubmix provider. Remove other AIHubMix Pi provider packages before installing this official package.

Agent Documentation

Repository structure, invariants, validation commands, and release gates for coding agents are documented in README_AGENT.md. Compatible agents can also discover these rules through AGENTS.md.

License

MIT