Search by

llmesh / laravel

fyunusa

First-class Laravel integration for LLMesh — the flexible PHP LLM SDK

dev-main 2026-06-07 06:19 UTC

This package is auto-updated.

Last update: 2026-09-07 06:51:58 UTC


README

Latest Stable Version PHP Version Framework Version License

A first-class Laravel adapter package to integrate LLMesh Core seamlessly into your Laravel applications.

Installation

Install via Composer:

composer require llmesh/laravel

Configuration

Publish the config file:

php artisan vendor:publish --tag="llmesh-config"

Configure your environment keys in .env:

LLMESH_PROVIDER=openai
OPENAI_API_KEY=your-api-key

Quick Start

You can use the LLMesh facade directly in your controllers or services:

use LLMesh\Laravel\Facades\LLMesh;
use LLMesh\Core\Generators\GenerateTextOptions;

// Text Generation using the default configured provider
$response = LLMesh::generateText(
    GenerateTextOptions::make()->withPrompt('Tell me a programming joke.')
);

echo $response->getText();

Queueable Agent Jobs

The package provides a built-in RunAgentJob queueable job to delegate autonomous agent execution into the background:

use LLMesh\Laravel\Jobs\RunAgentJob;
use LLMesh\Core\Agents\Agent;

$agent = Agent::make($provider, 'You are a server reviewer.');

// Dispatch background agent execution
RunAgentJob::dispatch('user-session-123', $agent, 'Analyze the main server configuration.');