labskai / shopmade-ai
One AI chat client (xAI, OpenRouter, Anthropic) for Shopmade packages.
v0.1.0
2026-10-24 15:54 UTC
Requires
- php: ^8.4
- laravel/framework: ^13.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-28 23:09:44 UTC
README
One AI chat client for Shopmade core packages. It talks to any OpenAI-compatible chat endpoint: xAI, OpenRouter or Anthropic. MIT licensed.
Install
composer require labskai/shopmade-ai
php artisan ai:status # provider, model, and which keys are set (never the keys)
Configure
| Env | What |
|---|---|
AI_CHAT_PROVIDER |
xai (default), openrouter or anthropic |
AI_CHAT_MODEL |
Optional. Defaults: grok-4.6, openrouter/auto, claude-opus-5-5 |
XAI_API_KEY / OPENROUTER_API_KEY / ANTHROPIC_API_KEY |
The provider's key. AI_API_KEY is a fallback for xAI and Anthropic |
AI_XAI_BASE_URL, AI_OPENROUTER_BASE_URL, AI_ANTHROPIC_BASE_URL |
Optional base URL overrides |
Publish the config with php artisan vendor:publish --tag=shopmade-ai-config to change more.
Use
use Shopmade\Ai\ChatProvider; $reply = ChatProvider::complete($systemPrompt, $userMessage, temperature: 0.4); // null when not configured or on failure
ChatProvider::request() returns a ready PendingRequest for anything else on /chat/completions. Temperature is dropped for Anthropic, whose current models reject it.
Tests
cd ../shopmade-core composer config repositories.ai '{"type":"path","url":"../shopmade-ai"}' composer require "labskai/shopmade-ai:*@dev" vendor/bin/pest vendor/labskai/shopmade-ai/tests