Version 1.0.0 is the first stable release. It supports laravel/ai ^0.9 || ^0.10 || ^0.11 || ^1.0 in one codebase.
From 1.2 to 1.3
Run composer update meirdick/laravel-cf-workersai. You do not change your config. Check these points:
WorkersAiUsageReportednow also fires for Clef, Clairic and the new run API calls. If a listener adds up spend, it now counts them too.- The error for a document or audio attachment has new text. The exception class is the same.
From 1.0 or 1.1 to 1.2
Run:
composer update meirdick/laravel-cf-workersaiYou do not change your config. Check these points:
- Clef and Clairic work now. In 1.1.0, every live call failed, because the package could not read Cloudflare’s reply. Remove any workaround you added.
- A 200 reply with an error, or with no
answers, throwsAiException. A 408 throwsGatewayTimeoutException. Check any code that catches errors from these calls. - The package no longer rejects a third-party model such as
openai/gpt-5.5on the direct API. It still rejects aworkers-ai/-prefixed name there. See Models. - New in 1.2:
Extraction::fake(), theExtracting,ExtractedandExtractionFailedevents, andMeirdick\WorkersAi\Prompts\ExtractionPrompt. See Testing.
From 0.8.x
Run:
composer require "meirdick/laravel-cf-workersai:^1.0" -WYou do not change your config. Check these two things.
Cached token counts
If you read token counts from the usage object, check your code.
- On
laravel/ai0.9 to 0.11,Usage::$promptTokensnow excludes cached tokens. - On
laravel/ai1.x,TextUsage::$inputTokensincludes cached tokens.cacheReadInputTokensis the cached part.
WorkersAiUsageReported::$promptTokens is the uncached count on both lines. See Cost tracking.
Headers
The package now sends the headers key from the provider config. On laravel/ai 1.x it also sends headers set with Provider::withHeaders(). Before 1.0.0 the package dropped them. Check that your configured headers are headers you want to send. See AI Gateway.
From 0.6.x or earlier
If you use account_id with gateway, requests moved to the /compat path in 0.7.0. Also, throw_on_empty_response is now on by default, and #[UseCheapestModel] points to a new model. See Routes and Configuration.
From 0.5.x or earlier
Update laravel/ai in the same command:
composer require "laravel/ai:^1.0" "meirdick/laravel-cf-workersai:^1.0" -WTwo errors can appear after this upgrade. See Troubleshooting. The laravel/ai database schema changed between 0.9 and 0.11. Your own php constraint in composer.json must be ^8.3.