@ganziliang/zhizh-pi-model-setup
v0.2.0
Published
Interactive model setup extension for Pi and Zhizhengroup LLM Gateway
Maintainers
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-setupStart Pi:
piRun the setup command inside Pi:
/model-setupObtain apiId and API Key
Before running /model-setup, open the following gateway page:
https://llm-gateway.zhizhengroup.com/admin-next/api-statsUse 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-c13686fabdd0You 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-c13686fabdd0or the complete URL copied from the browser address bar:
https://llm-gateway.zhizhengroup.com/admin-next/api-stats?apiId=56b07442-eb3d-43af-8c23-c13686fabdd0The 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.jsonOn Windows, ~/.pi/agent normally means:
C:\Users\<your-windows-user>\.pi\agentThe extension manages these providers:
company-gpt
company-anthropicThe 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:
/reloador restart Pi.
Update
Update the installed package when a new version is released:
pi update npm:@ganziliang/zhizh-pi-model-setupRemove
pi remove npm:@ganziliang/zhizh-pi-model-setupRemoving 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