@ganziliang/zhizh-pi-model-setup
Interactive model setup extension for Pi and Zhizhengroup LLM Gateway
Package details
Install @ganziliang/zhizh-pi-model-setup from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@ganziliang/zhizh-pi-model-setup- Package
@ganziliang/zhizh-pi-model-setup- Version
0.2.0- Published
- Sep 15, 2026
- Downloads
- 760/mo · 9/wk
- Author
- ganziliang
- License
- MIT
- Types
- extension, skill
- Size
- 19 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions"
],
"skills": [
"./skills"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
Zhizh Pi Model Setup
Pi extension for configuring the Zhizhengroup LLM Gateway without an existing model.
Install for team members
Install the published npm package:
pi install npm:@ganziliang/zhizh-pi-model-setup
Start Pi:
pi
Run the setup command inside Pi:
/model-setup
Obtain apiId and API Key
Before running /model-setup, open the following gateway page:
https://llm-gateway.zhizhengroup.com/admin-next/api-stats
Use the page to obtain your apiId and API Key. The apiId is available in the browser address bar after the page loads, for example:
https://llm-gateway.zhizhengroup.com/admin-next/api-stats?apiId=56b07442-eb3d-43af-8c23-c13686fabdd0
You can paste either the complete URL or only the value after apiId= into the setup wizard. Keep the API Key private and do not commit it to source control.
Setup steps
The wizard asks for the following values:
apiIdor the completeapi-statsURL.- The gateway API key.
- The default provider.
- The default model.
You can paste either the ID:
56b07442-eb3d-43af-8c23-c13686fabdd0
or the complete URL copied from the browser address bar:
https://llm-gateway.zhizhengroup.com/admin-next/api-stats?apiId=56b07442-eb3d-43af-8c23-c13686fabdd0
The extension queries the gateway, creates the available models, and updates the following local Pi files:
~/.pi/agent/models.json
~/.pi/agent/settings.json
~/.pi/agent/company-gateway.json
On Windows, ~/.pi/agent normally means:
C:\Users\<your-windows-user>\.pi\agent
The extension manages these providers:
company-gpt
company-anthropic
The generated company-gpt configuration marks GPT-5.6 models (gpt-5.6-luna, gpt-5.6-terra, and gpt-5.6-sol, including future suffix variants) as accepting both text and image input. This fallback is applied when the gateway stats response omits image metadata.
Preconfigured model tuning
Some gateway metadata lags behind the upstream providers. The extension corrects it while generating the configuration, so a fresh install is already tuned:
DeepSeek
DeepSeek retired the legacy names and now serves deepseek-v4-flash, deepseek-v4-flash-vision-exp, and deepseek-v4-pro with the DeepSeek-V4.1-Flash model. The official model name is deepseek-flash.
The gateway still reports the old contextWindow (128000), reasoning: false, and no image input for these models, and it does not list deepseek-flash at all. The extension therefore applies the official DeepSeek-V4.1-Flash specification to the whole family:
| Field | Value |
|---|---|
contextWindow |
1048576 (official context length: 1M) |
maxTokens |
393216 (official maximum output: 384K) |
reasoning |
true (thinking mode is the DeepSeek default) |
input |
["text", "image"] (V4.1-Flash is multimodal) |
deepseek-flash is added automatically right after deepseek-v4-flash, but only when the account already provides another DeepSeek model. The retired alias deepseek-v4-flash-vision-exp is skipped because it resolves to the exact same model.
Thinking level
The extension also sets the per-model thinking level in settings.json:
{
"modelThinkingLevels": {
"company-anthropic/deepseek-flash": "medium"
}
}
Existing entries in modelThinkingLevels are preserved; only the keys listed above are added or corrected.
Because these defaults live in the extension, re-running /model-setup keeps the tuned values instead of overwriting them with stale gateway metadata.
After setup completes, run:
/reload
or restart Pi.
Update
Update the installed package when a new version is released:
pi update npm:@ganziliang/zhizh-pi-model-setup
Remove
pi remove npm:@ganziliang/zhizh-pi-model-setup
Removing the package does not automatically remove the generated providers from models.json. Edit or remove company-gpt and company-anthropic if they are no longer needed.
Local development
The local path installation is only for the package maintainer and is not needed by normal users:
pi install "C:/Users/ganziliang/Desktop/ai_work/pi_agent/company-model-setup"
Publish a new version
Maintainers can publish a new version from the package directory:
npm version patch
npm publish --access public