zakriat / laravel-deepseek-r1
Laravel-first Deepseek R1 AI integration with Guzzle
v1.0.0
2025-01-27 06:37 UTC
Requires
- php: ^8.2
- ext-json: *
- guzzlehttp/guzzle: ^7.8
- laravel/framework: ^11.0
Requires (Dev)
- mockery/mockery: ^1.6.7
- orchestra/testbench: ^9.0
- phpunit/phpunit: ^10.5
README
Professional Laravel integration for Deepseek R1 API with Guzzle HTTP client.
Features
- Laravel Service Provider & Facade
- Configurable timeouts and retries
- Full exception handling
- Ready for horizontal scaling
- PSR-4 compliant structure
- Comprehensive test suite
Installation
composer require zakriat/laravel-deepseek-r1 # Publish config file php artisan vendor:publish --provider="Zakriat\DeepseekR1\DeepseekServiceProvider"
Usage
use Zakriat\DeepseekR1\Facades\DeepseekR1; // In your controller or service $response = DeepseekR1::chatCompletion([ 'model' => 'deepseek-r1', 'messages' => [ ['role' => 'user', 'content' => 'Explain quantum computing in simple terms'] ] ]); // Access response content echo $response['choices'][0]['message']['content'];
Configuration
Add to your .env
:
DEEPSEEK_API_KEY=your_api_key_here
DEEPSEEK_BASE_URI=https://api.deepseek.com/v1/
DEEPSEEK_TIMEOUT=30 # seconds
DEEPSEEK_RETRIES=3 # retry attempts