Changelog
May 22, 2026 · View on GitHub
All notable changes to deepseek-php-client are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Backward Compatibility Commitment
This package is used in 100k+ production installs. We take backward compatibility seriously and follow semantic versioning strictly within the v2.x line.
Our commitments for the entire v2.x line:
- No public method, class, trait, enum case, or constant will be removed or renamed.
- No public method's return type will change.
- No public method's existing parameters will change type or be removed (new optional parameters with defaults may be added).
- No published interface (
ClientContract,ResourceContract,ResultContract,ApiFactoryContract) will gain new required methods. New methods on the client implementation will be exposed via separate, additive interfaces. - Default behavior of existing methods will not silently change in ways that affect cost, output, or correctness (e.g. raising default
max_tokens).
What's coming in v2.1.x: Every new DeepSeek API feature (V4 models, thinking mode, FIM completion, Anthropic format, user balance, stop / top_p / tool_choice / logprobs / user_id, chat prefix completion, etc.) will be delivered as additive new methods, optional parameters, and enum cases. Bug fixes (/v3 base URL, ignored params in chat() / code(), keep-alive line stripping) are also in scope.
What's reserved for v3.0.0: Removing deprecated Models::CODER / Models::R1 / Models::R1Zero, removing the Coder class and HasCoder trait, raising default max_tokens, retyping run() to return a structured DTO, expanding ClientContract to match the implementation. All of these will be announced via @deprecated notices throughout v2.x and shipped with a complete migration guide in MIGRATION.md.
See TODO.md for the full feature gap analysis with per-item BC classification.
[Unreleased] - v2.2.0 (planned)
Additive only. Zero breaking changes from v2.x. See TODO.md for the source list.
Generation parameters and DX
- Thinking mode setters:
setThinking(array $config)andsetReasoningEffort(string $effort). - New sampling / generation parameter setters:
setStop(),setTopP(),setToolChoice(),setLogprobs(),setTopLogprobs(),setUserId(). - Optional
?string $nameparameter onquery()andbuildQuery()for the OpenAI messagenamefield. setSystemMessage(string $content)convenience method.- Tool
strictmode helper for function definitions. - Response introspection accessors on
SuccessResult:getMessage(),getUsage(),getReasoningContent(),getToolCalls(),getFinishReason(),getCacheHitTokens()—run()continues to returnstring. getQueries(),getConfig(),reset()introspection helpers.DefaultConfigs::MAX_TOKENSandDefaultConfigs::RESPONSE_FORMAT_TYPEcases (TemperatureValues::MAX_TOKENS/RESPONSE_FORMAT_TYPEdeprecated).- Additive
ExtendedClientContractinterface (preserves the existingClientContract).
[Unreleased] - v2.3.0 (planned)
- Real streaming via new
runStreamed(callable $onChunk): voidmethod (existing->withStream()->run()string-returning behavior preserved). stream_options.include_usageexposure.- Chat Prefix Completion (Beta):
queryAssistantPrefix(string $content)and/betabase URL opt-in. getUserBalance()method,EndpointSuffixes::USER_BALANCEenum case, andUserBalanceResultDTO.- FIM Completion (Beta): new resource class for
POST /completions(Fill-In-the-Middle). - Rate-limit handling: new
RateLimitResultclass with parsedRetry-Afterheader for HTTP 429 responses.
Note: Anthropic API format support is intentionally not on the v2.x roadmap. It may be reintroduced in a later release if there is sufficient community demand.
[2.1.0] - 2026-05-22
Foundation + Bug Fixes. Zero breaking changes from
v2.0.x. All deprecated symbols remain fully functional throughout thev2.xline.
Added
- New
Models::V4_PRO(deepseek-v4-pro) andModels::V4_FLASH(deepseek-v4-flash) enum cases. Both models support DeepSeek's 1M-token context window and dual thinking / non-thinking modes (per the V4 Preview announcement).
Fixed
- Default
baseUrlcorrected fromhttps://api.deepseek.com/v3tohttps://api.deepseek.com. The/v3path was never a valid DeepSeek API endpoint. Users who passed an explicitbaseUrltoDeepSeekClient::build()are unaffected. chat()andcode()shortcuts now honortemperature,maxTokens,tools, andresponseFormatset on the client. Previously these settings were silently dropped from the request body when using the shortcut methods; the request body now matches whatrun()sends.- Keep-Alive padding stripped from responses. The DeepSeek API may send empty lines (non-streaming) or
: keep-aliveSSE comments (streaming) while waiting for inference to start. These are now removed before the response content is exposed to user code. See the DeepSeek Rate Limit docs for details.
Deprecated
The following symbols are deprecated and will be removed in v3.0.0. They remain fully functional throughout the v2.x line — only IDE @deprecated notices are emitted (no trigger_error()).
Models::CHAT— thedeepseek-chatalias retires from the DeepSeek API on 2026-07-24. UseModels::V4_FLASH(withsetThinking(['type' => 'disabled'])in v2.2.0+ for non-thinking mode).Models::CODER—deepseek-coderno longer exists in the DeepSeek API. UseModels::V4_PROorModels::V4_FLASH.Models::R1— theDeepSeek-R1alias retires from the DeepSeek API on 2026-07-24. UseModels::V4_FLASH(withsetThinking(['type' => 'enabled'])in v2.2.0+ for thinking mode).Models::R1Zero—DeepSeek-R1-Zerowas never a valid DeepSeek API model id.
Documentation
- README refreshed: default temperature corrected (1.3, not 0.8);
baseUrlexample updated; advanced-configuration example now usesModels::V4_PRO;getModelsList()example output updated to include V4 models; new "Supported Models" callout under Features. docs/FUNCTION-CALLING.mdupdated: JSON examples usedeepseek-v4-pro; new "Thinking-mode caveat" section explaining thatreasoning_contentmust be echoed back on tool turns to avoid HTTP 400 from the API.
Internal
- New test file:
tests/Feature/V210ChangesTest.phpcovering V4 enum cases, default base URL, Keep-Alive stripping (both non-streaming and streaming), andchat()/code()request body completeness.
[2.0.6] - 2025
Current published baseline prior to v2.1.0. No breaking changes from 2.0.0.
Patch-level fixes and documentation updates rolled up since 2.0.0. This release marks the point from which the Backward Compatibility Commitment above applies.
[2.0.0] - 2025-02-01
Changed (Breaking)
-
Namespace renamed from
DeepseekPhptoDeepSeek. All imports in user code must be updated. See MIGRATION.md for details.Replace:
use DeepseekPhp\SomeClass;With:
use DeepSeek\SomeClass;
[Roadmap] - v3.0.0 (no ETA)
Breaking changes only. Will ship with a complete migration guide in MIGRATION.md. Users will get at least one full
v2.1.xrelease with@deprecatednotices before any of these land.
Removed
- Deprecated
Modelsenum cases:CHAT,CODER,R1,R1Zero(per the 2026-07-24 DeepSeek API retirement of thedeepseek-chatanddeepseek-reasoneraliases). Resources\Coderclass andTraits\Resources\HasCodertrait (includingcode()).Enums\Configs\TemperatureValues::MAX_TOKENSandRESPONSE_FORMAT_TYPEcases.
Changed (Breaking)
run()will return a structuredChatCompletionResultDTO instead of a raw JSONstring. The current string-returning behavior moves to a new method (runRaw()or equivalent).- Default
MAX_TOKENSraised from 4096 to a V4-appropriate value (V4 models support 384K output tokens — current default is ~1% of capacity). ClientContractexpanded to declare all methods the implementation provides:resetQueries(),setTemperature(),setMaxTokens(),setResponseFormat(),setResult(),getResult(), and the 4-argbuild()signature including?string $clientType.- Default
baseUrlno longer accepts the legacy/v3suffix (already removed inv2.1.xas a fix; v3.0.0 removes the back-compat shim).
[1.0.0] - 201X-XX-XX
- Initial release.