llmesh / laravel
First-class Laravel integration for LLMesh — the flexible PHP LLM SDK
dev-main
2026-06-06 20:51 UTC
Requires
- php: ^8.1
- laravel/framework: ^10.0|^11.0
- llmesh/core: ^0.1
Requires (Dev)
- orchestra/testbench: ^8.0|^9.0
- phpunit/phpunit: ^10.0|^11.0
This package is auto-updated.
Last update: 2026-06-06 20:55:22 UTC
README
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.');