pi-cliproxyapi-provider 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -10
- package/data/models-dev-fallback.json +1 -1
- package/extensions/index.ts +26 -9
- package/package.json +27 -8
- package/src/cache.ts +12 -34
- package/src/catalog.ts +185 -0
- package/src/commands.ts +80 -67
- package/src/config.ts +0 -9
- package/src/cpa.ts +21 -7
- package/src/discovery.ts +2 -82
- package/src/model-capabilities.ts +54 -0
- package/src/models-dev.ts +3 -0
- package/src/provider.ts +13 -1
- package/src/runtime.ts +41 -0
- package/src/types.ts +3 -2
package/README.md
CHANGED
|
@@ -95,10 +95,12 @@ export CLIPROXYAPI_API_KEY=your-key
|
|
|
95
95
|
## Commands
|
|
96
96
|
|
|
97
97
|
```text
|
|
98
|
-
/cliproxyapi config
|
|
99
|
-
/cliproxyapi status
|
|
100
|
-
/cliproxyapi refresh
|
|
101
|
-
/cliproxyapi
|
|
98
|
+
/cliproxyapi config # interactive setup
|
|
99
|
+
/cliproxyapi status # show snapshots, capabilities, and enrichment counts
|
|
100
|
+
/cliproxyapi refresh # refresh models and metadata, then update pi immediately
|
|
101
|
+
/cliproxyapi refresh models # refresh CLIProxyAPI availability only
|
|
102
|
+
/cliproxyapi refresh metadata # refresh models.dev metadata only
|
|
103
|
+
/cliproxyapi aliases # show unmatched model IDs for metadata aliases
|
|
102
104
|
```
|
|
103
105
|
|
|
104
106
|
## Metadata aliases
|
|
@@ -127,20 +129,28 @@ Project config only reads `modelAliases`; other fields are ignored.
|
|
|
127
129
|
}
|
|
128
130
|
```
|
|
129
131
|
|
|
130
|
-
##
|
|
132
|
+
## Snapshots and startup
|
|
131
133
|
|
|
132
134
|
```text
|
|
133
|
-
CPA /v1/models
|
|
134
|
-
models.dev
|
|
135
|
+
CPA /v1/models: local snapshot at startup, then a background refresh
|
|
136
|
+
models.dev metadata: persistent local snapshot, refreshed manually
|
|
135
137
|
```
|
|
136
138
|
|
|
137
|
-
|
|
139
|
+
Snapshots live under:
|
|
138
140
|
|
|
139
141
|
```text
|
|
140
142
|
~/.cache/pi-cliproxyapi-provider/
|
|
141
143
|
```
|
|
142
144
|
|
|
143
|
-
Startup
|
|
145
|
+
Startup registers the provider immediately from the last-known-good local snapshots. It then refreshes CLIProxyAPI availability in the background with a short timeout and updates the provider dynamically if the model list changed. On a first run, Pi registers a placeholder until background discovery succeeds. Startup never fetches `models.dev`; it uses the persistent local metadata snapshot or `data/models-dev-fallback.json` when no snapshot exists.
|
|
146
|
+
|
|
147
|
+
Manual refreshes update the running provider immediately; `/reload` is not required. Failed refreshes retain the last-known-good data independently for each source.
|
|
148
|
+
|
|
149
|
+
A scheduled GitHub Actions workflow checks the bundled fallback catalog daily. When it changes, the workflow validates the package, bumps the patch version, commits the update, and starts the normal release workflow. Maintainers can also update the catalog locally with:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
npm run update:models-dev
|
|
153
|
+
```
|
|
144
154
|
|
|
145
155
|
## Test
|
|
146
156
|
|
|
@@ -150,4 +160,4 @@ npm test
|
|
|
150
160
|
|
|
151
161
|
## Release
|
|
152
162
|
|
|
153
|
-
|
|
163
|
+
Changing the `package.json` version on `master` automatically creates a matching Git tag and GitHub Release, generates release notes, and publishes the package to npm. Changed daily models.dev catalogs also produce automatic patch releases through the same workflow. See [RELEASING.md](RELEASING.md) for authentication, versioning, verification, and troubleshooting.
|