fix(ai): apply DeepSeek V4 reasoning compat

closes #3940
This commit is contained in:
Mario Zechner
2026-04-29 23:25:03 +02:00
parent 39146f3296
commit c1dd6082ee
3 changed files with 12 additions and 5 deletions

View File

@@ -4,6 +4,7 @@
### Fixed
- Fixed generated OpenAI-compatible DeepSeek V4 models to carry the provider-specific reasoning effort mapping outside the direct DeepSeek provider ([#3940](https://github.com/badlogic/pi-mono/issues/3940)).
- Fixed DeepSeek V4 Flash and V4 Pro pricing metadata to match current official rates ([#3910](https://github.com/badlogic/pi-mono/issues/3910)).
- Fixed DeepSeek prompt cache hits to be tracked from `prompt_cache_hit_tokens` in OpenAI-compatible usage responses ([#3880](https://github.com/badlogic/pi-mono/issues/3880)).

View File

@@ -1095,7 +1095,13 @@ async function generateModels() {
if (candidate.api === "openai-completions" && candidate.id.includes("deepseek-v4")) {
candidate.compat = {
...candidate.compat,
requiresReasoningContentOnAssistantMessages: true,
...(candidate.provider === "openrouter"
? {
requiresReasoningContentOnAssistantMessages:
deepseekCompat.requiresReasoningContentOnAssistantMessages,
reasoningEffortMap: deepseekCompat.reasoningEffortMap,
}
: deepseekCompat),
};
}
}

View File

@@ -7536,7 +7536,7 @@ export const MODELS = {
api: "openai-completions",
provider: "opencode-go",
baseUrl: "https://opencode.ai/zen/go/v1",
compat: {"requiresReasoningContentOnAssistantMessages":true},
compat: {"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","reasoningEffortMap":{"minimal":"high","low":"high","medium":"high","high":"high","xhigh":"max"}},
reasoning: true,
input: ["text"],
cost: {
@@ -7554,7 +7554,7 @@ export const MODELS = {
api: "openai-completions",
provider: "opencode-go",
baseUrl: "https://opencode.ai/zen/go/v1",
compat: {"requiresReasoningContentOnAssistantMessages":true},
compat: {"requiresReasoningContentOnAssistantMessages":true,"thinkingFormat":"deepseek","reasoningEffortMap":{"minimal":"high","low":"high","medium":"high","high":"high","xhigh":"max"}},
reasoning: true,
input: ["text"],
cost: {
@@ -8509,7 +8509,7 @@ export const MODELS = {
api: "openai-completions",
provider: "openrouter",
baseUrl: "https://openrouter.ai/api/v1",
compat: {"requiresReasoningContentOnAssistantMessages":true},
compat: {"requiresReasoningContentOnAssistantMessages":true,"reasoningEffortMap":{"minimal":"high","low":"high","medium":"high","high":"high","xhigh":"max"}},
reasoning: true,
input: ["text"],
cost: {
@@ -8527,7 +8527,7 @@ export const MODELS = {
api: "openai-completions",
provider: "openrouter",
baseUrl: "https://openrouter.ai/api/v1",
compat: {"requiresReasoningContentOnAssistantMessages":true},
compat: {"requiresReasoningContentOnAssistantMessages":true,"reasoningEffortMap":{"minimal":"high","low":"high","medium":"high","high":"high","xhigh":"max"}},
reasoning: true,
input: ["text"],
cost: {