Updating the registry
Refresh the catalog and pricing from a remote URL
Updating the registry
Model pricing changes over time. The ai:update-registry command fetches a fresh provider/model catalog from a remote URL, upserts it into the database, and (optionally) persists the file locally for future offline seeds.
Configure the source
php
// config/oi-laravel-ai.php
'registry' => [
'path' => env('OI_AI_REGISTRY_PATH', storage_path('app/ai-registry.json')),
'url' => env('OI_AI_REGISTRY_URL', 'https://raw.githubusercontent.com/oi-lab/oi-laravel-ai/main/assets/registry.json'),
],Run the command
bash
php artisan ai:update-registryIt will:
- Fetch the registry JSON from
registry.url(or--url). - Validate and decode it (
providersandmodelskeys are required). - Upsert providers and models into the database.
- Save the downloaded file to
registry.path, if that location is writable.
Options
| Option | Effect |
|---|---|
--url=<url> | Override the configured registry URL for this run. |
--no-write | Upsert the catalog without persisting the downloaded file. |
x> If registry.path is not writable, the catalog is still upserted but the file is not saved, and the command warns you. Point registry.path at a writable, host-owned location to enable offline re-seeding.
Scheduling
Refresh pricing periodically from your console schedule:
php
// routes/console.php
Schedule::command('ai:update-registry')->weekly();