Skip to content

DeepSeek ​

A minimal text-only provider for pure generation jobs. Use it when the task is chat text with streaming and nothing else is needed — no media, no embeddings, no auxiliary capabilities. The smallest surface in the matrix.

Capabilities ​

Text with streaming.

Configuration ​

Configure via environment variables. config/ai.php only forwards them with env() — set the values in .env or the host environment, never hardcode keys in the config file.

php
// In config/ai.php
return [
    'Ai' => [
        'providers' => [
            'deepseek' => [
                'className' => 'Crustum\Ai\Providers\DeepSeekProvider',
                'key' => env('DEEPSEEK_API_KEY'),
                'url' => env('DEEPSEEK_URL', 'https://api.deepseek.com/v1'),
                'models' => [
                    'text' => [
                        'default' => env('DEEPSEEK_TEXT_MODEL', 'deepseek-flash'),
                        'cheapest' => env('DEEPSEEK_TEXT_MODEL_CHEAPEST', 'deepseek-flash'),
                        'smartest' => env('DEEPSEEK_TEXT_MODEL_SMARTEST', 'deepseek-v4-pro'),
                    ],
                ],
            ],
        ],
    ],
];
Config keyEnv varPurpose
className—Provider class. Keep the default unless subclassing.
key (apiKey also accepted)DEEPSEEK_API_KEYKey from the DeepSeek platform. Required.
urlDEEPSEEK_URLAPI base URL. Change only for proxies or gateways.
models.text.defaultDEEPSEEK_TEXT_MODELChat model for normal calls.
models.text.cheapestDEEPSEEK_TEXT_MODEL_CHEAPESTBudget model.
models.text.smartestDEEPSEEK_TEXT_MODEL_SMARTESTFlagship model.
headers— (config only)Extra HTTP headers merged into every request. Add as a plain array if needed.

Model selection priority per call: explicit model: argument wins, then models.text.default, then the provider's built-in fallback.

See also ​

Released under the MIT License.