anilcancakir/laravel-ai-sdk-plus
Composer 安装命令:
composer require anilcancakir/laravel-ai-sdk-plus
包简介
Laravel AI SDK Plus — A fork of the official Laravel AI SDK enriched with custom features.
README 文档
README
Laravel AI SDK Plus
A fork of the official Laravel AI SDK enriched with additional features. This package is kept in sync with the upstream laravel/ai repository as closely as possible — all core functionality remains identical.
Installation
composer require anilcancakir/laravel-ai-sdk-plus
Note: This package replaces
laravel/ai. You should not have both installed at the same time.
What's Different?
Everything from the official Laravel AI SDK works exactly the same. This fork adds the following features on top:
Agent Skills System
A file-based, discoverable system that allows AI agents to dynamically load domain-specific instructions and reference files at runtime. Skills are Markdown files with YAML front matter, placed in resources/skills/.
class DesignAgent extends Agent { use Skillable; public function skills(): iterable { return ['wind-ui']; } }
Thinking / Extended Reasoning
Configure thinking/reasoning behavior per agent using the #[Thinking] attribute. Works across all major providers with automatic parameter mapping.
use Laravel\Ai\Attributes\Thinking; #[Thinking] // Enable with defaults #[Thinking(effort: 'low')] // Reasoning effort (OpenAI, Gemini, OpenAI-Compatible) #[Thinking(budgetTokens: 10000)] // Token budget (Anthropic, Gemini) #[Thinking(effort: 'high', budgetTokens: 16000)] // Both
| Provider | Parameters |
|---|---|
| Anthropic | thinking.enabled, thinking.budgetTokens |
| OpenAI | reasoning.effort |
| Gemini | thinkingBudget, thinkingLevel |
| xAI | thinking.enabled |
| Ollama | thinking |
| OpenAI-Compatible | reasoning_effort |
OpenAI-Compatible Provider
Support for any OpenAI-compatible API endpoint (LocalAI, Ollama, vLLM, LiteLLM, etc.) as a first-class provider.
// config/ai.php 'providers' => [ 'my-provider' => [ 'driver' => 'openai-compatible', 'key' => env('MY_PROVIDER_API_KEY'), 'url' => 'https://api.my-provider.com/v1', 'models' => [ 'default' => 'gpt-4o', 'image' => 'image-model', ], ], ],
Text Generation
use Laravel\Ai\Ai; $response = Ai::textProvider('my-provider') ->prompt('Explain quantum computing in one sentence.');
Image Generation
Generate images through any OpenAI-compatible service that supports image generation via the chat completions endpoint:
use Laravel\Ai\Image; // Basic image generation $response = Image::of('A cat wearing a top hat')->generate('my-provider'); // Access the generated image $response->firstImage()->image; // Base64 content $response->firstImage()->mime; // e.g. 'image/png' // Save to disk $response->store('images', 'public'); // With size and quality options Image::of('A futuristic cityscape') ->landscape() ->quality('high') ->generate('my-provider'); // With reference image attachments use Laravel\Ai\Files\Image as ImageFile; Image::of('Make this image more vibrant') ->attachments([ ImageFile::fromPath('/path/to/reference.jpg'), ]) ->generate('my-provider');
Set a default image provider to skip specifying it every time:
// config/ai.php 'default_for_images' => 'my-provider', // Then simply: Image::of('A mountain at dawn')->generate();
Documentation
For core SDK documentation, refer to the official Laravel AI SDK docs.
Upstream Sync
This fork tracks the 0.x branch of laravel/ai. Upstream changes are merged regularly to stay current with the official release.
License
Laravel AI SDK Plus is open-sourced software licensed under the MIT license.
anilcancakir/laravel-ai-sdk-plus 适用场景与选型建议
anilcancakir/laravel-ai-sdk-plus 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 02 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「agents」 「ai」 「skills」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 anilcancakir/laravel-ai-sdk-plus 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 anilcancakir/laravel-ai-sdk-plus 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 anilcancakir/laravel-ai-sdk-plus 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Spatie's coding guidelines as AI skills for Laravel Boost and skills.sh
A skill system for Laravel AI SDK agents. Define reusable AI capabilities with SKILL.md files.
A symfony/console command for listing and introspecting AI skills files of a project.
Interactive CLI that generates customized Claude Code markdown files (CLAUDE.md, commands, agents) for PHP projects with Symfony, Laravel, Rector, PHPStan, PHP-CS-Fixer, GrumPHP and more.
Laravel Boost guidelines and skills for adrosoftware/laravel-data-proxy
AI Agent templates for Laravel development - Skills, Agents, and Workflows for enhanced coding assistance
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-13