laravel maintained by llmesh
LLMesh Laravel Adapter
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.');