AIrelease
Workers AI - Reject busy synchronous inference requests
From the publisher
The rejectIfBusy option lets synchronous Workers AI inference requests fail when capacity is unavailable. Use it when your application should not wait in a capacity queue. Pass the option as the third argument to the Workers AI binding: const response = await env.AI.run( "@cf/google/gemma-4-26b-a4b-it", { messages: [{ role: "user", content: "Explain capacity queues." }], }, { rejectIfBusy: true }, ); const response = await env.AI.run( "@cf/google/gemma-4-26b-a4b-it", { messages: [{ role: "user", content: "Explain capacity queues."
Source Cloudflare DevelopersCC BY 4.0 · Publisher excerpt shortened and converted to plain text. Original source license applies.
Read full article

