Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

## Unreleased

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

## 0.131.1

Expand Down
11 changes: 11 additions & 0 deletions docs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,17 @@
"items": {
"type": "string"
}
},
"api": {
"type": [
"string",
"array"
],
"description": "Restrict variants to the given API type(s). String for exact match, array for any-of. Absent = match all.",
"markdownDescription": "Restrict variants to the given API type(s). String for exact match, array for any-of. Absent = match all.",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
Expand Down
10 changes: 10 additions & 0 deletions docs/config/variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@ ECA ships with built-in variants for some known models via the `variantsByModel`
| `high` | `{"reasoning": {"effort": "high", "summary": "auto"}}` |
| `xhigh` | `{"reasoning": {"effort": "xhigh", "summary": "auto"}}` |

=== "DeepSeek"

Applies to models matching `deepseek-v4-pro`. Only for providers using the `openai-chat` API.

| Variant | Payload |
| ---------- | ------- |
| `none` | `{"thinking": {"type": "disabled"}}` |
| `high` | `{"reasoning_effort": "high"}` |
| `max` | `{"reasoning_effort": "max"}}` |

## Custom Variants

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.
Expand Down
21 changes: 17 additions & 4 deletions src/eca/config.clj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@
"xhigh" {:output_config {:effort "xhigh"} :thinking {:type "adaptive" :display "summarized"}}
"max" {:output_config {:effort "max"} :thinking {:type "adaptive" :display "summarized"}}})

(def ^:private deepseek-variants
{"none" {:thinking {:type "disabled"}}
"high" {:reasoning_effort "high"}
"max" {:reasoning_effort "max"}})

(def ^:private initial-config*
{:providers {"openai" {:api "openai-responses"
:url "${env:OPENAI_API_URL:https://api.openai.com}"
Expand Down Expand Up @@ -188,7 +193,9 @@
:variantsByModel {".*sonnet[-._]4[-._]6|opus[-._]4[-._][56]" {:variants anthropic-variants}
".*opus[-._]4[-._]7" {:variants anthropic-v2-variants}
".*gpt[-._]5(?:[-._](?:2|4|5)(?!\\d)|[-._]3[-._]codex)" {:variants openai-variants
:excludeProviders ["github-copilot"]}}
:excludeProviders ["github-copilot"]}
".*deepseek[-._]v4[-._]pro" {:variants deepseek-variants
:api "openai-chat"}}
:mcpTimeoutSeconds 60
:lspTimeoutSeconds 30
:streamIdleTimeoutSeconds 120
Expand Down Expand Up @@ -243,10 +250,16 @@
A variant set to {} is removed from the result, allowing users to disable
built-in variants."
[config provider model-name user-variants]
(let [builtin (when model-name
(some (fn [[pattern-str {:keys [variants excludeProviders]}]]
(let [provider-api (get-in config [:providers provider :api])
api-match? (fn [api config-val]
(cond (sequential? config-val) (some #{api} config-val)
config-val (= api config-val)
:else true))
builtin (when model-name
(some (fn [[pattern-str {:keys [variants excludeProviders api]}]]
(when (and (regex-matches? pattern-str model-name)
(not (some #{provider} excludeProviders)))
(not (some #{provider} excludeProviders))
(api-match? provider-api api))
variants))
(:variantsByModel config)))
merged (cond
Expand Down
Loading