Model or dataset
deepseek-php/deepseek-laravel avatar
deepseek-php/deepseek-laravel

deepseek-php/deepseek-laravel: what the Laravel wrapper actually does

Laravel wrapper for Deepseek PHP client, to seamless deepseek API integration with laravel applications.

401 stars71 forksPHPMIT

At a glance

What is it?
A thin service-container wrapper around the Deepseek PHP client, published under MIT. It removes API plumbing from Laravel apps, but it is not a test-covered or frequently released package.
Who is it for?
Adopt deepseek-laravel if you are building a Laravel application and want Deepseek calls resolved through the container with a published config file and a .env key, and if you are comfortable that the README says tests will come soon. Do not adopt it if you need a tested, version-pinned client, streaming, or a maintained release cadence: the last release on record is v2.0.2 from 2025-08-14.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 117 days ago.
What is it written in?
Mainly PHP, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The problem deepseek-laravel solves for Laravel developers

Calling the Deepseek API from PHP means handling an HTTP client, an API key, request payloads and response parsing. The deepseek-php-client package does that work. deepseek-laravel exists so a Laravel application does not have to instantiate that client by hand: it registers a DeepSeekClient binding in the service container, ships a config file you publish with an artisan command, and reads the key from the environment. The audience is narrow and specific. If you write Laravel code and want Deepseek calls to look like any other injected service, this is the intended fit. If you are not on Laravel, the wrapper adds nothing; the underlying deepseek-php-client is the package you want. The README describes the goal as "seamless deepseek AI API integration with Laravel applications", which in practice means container resolution plus configuration, not a new API surface.

How the wrapper is put together: container binding, config tag, env key

Three pieces are visible from the repository layout and the README. First, src/ holds the service provider and the DeepSeekClient class that Laravel resolves; the README's examples call app(DeepSeekClient::class) rather than constructing anything, so the binding is what the code depends on. Second, config/ holds the package configuration, published to the application with the deepseek tag. Third, the API key arrives through the environment as DEEPSEEK_API_KEY, which the published config reads. The default branch is master. The README points at the deepseek-php-client DefaultConfigs enum for the values used when you do not override anything, which tells you the wrapper itself does not define defaults; it inherits them. That inheritance is the main architectural fact to internalise: when a call behaves unexpectedly, the answer usually lives in the client package, not here.

Installing deepseek-laravel and making a first call

Installation is a single Composer command. The package name must match exactly.

bash
composer require deepseek-php/deepseek-laravel

Next, publish the configuration file so the application has its own copy to edit. The tag is deepseek.

bash
php artisan vendor:publish --tag=deepseek

Then put the key in .env. The README shows the variable name in quotes.

php
DEEPSEEK_API_KEY="your_api_key"

With that in place, the basic usage resolves the client from the container and runs a query. The README's example prints the response directly.

php
use DeepSeekClient;

$deepseek = app(DeepSeekClient::class);
$response = $deepseek->query('Hello deepseek, I am Laravel Framework , how are you Today ^_^ ?')->run();
print_r("deepseek API response : " . $response);

What you should see is the model's reply as a string, prefixed by the label in the print_r call. The README notes that in this easy mode all configurations take defaults, and links to the client's DefaultConfigs enum for those values. For anything beyond a single prompt, the fluent form chains queries with roles, sets a model and a temperature, then runs.

php
use DeepSeekClient;

$deepseek = app(DeepSeekClient::class);

$response = $deepseek
    ->query('Hello deepseek, how are you ?', 'system')
    ->query('Hello deepseek, my name is PHP ', 'user')
    ->withModel("deepseek-chat")
    ->setTemperature(1.5)
    ->run();

The order matters here: queries accumulate before run() executes, which is how multi-turn context is assembled. Note that no streaming method, timeout setting or retry option appears in the README examples; if you need those, check the client package and the published config before assuming the wrapper exposes them.

Where deepseek-laravel is the wrong tool

