pi-cliproxyapi-provider 0.16.4 → 0.16.6
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/data/models-dev-fallback.json +1 -1
- package/package.json +1 -1
- package/src/runtime.ts +3 -1
package/package.json
CHANGED
package/src/runtime.ts
CHANGED
|
@@ -37,7 +37,9 @@ export class ProviderRuntime {
|
|
|
37
37
|
|
|
38
38
|
async refreshModels(context: RefreshModelsContext): Promise<ProviderModelConfig[]> {
|
|
39
39
|
if (!context.allowNetwork) {
|
|
40
|
-
|
|
40
|
+
// Pi runs an offline refresh of every provider whenever any provider registers,
|
|
41
|
+
// so reuse the loaded snapshot rather than re-reading and rebuilding the caches.
|
|
42
|
+
const snapshot = this.options.catalog.current() ?? await this.options.catalog.load();
|
|
41
43
|
return normalizeProviderModels(
|
|
42
44
|
snapshot.built.models.length > 0 ? snapshot.built.models : buildUnavailableProviderModels(),
|
|
43
45
|
this.options.config.baseUrl,
|