aisdk/deepseek

Official DeepSeek provider for the PHP AI SDK.

Maintainers

Package info

github.com/phpaisdk/deepseek

pkg:composer/aisdk/deepseek

Transparency log

Fund package maintenance!

Open Collective

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.8.0 2026-07-15 12:02 UTC

This package is auto-updated.

Last update: 2026-07-17 02:24:48 UTC


README

GitHub Workflow Status Total Downloads Latest Version License Why PHP in 2026

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