aisdk / deepseek
Official DeepSeek provider for the PHP AI SDK.
Fund package maintenance!
v0.8.0
2026-07-15 12:02 UTC
Requires
- php: ^8.3
- aisdk/core: ^0.8.0
- aisdk/openai-compatible: ^0.8.0
Requires (Dev)
- laravel/pint: ^1.18
- nyholm/psr7: ^1.8
- pestphp/pest: ^3.0 || ^4.0
- phpstan/phpstan: ^2.0
- rector/rector: ^2.0
README
Official DeepSeek provider for the PHP AI SDK. It uses DeepSeek's OpenAI-compatible Chat Completions API.
Installation
composer require aisdk/deepseek
Basic Usage
use AiSdk\DeepSeek; use AiSdk\Generate; $result = Generate::text('Explain closures in PHP.') ->model(DeepSeek::model('deepseek-v4-pro')) ->run(); echo $result->text;
Configuration
| Variable | Description | Default |
|---|---|---|
DEEPSEEK_API_KEY |
API key for authentication | Required |
DEEPSEEK_BASE_URL |
Base URL for API requests | https://api.deepseek.com |
DeepSeek::create([ 'apiKey' => 'sk-...', 'headers' => ['X-Custom-Header' => 'value'], ]);
Supported Capabilities
| Capability | Support |
|---|---|
| Text generation | Native |
| Streaming | Native |
| Tool calling | Native |
| Reasoning | Native |
| Structured output | Adapted (json_object with an explicit JSON instruction) |
| Text input | Native |
DeepSeek model IDs are opaque strings. The package does not maintain a model catalog; DeepSeek remains the authority on model availability and capability support.
DeepSeek Options
Use provider options for DeepSeek-specific request fields, including thinking mode:
$result = Generate::text('Solve this step by step.') ->model(DeepSeek::model('deepseek-v4-pro')) ->providerOptions('deepseek', [ 'thinking' => ['type' => 'enabled'], 'reasoning_effort' => 'high', ]) ->run();
Testing
composer test:all
Documentation
Community
- Contributing
- Support
- For private security reports, email security@phpaisdk.com.