The Laravel team just released version 1.0 of the Laravel AI SDK, the first-party package that gives you one API for working with AI providers in a Laravel app.
The SDK was first announced in February. This release adds a new classification capability, support for two frontend chat protocols, and a new storage format for conversations. It also includes breaking changes, so check the upgrade notes below before you update.
composer require laravel/ai
Classification
Classification is now its own capability, alongside text, images, audio, and embeddings. It covers quick decisions such as routing a support ticket or flagging a comment. It runs on Jev models from TypeSafe, and the post says Jev can answer these questions "in milliseconds at a fraction of the price of traditional LLMs."
You ask a set of questions and get a typed answer for each one:
use Laravel\Ai\Classification;use Laravel\Ai\Classification\Boolean;use Laravel\Ai\Classification\Choice; $response = Classification::of($ticket->body)->questions([ 'is_urgent' => new Boolean('Does this message convey urgency?'), 'department' => new Choice('Which team should handle this?', [ 'billing' => 'Payments, invoicing, refunds', 'technical' => 'Bugs, outages, integrations', 'sales' => 'Pricing, plans, upgrades', ]),])->classify(); $response['is_urgent']->isTrue();$response['department']->choice; // 'technical'
There's also a Score question type that returns a value from 0.0 to 1.0. For a single yes-or-no question, the new Str::decide macro returns a boolean, and a threshold argument sets how certain the model has to be:
Str::of($message)->decide('Is this spam?');
Classification works with TypeSafe and OpenRouter today. The team plans to add other providers behind the same API as they ship similar models.
Vercel Chat and AG-UI Streaming
The SDK can now read requests and stream responses using the Vercel Chat and AG-UI protocols, so you can pair it with frontend libraries that already speak them. Here is a Vercel chat route:
use Illuminate\Http\Request;use Laravel\Ai\Vercel\Vercel; Route::post('/chat', function (Request $request) { $chat = Vercel::chat($request); return (new SupportAgent) ->withMessages($chat->history()) ->stream($chat) ->usingProtocol($chat->protocol());});
That route reads the new message, updates the conversation history in your database, and processes any tool approvals the user submitted. For AG-UI clients such as CopilotKit, call usingAgentUserInteractionProtocol() on the stream instead. Vercel::toUiMessages() converts stored messages back into the client's format when you need to rebuild a chat screen after a page reload.
Approvable Tool Calls
A tool that implements the Approvable contract and uses the InteractsWithApprovals trait pauses the agent until someone approves it. This works great for a tool that deletes files:
use Laravel\Ai\Concerns\InteractsWithApprovals;use Laravel\Ai\Contracts\Approvable;use Laravel\Ai\Contracts\Tool; class DeleteFile implements Approvable, Tool{ use InteractsWithApprovals; // ...}
The response lists each pending call with the arguments the model picked. You resume the conversation with a decision for each one. A decision can approve the call, reject it with a reason the model sees, or edit the arguments before the tool runs. Approvals work with prompt, stream, queue, and the broadcast methods. We covered tool approvals when they landed in July.
Other Changes in 1.0
- Per-step middleware: Agent middleware now runs on every generation step instead of once per prompt. Each step arrives as a
PendingStepthat you can change with methods such aswithModel,withTools,withoutTools, andwithMaxTokens. For example, you can remove an expensive tool after the agent has used it once. - Tool search: Wrap rarely used tools in
ToolSearchand the provider loads them only when a prompt needs them. This works on OpenAI and Anthropic. - Code execution: The
CodeExecutionprovider tool runs code in the provider's sandbox, on Anthropic, OpenAI, Azure, Gemini, and xAI. - Conversation steps: Messages now store a single
stepsJSON column with one entry per round-trip, and each tool result is stored with the call that produced it. - Usage reporting:
promptTokensandcompletionTokensare nowinputTokensandoutputTokens, and include the provider's full counts across every provider.
Upgrading to 1.0
The breaking changes are mostly in conversation storage, agent middleware, token usage, and stream protocols. If you run raw SQL against the tool_calls or tool_results columns, you'll need to move it to steps. The upgrade guide also includes a backfill migration that you must run once before you deploy 1.0.
The team recommends handing most of the upgrade to an AI assistant with Laravel Boost:
composer require laravel/boost --devphp artisan boost:install
Then run the /upgrade-ai-sdk-v1 slash command in Claude Code, Cursor, OpenCode, Gemini, or VS Code, and Boost walks your assistant through the guide one change at a time.
Read the full announcement for every code sample, and see the AI SDK documentation to get started.