pi-model-inherit
pi extension that lets providers and models inherit shared configuration instead of repeating it
Package details
Install pi-model-inherit from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-model-inherit- Package
pi-model-inherit- Version
0.1.2- Published
- Sep 30, 2026
- Downloads
- 421/mo · 25/wk
- Author
- jalaxy33
- License
- Apache-2.0
- Types
- extension
- Size
- 38.9 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/model-inherit/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-model-inherit
English | 简体中文
pi extension that lets providers and models inherit shared configuration instead of repeating it
{
// 1. default block: values every provider inherits
"default": {
"providers": {
"*": { "compat": { "sendSessionAffinityHeaders": true } }
}
},
"providers": {
"my-gateway": {
"baseUrl": "https://gateway.example/v1",
"api": "openai-completions",
"models": [
// 2. inherit field: copy another model's configuration
{ "id": "glm-5.3", "inherit": "zai/glm-5.3" },
// and may still override single fields
{ "id": "glm-5.3-fast", "inherit": "zai/glm-5.3", "maxTokens": 1000 }
]
}
}
}
Install
From npmjs:
pi install npm:pi-model-inherit
From GitHub:
pi install git:github.com/jalaxy33/pi-model-inherit
How to Use
default block
Values every provider inherits. "*" covers all of them, a provider id narrows it.
{
"default": {
"providers": {
"*": { "compat": { "sendSessionAffinityHeaders": true } },
"my-gateway": { "headers": { "x-team": "core" } }
}
}
}
| Key | Applied |
|---|---|
compat, headers |
On models and on requests. No provider is repackaged, nothing is written to your file. |
name, baseUrl, apiKey, api, oauth, authHeader |
Matched providers get a composed config, as if those keys were in providers. |
models, modelOverrides |
Not supported: definitions and overrides are not defaults. |
An explicit value always wins, including false. Object fields merge key by key, everything else is replaced.
inherit field
{ "id": "glm-5.3", "inherit": "zai/glm-5.3" }
inheritis the model to copy:"provider/modelId".- The model
idmust be provided. - The inherited fields can be overridden (e.g.
"maxTokens": 1000).