deepseek-php / deepseek-php-client
deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.
Installs: 13 744
Dependents: 3
Suggesters: 0
Security: 0
Stars: 409
Watchers: 2
Forks: 43
Open Issues: 7
Requires
- php: ^8.1.0
- nyholm/psr7: ^1.8
- php-http/discovery: ^1.20.0
- php-http/multipart-stream-builder: ^1.4.2
- psr/http-client: ^1.0.3
- psr/http-client-implementation: 1.0
- psr/http-factory-implementation: *
- psr/http-message: ^1.1.0|^2.0.0
- symfony/http-client: ^6.4
Requires (Dev)
- guzzlehttp/guzzle: ^7.9.2
- guzzlehttp/psr7: ^2.7.0
- laravel/pint: ^1.18.1
- mockery/mockery: ^1.6.12
- nunomaduro/collision: ^7.11.0|^8.5.0
- pestphp/pest: ^2.36
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-type-coverage: ^2.8.7
- phpstan/phpstan: ^1.12.7
- roave/security-advisories: dev-latest
- symfony/var-dumper: ^6.4.11|^7.1.5
- dev-master
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.0.2
- 1.0.1
- 1.0.0.0
- dev-alek-s-andr-master
- dev-fix-symfony-client-compatibility
- dev-add-arabic-doc
- dev-support-many-http-clients
- dev-initilize-testes
- dev-enhance-client-contract
- dev-feat-list-available-models
- dev-feat-add-tests
- dev-bugfix-with-class-name
- dev-change-namespace-with-adding-change-logs
- dev-change-default-model-to-r2
- dev-bugfix-with-enum
- dev-add-emperature-enum
- dev-omaralalwi-patch-1
- dev-bugfix/temprature-type
- dev-feat/support-temperature-option
This package is auto-updated.
Last update: 2025-05-16 07:05:09 UTC
README
DeepSeek PHP Client
๐ Community-Driven PHP SDK for DeepSeek AI API Integration
Table of Contents
- โจ Features
- ๐ฆ Installation
- ๐ Quick Start
- ๐ Migration Guide
- ๐ Changelog
- ๐งช Testing
- ๐ Security
- ๐ค Contributors
- ๐ License
โจ Features
- Seamless API Integration: PHP-first interface for DeepSeek's AI capabilities.
- Fluent Builder Pattern: Chainable methods for intuitive request building.
- Enterprise Ready: PSR-18 compliant HTTP client integration.
- Model Flexibility: Support for multiple DeepSeek models (Coder, Chat, etc.).
- Streaming Ready: Built-in support for real-time response handling.
- Many Http Clients: easy to use
Guzzle http client
(default) , orsymfony http client
. - Framework Friendly: Laravel & Symfony packages available.
๐ฆ Installation
Require the package via Composer:
composer require deepseek-php/deepseek-php-client
Requirements:
- PHP 8.1+
๐ Quick Start
Basic Usage
Get started with just two lines of code:
use DeepSeek\DeepSeekClient; $response = DeepSeekClient::build('your-api-key') ->query('Explain quantum computing in simple terms') ->run(); echo $response;
๐ Defaults used:
- Model:
deepseek-chat
- Temperature: 0.8
Advanced Configuration
use DeepSeek\DeepSeekClient; use DeepSeek\Enums\Models; $client = DeepSeekClient::build(apiKey:'your-api-key', baseUrl:'https://api.deepseek.com/v3', timeout:30, clientType:'guzzle'); $response = $client ->withModel(Models::CODER->value) ->withStream() ->setTemperature(1.2) ->run(); echo 'API Response:'.$response;
Use with Symfony HttpClient
the package already built with symfony Http client
, if you need to use package with symfony
Http Client , it is easy to achieve that, just pass clientType:'symfony'
with build
function.
ex with symfony:
// with defaults baseUrl and timeout $client = DeepSeekClient::build('your-api-key', clientType:'symfony') // with customization $client = DeepSeekClient::build(apiKey:'your-api-key', baseUrl:'https://api.deepseek.com/v3', timeout:30, clientType:'symfony'); $client->query('Explain quantum computing in simple terms') ->run();
Get Models List
use DeepSeek\DeepSeekClient; $response = DeepSeekClient::build('your-api-key') ->getModelsList() ->run(); echo $response; // {"object":"list","data":[{"id":"deepseek-chat","object":"model","owned_by":"deepseek"},{"id":"deepseek-reasoner","object":"model","owned_by":"deepseek"}]}
๐ Framework Integration
Laravel Deepseek Package
๐ง Migration Guide
Upgrading from v1.x? Check our comprehensive Migration Guide for breaking changes and upgrade instructions.
๐ Changelog
Detailed release notes available in CHANGELOG.md
๐งช Testing
./vendor/bin/pest
Test coverage coming in v2.1.
๐โจ DeepSeek PHP Community โจ๐
Click the button bellow or join here to be part of our growing community!
Channel Structure ๐๏ธ
- ๐จ๏ธ General - Daily chatter
- ๐ก Ideas & Suggestions - Shape the community's future
- ๐ข Announcements & News - Official updates & news
- ๐ Releases & Updates - Version tracking & migration support
- ๐ Issues & Bug Reports - Collective problem-solving
- ๐ค Pull Requests - Code collaboration & reviews
๐ Security
Report Vulnerabilities: to omaralwi2010@gmail.com
๐ค Contributors
A huge thank you to these amazing people who have contributed to this project! ๐๐
Omar AlAlwi ๐ Creator |
Ayman Alhattami โญ Contributor |
Mohammad Asaad โญ Contributor |
Opada Alzaiede โญ Contributor |
Hisham Bin Ateya โญ Contributor |
Vinchan โญ Contributor |
Want to contribute? Check out the contributing guidelines and submit a pull request! ๐
๐ License
This package is open-source software licensed under the MIT License.