The README's testing section says, in full, "Tests will come soon". For a package that sits between your application and a paid external API, that is the limitation to weigh first. There is no test suite to read for behavioural guarantees, so the contract you rely on is the README and the source. The release history reinforces the point: v2.0.0, v2.0.1 and v2.0.2, with the most recent on 2025-08-14. That is a small number of releases over the project's life, and the last push to the repository was on 2026-05-21. The package is not archived, but the cadence is slow enough that you should pin a version in composer.json rather than track master. Two other cases where it is the wrong fit: applications that need a documented streaming interface, since the README shows only a blocking run() call, and non-Laravel PHP projects, where the container binding and artisan publish command are dead weight. If your application already wraps the Deepseek HTTP API directly, replacing that with this package buys configuration management and little else.

The real alternative: deepseek-php-client without the Laravel layer

The obvious alternative is the package this one wraps: deepseek-php/deepseek-php-client. The difference in approach is the framework layer. deepseek-php-client is plain PHP. You construct the client yourself, pass the API key and any configuration explicitly, and call the same query, withModel, setTemperature and run methods. That means no service provider, no config/deepseek.php, no artisan publish step, and no dependency on Laravel's container. It also means the defaults documented in the client's DefaultConfigs enum are the ones you get, exactly as with the wrapper, because the wrapper inherits them. Choose the client directly if you are on Symfony, on a plain PHP script, or if you want to control instantiation yourself. Choose the Laravel wrapper if you want injection and environment-based configuration to follow the conventions the rest of your application already uses. Neither choice changes what the API call does; it changes where the configuration lives and who owns the object's lifecycle.

Maintenance, upgrades and the MIT licence

The licence is MIT, stated in the README and present as LICENSE.md at the repository root. MIT is permissive: you can use the package commercially, modify it and redistribute it, provided the copyright notice and permission notice are retained. That is the general shape of the licence, not legal advice; read LICENSE.md and your own organisation's policy. On maintenance, the facts are limited and worth stating plainly. The repository is not archived. The last push was on 2026-05-21. The most recent tagged release is v2.0.2 from 2025-08-14. The README's testing section says tests will come soon, so there is no suite to run before an upgrade. Practically, that means upgrade cost is dominated by the underlying client: because the wrapper inherits defaults from deepseek-php-client, a change in that package's configuration enum can change your application's behaviour without any change in this repository. Pin both packages to explicit versions and read the client's changelog when you bump it. A CHANGELOG.md exists here as well, and the README directs readers to it for recent changes.

Editorial conclusion

Adopt deepseek-laravel if you are building a Laravel application and want Deepseek calls resolved through the container with a published config file and a .env key, and if you are comfortable that the README says tests will come soon. Do not adopt it if you need a tested, version-pinned client, streaming, or a maintained release cadence: the last release on record is v2.0.2 from 2025-08-14. Before wiring it into anything that matters, verify the actual method surface of the DeepSeekClient class in src/, confirm which deepseek-php-client version composer resolves, and check whether the config/deepseek.php file exposes the options you need.

Frequently asked questions

How do I install deepseek-laravel?

Run composer require deepseek-php/deepseek-laravel, then publish the configuration with php artisan vendor:publish --tag=deepseek. Add DEEPSEEK_API_KEY to your .env file and resolve DeepSeekClient from the container.

Where does deepseek-laravel get the API key from?

From the environment. The README instructs you to add DEEPSEEK_API_KEY="your_api_key" to the .env file after publishing the config, and the published configuration reads that value.

Does deepseek-laravel have tests?

The README's testing section states that tests will come soon, so as of the documentation there is no test suite to run. Treat the README and the source under src/ as the available reference.

Can I use deepseek-laravel outside Laravel?

No, the package is built around Laravel's service container and the artisan vendor:publish command. Outside Laravel, use the underlying deepseek-php/deepseek-php-client package directly.

Which models can I call with deepseek-laravel?

The README's advanced example passes deepseek-chat to withModel. The package does not define its own model list; it inherits configuration from the deepseek-php-client package, whose DefaultConfigs enum the README links to.

What is the difference between deepseek-laravel and deepseek-php-client?

deepseek-laravel is a Laravel wrapper around deepseek-php-client. It adds container binding and a publishable config file, while the client handles the actual API calls and holds the default configuration values.

Official sources

  1. deepseek-php/deepseek-laravel on GitHub
  2. Issues
  3. License: MIT
  4. README
  5. Releases
Community notes

Community notes