vaibhavjethva/laravel-ai-health
最新稳定版本:v0.1.0
Composer 安装命令:
composer require vaibhavjethva/laravel-ai-health
包简介
Health checks for Laravel AI providers via ai:health Artisan command.
README 文档
README
Provider health checks for laravel/ai.
What This Package Does
This package adds an Artisan command:
php artisan ai:health
It checks each configured AI provider and reports:
- whether provider config exists
- whether API key is present
- whether a basic request succeeds
- request latency
- optional streaming check
Installation
Install as a normal runtime dependency:
composer require vaibhavjethva/laravel-ai-health
require vs require-dev
- Use
require(recommended): if you will runai:healthin CI, staging, or production checks. - Use
require-dev: only if you want local-only usage and do not need this command outside development.
composer require --dev vaibhavjethva/laravel-ai-health
This package uses Laravel package auto-discovery, so no manual service provider registration is required.
Usage
Check all configured providers in config/ai.php:
php artisan ai:health
Check only selected providers:
php artisan ai:health --provider=openai --json php artisan ai:health --provider=openai --provider=groq
Also test streaming:
php artisan ai:health --stream
Fail CI when any provider is unhealthy/degraded/healthy:
php artisan ai:health --fail-on=unhealthy php artisan ai:health --fail-on=degraded php artisan ai:health --fail-on=healthy
Typical Output Meaning
HEALTHY: request succeededDEGRADED: base request works but streaming check failedUNHEALTHY: config/key/request failed
Options
--provider=*Check one or more specific configured providers by config key name. Example:--provider=openai --provider=groq--streamAlso perform a streaming request test.--jsonOutput machine-readable JSON.--fail-on=healthy|degraded|unhealthyExit with code1if any checked provider matches the selected status. Default behavior is equivalent to--fail-on=unhealthy.
Exit Codes
0: no failure condition matched.1: at least one provider matched the selected failure condition.
Requirements
- PHP
^8.3 laravel/ai^0.2|0.x-devilluminate/support^11.0|^12.0
Notes
- Providers are read from
config('ai.providers'). - Missing API key is treated as
unhealthyfor providers that require keys. ollamacan be checked without an API key.
Troubleshooting
- Command not found:
run
php artisan package:discoverand try again. - All providers show
API key is missing: set provider keys in.envand verifyconfig/ai.phpmappings. - Local development with a path repository:
run
composer update vaibhavjethva/laravel-ai-health -W.
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-01