Skip to main content

Module model_refresh

Module model_refresh 

Source
Expand description

ultron update --models (refreshModelCatalogs of package-manager-cli.ts): every provider that refreshes its catalog and has a credential refreshes it from the network, as ModelRuntime.refresh({ allowNetwork: true, force: true }) does: built-in providers revalidate their pi.dev catalog, Radius providers (the built-in one and models.json "oauth": "radius" ones) load <gateway>/v1/config with their key (an expired OAuth token is refreshed first). Results land in models-store.json, which every later start restores.

Evidence: crates/ai/fixtures/generate-model-refresh.mjs; tests/model_refresh.rs replays it.

Constants§

REFRESH_TIMED_OUT
refresh_catalogs’ error when its whole budget ran out (result.aborted after the timer in TS).

Functions§

refresh_catalogs
The model runtime’s refresh: refresh_catalogs_from pi.dev, or nothing when offline (PI_OFFLINE).
refresh_catalogs_from
refresh_model_catalogs’ per-provider failures, in provider order; Err when the whole refresh timed out. Without force, a pi.dev catalog checked within the last four hours is not asked again (a login’s refresh).
refresh_model_catalogs
Refresh every provider’s stored catalog. Err is the message ultron update --models prints after Error: .