omarelnaghy / laravel-ai-copilot
Plug-and-play Laravel AI Copilot: unified AI API (OpenAI, Anthropic, Ollama)
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/omarelnaghy/laravel-ai-copilot
Requires
- php: ^8.1
- illuminate/http: ^10.0 || ^11.0 || ^12.0
- illuminate/support: ^10.0 || ^11.0 || ^12.0
Requires (Dev)
- orchestra/testbench: ^9.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-laravel: ^2.4
- phpstan/phpstan: ^1.11
README
Plug-and-play unified AI API for Laravel 11. Swap providers (OpenAI, Anthropic, Ollama) with config and call one Facade: AI::.
Installation
composer require omarelnaghy/laravel-ai-copilot php artisan vendor:publish --tag=ai-config
Set environment variables:
OPENAI_KEY=sk-... AI_DRIVER=openai
Usage
use Omarelnaghy\LaravelAICopilot\Facades\AI; $summary = AI::summarize($article->body); $reply = AI::chat('Explain Laravel in 3 sentences'); $seo = AI::generate("Meta description for: {$product->name}");
Config
See config/ai.php for providers and defaults.
Testing
composer install
composer test
Roadmap
- Anthropic and Ollama drivers
- Embeddings + Vector search (pgvector, Pinecone, Qdrant)
- Retries, circuit breaker, middleware
- File summarization, image generation, OCR
- Memory, dashboards
License: MIT