New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

fomvasss/laravel-ai-tasks

AI task orchestrator for Laravel: routing, queue, audit, budget, webhooks
6,598 40
Install
composer require fomvasss/laravel-ai-tasks
Latest Version:3.39.0
PHP:^8.3
Laravel:12 · 13
Older releases:10 · 11
License:MIT
Last Updated:Oct 8, 2026
Links: GitHub  ·  Packagist
Maintainer: fomvasss

Laravel AI Tasks

License Latest Stable Version Total Downloads

AI task orchestrator for Laravel. Handles routing, queuing, audit logging, budget tracking, and webhook processing on top of laravel/ai as the transport layer.

Українською

Dashboard

  • Routing with fallback — a chain of drivers per task, the next one is tried when a provider is down
  • Queues — idempotency, delayed dispatch, retries of unusable results, onCompleted()/onFailed() hooks
  • Audit log — every run in ai_runs: driver, model, tokens, cost, duration, status
  • Budgets and cost tracking — per tenant, per driver and per model
  • Dashboard — runs, driver state, stuck runs, retry from the browser
  • Text, image, embeddings, TTS, transcription, tools & MCP, structured output, streaming
  • AI::fake() for tests

Requirements

  • PHP ^8.3
  • Laravel ^12 | ^13
  • laravel/ai ^1.2

Installation

composer require fomvasss/laravel-ai-tasks

php artisan vendor:publish --provider="Laravel\Ai\AiServiceProvider" --tag=ai-config
php artisan vendor:publish --tag=ai-tasks-config
php artisan vendor:publish --tag=ai-migrations
php artisan migrate
AI_DEFAULT=openai
OPENAI_API_KEY=sk-...

Security: the dashboard at /ai-tasks is open to anyone by default. Set dashboard.middleware to e.g. ['web', 'auth'] before deploying.

Quick start

php artisan ai:make-task SummarizeTask
use Fomvasss\AiTasks\DTO\AiPayload;
use Fomvasss\AiTasks\Tasks\AiTask;
use Laravel\Ai\Messages\UserMessage;

class SummarizeTask extends AiTask
{
    public function __construct(private readonly string $text) {}

    public function modality(): string
    {
        return 'text';
    }

    public function toPayload(): AiPayload
    {
        return new AiPayload(
            modality: 'text',
            messages: [new UserMessage("Summarize: {$this->text}")],
            systemPrompt: 'Reply in 3 sentences max.',
        );
    }
}
use Fomvasss\AiTasks\Facades\AI;

$response = AI::send(new SummarizeTask($text));   // sync
$runId = AI::queue(new SummarizeTask($text));     // queue
AI::stream(new SummarizeTask($text), fn (string $chunk) => print($chunk));

Documentation

Online: https://fomvasss.github.io/laravel-ai-tasks/ — the same pages as in docs/.

License

MIT — see LICENSE.

Support

If this package is useful to you, consider supporting its development:

Monobank Ko-Fi USDT TRC20

USDT TRC20: THLgp6DxiAtbNHvgnKV56vk1L38UuUagKf

Related Packages

spectra-php/laravel-spectra

Comprehensive observability for AI/LLM operations in Laravel applications

4,867 21
alidaaer/laravel-ai-agent

Give your Laravel app a brain, safely. Build AI Agents that can execute real act...

1,904 30
bherila/genai-laravel

Provider-agnostic GenAI client for Laravel: Gemini, AWS Bedrock, and more

11,344 0
zofe/ai-module

AI widget, tool registry and multi-provider service (Anthropic, OpenAI-compatibl...

109 0
cognesy/instructor-php

The complete AI toolkit for PHP: unified LLM API, structured outputs, agents, an...

142,285 328

Version History

Version Released PHP Laravel License
3.39.0 ^8.3 ^12.0|^13.0 MIT
3.38.1 ^8.3 ^12.0|^13.0 MIT
3.38.0 ^8.3 ^12.0|^13.0 MIT
3.37.0 ^8.3 ^12.0|^13.0 MIT
3.36.1 ^8.3 ^12.0|^13.0 MIT