Skip to content

Commit 7fec1cd

Browse files
authored
Merge pull request #445 from editor-code-assistant/deepseek-v4-pro-variants
Add DeepSeek V4 Pro variants and API filter for variant matching
2 parents 6cc03c8 + 783c4d0 commit 7fec1cd

4 files changed

Lines changed: 41 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
## Unreleased
44

5+
- `variantsByModel` entries now support an optional `:api` filter (string or vector) to restrict variant matching by provider API type.
56
- Custom commands and skills now expose `:arguments` metadata inferred from their content. Previously they always reported empty arguments.
67
- Native `skill-create`, `plugin-install`, and `plugin-uninstall` commands now declare `:required true` on their arguments in the command listing.
7-
- - Fix documentation link in `--help` output
8+
- Fix documentation link in `--help` output.
9+
- Add built-in variants for `deepseek-v4-pro` (`none`, `high`, `max`).
810

911
## 0.131.1
1012

docs/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,17 @@
475475
"items": {
476476
"type": "string"
477477
}
478+
},
479+
"api": {
480+
"type": [
481+
"string",
482+
"array"
483+
],
484+
"description": "Restrict variants to the given API type(s). String for exact match, array for any-of. Absent = match all.",
485+
"markdownDescription": "Restrict variants to the given API type(s). String for exact match, array for any-of. Absent = match all.",
486+
"items": {
487+
"type": "string"
488+
}
478489
}
479490
},
480491
"additionalProperties": false

docs/config/variants.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@ ECA ships with built-in variants for some known models via the `variantsByModel`
3535
| `high` | `{"reasoning": {"effort": "high", "summary": "auto"}}` |
3636
| `xhigh` | `{"reasoning": {"effort": "xhigh", "summary": "auto"}}` |
3737

38+
=== "DeepSeek"
39+
40+
Applies to models matching `deepseek-v4-pro`. Only for providers using the `openai-chat` API.
41+
42+
| Variant | Payload |
43+
| ---------- | ------- |
44+
| `none` | `{"thinking": {"type": "disabled"}}` |
45+
| `high` | `{"reasoning_effort": "high"}` |
46+
| `max` | `{"reasoning_effort": "max"}}` |
47+
3848
## Custom Variants
3949

4050
You can define your own variants per model under `providers.<provider>.models.<model>.variants`. Custom variants are merged with built-in ones — if names clash, your definition wins.

src/eca/config.clj

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@
7272
"xhigh" {:output_config {:effort "xhigh"} :thinking {:type "adaptive" :display "summarized"}}
7373
"max" {:output_config {:effort "max"} :thinking {:type "adaptive" :display "summarized"}}})
7474

75+
(def ^:private deepseek-variants
76+
{"none" {:thinking {:type "disabled"}}
77+
"high" {:reasoning_effort "high"}
78+
"max" {:reasoning_effort "max"}})
79+
7580
(def ^:private initial-config*
7681
{:providers {"openai" {:api "openai-responses"
7782
:url "${env:OPENAI_API_URL:https://api.openai.com}"
@@ -188,7 +193,9 @@
188193
:variantsByModel {".*sonnet[-._]4[-._]6|opus[-._]4[-._][56]" {:variants anthropic-variants}
189194
".*opus[-._]4[-._]7" {:variants anthropic-v2-variants}
190195
".*gpt[-._]5(?:[-._](?:2|4|5)(?!\\d)|[-._]3[-._]codex)" {:variants openai-variants
191-
:excludeProviders ["github-copilot"]}}
196+
:excludeProviders ["github-copilot"]}
197+
".*deepseek[-._]v4[-._]pro" {:variants deepseek-variants
198+
:api "openai-chat"}}
192199
:mcpTimeoutSeconds 60
193200
:lspTimeoutSeconds 30
194201
:streamIdleTimeoutSeconds 120
@@ -243,10 +250,16 @@
243250
A variant set to {} is removed from the result, allowing users to disable
244251
built-in variants."
245252
[config provider model-name user-variants]
246-
(let [builtin (when model-name
247-
(some (fn [[pattern-str {:keys [variants excludeProviders]}]]
253+
(let [provider-api (get-in config [:providers provider :api])
254+
api-match? (fn [api config-val]
255+
(cond (sequential? config-val) (some #{api} config-val)
256+
config-val (= api config-val)
257+
:else true))
258+
builtin (when model-name
259+
(some (fn [[pattern-str {:keys [variants excludeProviders api]}]]
248260
(when (and (regex-matches? pattern-str model-name)
249-
(not (some #{provider} excludeProviders)))
261+
(not (some #{provider} excludeProviders))
262+
(api-match? provider-api api))
250263
variants))
251264
(:variantsByModel config)))
252265
merged (cond

0 commit comments

Comments
 (0)