@warlock.js/ai-deepseek 5.23.2 → 5.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to `@warlock.js/ai-deepseek` are documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). `@warlock.js/*` packages are released in lockstep — every package shares the same version number, so a version below may list only the changes that affected this package.
6
6
 
7
+ ## 5.25.0 - 2026-09-28
8
+
9
+ ### Changed
10
+
11
+ - Lockstep release; package APIs are unchanged.
12
+
13
+ ## 5.24.0 - 2026-09-27
14
+
15
+ ### Changed
16
+
17
+ - Lockstep release; package APIs are unchanged.
18
+
7
19
  ## 5.23.2 - 2026-09-26
8
20
 
9
21
  ### Changed
package/llms-full.txt CHANGED
@@ -6,111 +6,111 @@
6
6
 
7
7
  ## setup-deepseek `@warlock.js/ai-deepseek/setup-deepseek/SKILL.md`
8
8
 
9
- ---
10
- name: setup-deepseek
11
- description: 'Wire @warlock.js/ai-deepseek — new DeepSeekSDK({apiKey, baseURL?, provider?, pricing?}) for DeepSeek''s OpenAI-compatible API, .model({name, reasoning?, vision?, structuredOutput?, responseFormat?}) for ModelContract. Thin wrapper over @warlock.js/ai-openai''s OpenAISDK pinned to https://api.deepseek.com with provider "deepseek"; injects DeepSeek-specific reasoning/vision inference + built-in pricing. Models: deepseek-chat (non-thinking), deepseek-reasoner (thinking/reasoning), deepseek-v4-flash, deepseek-v4-pro. Triggers: `DeepSeekSDK`, `deepseek-chat`, `deepseek-reasoner`, `deepseek-v4`, `api.deepseek.com`, `DEEPSEEK_API_KEY`, reasoning effort on deepseek; "wire deepseek into a warlock agent", "use deepseek-reasoner", "configure deepseek-chat", "route a warlock agent through deepseek". Skip: OpenAI/Azure/OpenRouter — `@warlock.js/ai-openai`; agent wiring — `@warlock.js/ai/run-ai-agent/SKILL.md`; adapter comparison — `@warlock.js/ai/pick-ai-provider/SKILL.md`; raw deepseek HTTP / the `openai` SDK directly. Typical import `import { DeepSeekSDK } from "@warlock.js/ai-deepseek"`.'
12
- ---
13
-
14
- # `@warlock.js/ai-deepseek`
15
-
16
- Provider adapter for DeepSeek. DeepSeek's API is **OpenAI-compatible**, so this package is a **thin wrapper** over [`@warlock.js/ai-openai`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md)'s `OpenAISDK`: it constructs an internal `OpenAISDK` pinned to `https://api.deepseek.com` with `provider: "deepseek"` and delegates `model()` / `embedder()` / `image()` / `count()` to it — while injecting DeepSeek's own capability inference and pricing so the right flags are set even though the model names aren't OpenAI names. Pair with `@warlock.js/ai` for the agent / tool / system-prompt surface.
17
-
18
- ## Construction
19
-
20
- ```ts
21
- import { DeepSeekSDK } from "@warlock.js/ai-deepseek";
22
-
23
- const deepseek = new DeepSeekSDK({ apiKey: process.env.DEEPSEEK_API_KEY! });
24
- ```
25
-
26
- `apiKey` is the only required field — `baseURL` defaults to `https://api.deepseek.com` (DeepSeek's OpenAI-compatible endpoint) and `provider` defaults to `"deepseek"`. Override `baseURL` only for a proxy/gateway, or `provider` to relabel the upstream:
27
-
28
- ```ts
29
- new DeepSeekSDK({ apiKey, baseURL: "https://my-gateway/deepseek", provider: "deepseek-proxy" });
30
- ```
31
-
32
- `DeepSeekSDK` is a class (like `OpenAISDK`) holding one long-lived wrapped client — construct once per account and reuse.
33
-
34
- ## Producing a model
35
-
36
- ```ts
37
- deepseek.model({ name: "deepseek-chat" }) // V3 lineage, non-thinking
38
- deepseek.model({ name: "deepseek-reasoner" }) // R1 lineage, reasoning-capable
39
- deepseek.model({ name: "deepseek-chat", temperature: 0.2 })
40
- ```
41
-
42
- Returns a `ModelContract` you pass straight into `ai.agent({ model })`.
43
-
44
- ## Models
45
-
46
- | Model | Notes |
47
- | --- | --- |
48
- | `deepseek-chat` | Non-thinking surface (V3 lineage). Fast, cheap, broad coverage. Reasoning **off**. |
49
- | `deepseek-reasoner` | Thinking surface (R1 lineage). Emits a reasoning channel. Reasoning **on**. |
50
- | `deepseek-v4-flash` | Newer flash tier. Reasoning **off** by default. |
51
- | `deepseek-v4-pro` | Newer quality tier. Reasoning **on** by default. |
52
-
53
- DeepSeek announced the legacy `deepseek-chat` / `deepseek-reasoner` names retire 2026/07/24 in favor of the `deepseek-v4-*` family; both name sets are understood by the capability inference. `deepseek.model({ name })` accepts any id the upstream serves.
54
-
55
- ## Capabilities — what's auto-set
56
-
57
- | Flag | Default |
58
- | --- | --- |
59
- | `reasoning` | Inferred from the DeepSeek model name. `true` for `deepseek-reasoner` and the `*-pro` tier; `false` for `deepseek-chat` / `*-flash`. Drives whether the reasoning-effort knob is forwarded. |
60
- | `vision` | `false` for every DeepSeek model — no DeepSeek chat model documents image input (mid-2026). |
61
- | `structuredOutput` | `true` (inherited from the wrapped OpenAI model), unless `responseFormat` is set to a loose mode. |
62
- | `promptCaching` | `true` (inherited). DeepSeek reports cache hits via `usage.cachedTokens`, the same shape as OpenAI. |
63
-
64
- **Override any flag explicitly** via `.model({ name, reasoning?, vision?, structuredOutput? })` — an explicit value always wins over the injected inference.
65
-
66
- ```ts
67
- deepseek.model({ name: "deepseek-chat", reasoning: true }) // force thinking flag
68
- deepseek.model({ name: "deepseek-reasoner", reasoning: false }) // suppress it
69
- ```
70
-
71
- ## Uses the OpenAI-compatible endpoint
72
-
73
- Everything on the wire — Chat Completions request/response shape, streaming loop, tool-call accumulation, structured-output `response_format`, multipart message mapping, and error wrapping — is inherited **unchanged** from `OpenAIModel`. See [`setup-openai`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md) for the wire-level detail; it all applies here against `https://api.deepseek.com`.
74
-
75
- Structured output, reasoning effort, and streaming therefore behave exactly as documented for the OpenAI adapter:
76
-
77
- ```ts
78
- const model = deepseek.model({ name: "deepseek-reasoner" }); // reasoning auto-true
79
- await model.complete(messages, { reasoning: { effort: "high" } }); // → reasoning_effort: "high"
80
- ```
81
-
82
- ## Embeddings & images
83
-
84
- `deepseek.embedder({...})` and `deepseek.image({...})` delegate to the wrapped `OpenAISDK`. **DeepSeek does not officially document an OpenAI-compatible embeddings endpoint or an image-generation endpoint (mid-2026)** — these delegates exist for adapter parity and work against a compatible gateway you point `baseURL` at, but may fail against the stock DeepSeek endpoint. Use a dedicated embeddings provider (e.g. `@warlock.js/ai-openai` / `@warlock.js/ai-google`) for RAG.
85
-
86
- ## Pricing
87
-
88
- The adapter ships **built-in DeepSeek pricing defaults** (USD per 1M tokens, from DeepSeek's published table), so `usage.cost` is computed out of the box:
89
-
90
- ```ts
91
- const deepseek = new DeepSeekSDK({ apiKey }); // deepseek-chat → { input: 0.14, output: 0.28, cachedInput: 0.0028 }
92
- ```
93
-
94
- Override per model or per SDK exactly like the OpenAI adapter. Resolution at `model()` time: per-model `pricing` > SDK `pricing` registry > built-in DeepSeek default > `undefined`.
95
-
96
- ```ts
97
- new DeepSeekSDK({ apiKey, pricing: { "deepseek-reasoner": { input: 0.55, output: 2.19 } } });
98
- ```
99
-
100
- ## Errors
101
-
102
- Raw errors surface through the wrapped OpenAI adapter's wrapper into the typed `@warlock.js/ai` `AIError` hierarchy — see [`@warlock.js/ai/handle-ai-errors/SKILL.md`](@warlock.js/ai/handle-ai-errors/SKILL.md).
103
-
104
- ## When NOT to use this skill
105
-
106
- - OpenAI / Azure OpenAI / OpenRouter / local OpenAI-compatible gateways — use `@warlock.js/ai-openai`.
107
- - Anthropic — `@warlock.js/ai-anthropic`. Gemini — `@warlock.js/ai-google`. Ollama — `@warlock.js/ai-ollama`.
108
- - Calling the DeepSeek HTTP API or the raw `openai` SDK directly without going through `@warlock.js/ai` agents.
109
-
110
- ## See also
111
-
112
- - [`@warlock.js/ai-openai/skills/setup-openai/SKILL.md`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md) — the wrapped adapter; all wire-level behavior.
113
- - [`@warlock.js/ai/run-ai-agent/SKILL.md`](@warlock.js/ai/run-ai-agent/SKILL.md) — passing the model into `ai.agent({...})`.
114
- - [`@warlock.js/ai/pick-ai-provider/SKILL.md`](@warlock.js/ai/pick-ai-provider/SKILL.md) — adapter comparison.
9
+ ---
10
+ name: setup-deepseek
11
+ description: 'Wire @warlock.js/ai-deepseek — new DeepSeekSDK({apiKey, baseURL?, provider?, pricing?}) for DeepSeek''s OpenAI-compatible API, .model({name, reasoning?, vision?, structuredOutput?, responseFormat?}) for ModelContract. Thin wrapper over @warlock.js/ai-openai''s OpenAISDK pinned to https://api.deepseek.com with provider "deepseek"; injects DeepSeek-specific reasoning/vision inference + built-in pricing. Models: deepseek-chat (non-thinking), deepseek-reasoner (thinking/reasoning), deepseek-v4-flash, deepseek-v4-pro. Triggers: `DeepSeekSDK`, `deepseek-chat`, `deepseek-reasoner`, `deepseek-v4`, `api.deepseek.com`, `DEEPSEEK_API_KEY`, reasoning effort on deepseek; "wire deepseek into a warlock agent", "use deepseek-reasoner", "configure deepseek-chat", "route a warlock agent through deepseek". Skip: OpenAI/Azure/OpenRouter — `@warlock.js/ai-openai`; agent wiring — `@warlock.js/ai/run-ai-agent/SKILL.md`; adapter comparison — `@warlock.js/ai/pick-ai-provider/SKILL.md`; raw deepseek HTTP / the `openai` SDK directly. Typical import `import { DeepSeekSDK } from "@warlock.js/ai-deepseek"`.'
12
+ ---
13
+
14
+ # `@warlock.js/ai-deepseek`
15
+
16
+ Provider adapter for DeepSeek. DeepSeek's API is **OpenAI-compatible**, so this package is a **thin wrapper** over [`@warlock.js/ai-openai`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md)'s `OpenAISDK`: it constructs an internal `OpenAISDK` pinned to `https://api.deepseek.com` with `provider: "deepseek"` and delegates `model()` / `embedder()` / `image()` / `count()` to it — while injecting DeepSeek's own capability inference and pricing so the right flags are set even though the model names aren't OpenAI names. Pair with `@warlock.js/ai` for the agent / tool / system-prompt surface.
17
+
18
+ ## Construction
19
+
20
+ ```ts
21
+ import { DeepSeekSDK } from "@warlock.js/ai-deepseek";
22
+
23
+ const deepseek = new DeepSeekSDK({ apiKey: process.env.DEEPSEEK_API_KEY! });
24
+ ```
25
+
26
+ `apiKey` is the only required field — `baseURL` defaults to `https://api.deepseek.com` (DeepSeek's OpenAI-compatible endpoint) and `provider` defaults to `"deepseek"`. Override `baseURL` only for a proxy/gateway, or `provider` to relabel the upstream:
27
+
28
+ ```ts
29
+ new DeepSeekSDK({ apiKey, baseURL: "https://my-gateway/deepseek", provider: "deepseek-proxy" });
30
+ ```
31
+
32
+ `DeepSeekSDK` is a class (like `OpenAISDK`) holding one long-lived wrapped client — construct once per account and reuse.
33
+
34
+ ## Producing a model
35
+
36
+ ```ts
37
+ deepseek.model({ name: "deepseek-chat" }) // V3 lineage, non-thinking
38
+ deepseek.model({ name: "deepseek-reasoner" }) // R1 lineage, reasoning-capable
39
+ deepseek.model({ name: "deepseek-chat", temperature: 0.2 })
40
+ ```
41
+
42
+ Returns a `ModelContract` you pass straight into `ai.agent({ model })`.
43
+
44
+ ## Models
45
+
46
+ | Model | Notes |
47
+ | --- | --- |
48
+ | `deepseek-chat` | Non-thinking surface (V3 lineage). Fast, cheap, broad coverage. Reasoning **off**. |
49
+ | `deepseek-reasoner` | Thinking surface (R1 lineage). Emits a reasoning channel. Reasoning **on**. |
50
+ | `deepseek-v4-flash` | Newer flash tier. Reasoning **off** by default. |
51
+ | `deepseek-v4-pro` | Newer quality tier. Reasoning **on** by default. |
52
+
53
+ DeepSeek announced the legacy `deepseek-chat` / `deepseek-reasoner` names retire 2026/07/24 in favor of the `deepseek-v4-*` family; both name sets are understood by the capability inference. `deepseek.model({ name })` accepts any id the upstream serves.
54
+
55
+ ## Capabilities — what's auto-set
56
+
57
+ | Flag | Default |
58
+ | --- | --- |
59
+ | `reasoning` | Inferred from the DeepSeek model name. `true` for `deepseek-reasoner` and the `*-pro` tier; `false` for `deepseek-chat` / `*-flash`. Drives whether the reasoning-effort knob is forwarded. |
60
+ | `vision` | `false` for every DeepSeek model — no DeepSeek chat model documents image input (mid-2026). |
61
+ | `structuredOutput` | `true` (inherited from the wrapped OpenAI model), unless `responseFormat` is set to a loose mode. |
62
+ | `promptCaching` | `true` (inherited). DeepSeek reports cache hits via `usage.cachedTokens`, the same shape as OpenAI. |
63
+
64
+ **Override any flag explicitly** via `.model({ name, reasoning?, vision?, structuredOutput? })` — an explicit value always wins over the injected inference.
65
+
66
+ ```ts
67
+ deepseek.model({ name: "deepseek-chat", reasoning: true }) // force thinking flag
68
+ deepseek.model({ name: "deepseek-reasoner", reasoning: false }) // suppress it
69
+ ```
70
+
71
+ ## Uses the OpenAI-compatible endpoint
72
+
73
+ Everything on the wire — Chat Completions request/response shape, streaming loop, tool-call accumulation, structured-output `response_format`, multipart message mapping, and error wrapping — is inherited **unchanged** from `OpenAIModel`. See [`setup-openai`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md) for the wire-level detail; it all applies here against `https://api.deepseek.com`.
74
+
75
+ Structured output, reasoning effort, and streaming therefore behave exactly as documented for the OpenAI adapter:
76
+
77
+ ```ts
78
+ const model = deepseek.model({ name: "deepseek-reasoner" }); // reasoning auto-true
79
+ await model.complete(messages, { reasoning: { effort: "high" } }); // → reasoning_effort: "high"
80
+ ```
81
+
82
+ ## Embeddings & images
83
+
84
+ `deepseek.embedder({...})` and `deepseek.image({...})` delegate to the wrapped `OpenAISDK`. **DeepSeek does not officially document an OpenAI-compatible embeddings endpoint or an image-generation endpoint (mid-2026)** — these delegates exist for adapter parity and work against a compatible gateway you point `baseURL` at, but may fail against the stock DeepSeek endpoint. Use a dedicated embeddings provider (e.g. `@warlock.js/ai-openai` / `@warlock.js/ai-google`) for RAG.
85
+
86
+ ## Pricing
87
+
88
+ The adapter ships **built-in DeepSeek pricing defaults** (USD per 1M tokens, from DeepSeek's published table), so `usage.cost` is computed out of the box:
89
+
90
+ ```ts
91
+ const deepseek = new DeepSeekSDK({ apiKey }); // deepseek-chat → { input: 0.14, output: 0.28, cachedInput: 0.0028 }
92
+ ```
93
+
94
+ Override per model or per SDK exactly like the OpenAI adapter. Resolution at `model()` time: per-model `pricing` > SDK `pricing` registry > built-in DeepSeek default > `undefined`.
95
+
96
+ ```ts
97
+ new DeepSeekSDK({ apiKey, pricing: { "deepseek-reasoner": { input: 0.55, output: 2.19 } } });
98
+ ```
99
+
100
+ ## Errors
101
+
102
+ Raw errors surface through the wrapped OpenAI adapter's wrapper into the typed `@warlock.js/ai` `AIError` hierarchy — see [`@warlock.js/ai/handle-ai-errors/SKILL.md`](@warlock.js/ai/handle-ai-errors/SKILL.md).
103
+
104
+ ## When NOT to use this skill
105
+
106
+ - OpenAI / Azure OpenAI / OpenRouter / local OpenAI-compatible gateways — use `@warlock.js/ai-openai`.
107
+ - Anthropic — `@warlock.js/ai-anthropic`. Gemini — `@warlock.js/ai-google`. Ollama — `@warlock.js/ai-ollama`.
108
+ - Calling the DeepSeek HTTP API or the raw `openai` SDK directly without going through `@warlock.js/ai` agents.
109
+
110
+ ## See also
111
+
112
+ - [`@warlock.js/ai-openai/skills/setup-openai/SKILL.md`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md) — the wrapped adapter; all wire-level behavior.
113
+ - [`@warlock.js/ai/run-ai-agent/SKILL.md`](@warlock.js/ai/run-ai-agent/SKILL.md) — passing the model into `ai.agent({...})`.
114
+ - [`@warlock.js/ai/pick-ai-provider/SKILL.md`](@warlock.js/ai/pick-ai-provider/SKILL.md) — adapter comparison.
115
115
 
116
116
 
package/package.json CHANGED
@@ -13,13 +13,13 @@
13
13
  "url": "https://github.com/warlockjs/ai-deepseek"
14
14
  },
15
15
  "dependencies": {
16
- "@warlock.js/ai-openai": "5.23.2",
17
- "@warlock.js/logger": "5.23.2"
16
+ "@warlock.js/ai-openai": "5.25.0",
17
+ "@warlock.js/logger": "5.25.0"
18
18
  },
19
19
  "peerDependencies": {
20
- "@warlock.js/ai": "5.23.2"
20
+ "@warlock.js/ai": "5.25.0"
21
21
  },
22
- "version": "5.23.2",
22
+ "version": "5.25.0",
23
23
  "main": "./cjs/index.cjs",
24
24
  "module": "./esm/index.mjs",
25
25
  "types": "./esm/index.d.mts",
@@ -1,106 +1,106 @@
1
- ---
2
- name: setup-deepseek
3
- description: 'Wire @warlock.js/ai-deepseek — new DeepSeekSDK({apiKey, baseURL?, provider?, pricing?}) for DeepSeek''s OpenAI-compatible API, .model({name, reasoning?, vision?, structuredOutput?, responseFormat?}) for ModelContract. Thin wrapper over @warlock.js/ai-openai''s OpenAISDK pinned to https://api.deepseek.com with provider "deepseek"; injects DeepSeek-specific reasoning/vision inference + built-in pricing. Models: deepseek-chat (non-thinking), deepseek-reasoner (thinking/reasoning), deepseek-v4-flash, deepseek-v4-pro. Triggers: `DeepSeekSDK`, `deepseek-chat`, `deepseek-reasoner`, `deepseek-v4`, `api.deepseek.com`, `DEEPSEEK_API_KEY`, reasoning effort on deepseek; "wire deepseek into a warlock agent", "use deepseek-reasoner", "configure deepseek-chat", "route a warlock agent through deepseek". Skip: OpenAI/Azure/OpenRouter — `@warlock.js/ai-openai`; agent wiring — `@warlock.js/ai/run-ai-agent/SKILL.md`; adapter comparison — `@warlock.js/ai/pick-ai-provider/SKILL.md`; raw deepseek HTTP / the `openai` SDK directly. Typical import `import { DeepSeekSDK } from "@warlock.js/ai-deepseek"`.'
4
- ---
5
-
6
- # `@warlock.js/ai-deepseek`
7
-
8
- Provider adapter for DeepSeek. DeepSeek's API is **OpenAI-compatible**, so this package is a **thin wrapper** over [`@warlock.js/ai-openai`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md)'s `OpenAISDK`: it constructs an internal `OpenAISDK` pinned to `https://api.deepseek.com` with `provider: "deepseek"` and delegates `model()` / `embedder()` / `image()` / `count()` to it — while injecting DeepSeek's own capability inference and pricing so the right flags are set even though the model names aren't OpenAI names. Pair with `@warlock.js/ai` for the agent / tool / system-prompt surface.
9
-
10
- ## Construction
11
-
12
- ```ts
13
- import { DeepSeekSDK } from "@warlock.js/ai-deepseek";
14
-
15
- const deepseek = new DeepSeekSDK({ apiKey: process.env.DEEPSEEK_API_KEY! });
16
- ```
17
-
18
- `apiKey` is the only required field — `baseURL` defaults to `https://api.deepseek.com` (DeepSeek's OpenAI-compatible endpoint) and `provider` defaults to `"deepseek"`. Override `baseURL` only for a proxy/gateway, or `provider` to relabel the upstream:
19
-
20
- ```ts
21
- new DeepSeekSDK({ apiKey, baseURL: "https://my-gateway/deepseek", provider: "deepseek-proxy" });
22
- ```
23
-
24
- `DeepSeekSDK` is a class (like `OpenAISDK`) holding one long-lived wrapped client — construct once per account and reuse.
25
-
26
- ## Producing a model
27
-
28
- ```ts
29
- deepseek.model({ name: "deepseek-chat" }) // V3 lineage, non-thinking
30
- deepseek.model({ name: "deepseek-reasoner" }) // R1 lineage, reasoning-capable
31
- deepseek.model({ name: "deepseek-chat", temperature: 0.2 })
32
- ```
33
-
34
- Returns a `ModelContract` you pass straight into `ai.agent({ model })`.
35
-
36
- ## Models
37
-
38
- | Model | Notes |
39
- | --- | --- |
40
- | `deepseek-chat` | Non-thinking surface (V3 lineage). Fast, cheap, broad coverage. Reasoning **off**. |
41
- | `deepseek-reasoner` | Thinking surface (R1 lineage). Emits a reasoning channel. Reasoning **on**. |
42
- | `deepseek-v4-flash` | Newer flash tier. Reasoning **off** by default. |
43
- | `deepseek-v4-pro` | Newer quality tier. Reasoning **on** by default. |
44
-
45
- DeepSeek announced the legacy `deepseek-chat` / `deepseek-reasoner` names retire 2026/07/24 in favor of the `deepseek-v4-*` family; both name sets are understood by the capability inference. `deepseek.model({ name })` accepts any id the upstream serves.
46
-
47
- ## Capabilities — what's auto-set
48
-
49
- | Flag | Default |
50
- | --- | --- |
51
- | `reasoning` | Inferred from the DeepSeek model name. `true` for `deepseek-reasoner` and the `*-pro` tier; `false` for `deepseek-chat` / `*-flash`. Drives whether the reasoning-effort knob is forwarded. |
52
- | `vision` | `false` for every DeepSeek model — no DeepSeek chat model documents image input (mid-2026). |
53
- | `structuredOutput` | `true` (inherited from the wrapped OpenAI model), unless `responseFormat` is set to a loose mode. |
54
- | `promptCaching` | `true` (inherited). DeepSeek reports cache hits via `usage.cachedTokens`, the same shape as OpenAI. |
55
-
56
- **Override any flag explicitly** via `.model({ name, reasoning?, vision?, structuredOutput? })` — an explicit value always wins over the injected inference.
57
-
58
- ```ts
59
- deepseek.model({ name: "deepseek-chat", reasoning: true }) // force thinking flag
60
- deepseek.model({ name: "deepseek-reasoner", reasoning: false }) // suppress it
61
- ```
62
-
63
- ## Uses the OpenAI-compatible endpoint
64
-
65
- Everything on the wire — Chat Completions request/response shape, streaming loop, tool-call accumulation, structured-output `response_format`, multipart message mapping, and error wrapping — is inherited **unchanged** from `OpenAIModel`. See [`setup-openai`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md) for the wire-level detail; it all applies here against `https://api.deepseek.com`.
66
-
67
- Structured output, reasoning effort, and streaming therefore behave exactly as documented for the OpenAI adapter:
68
-
69
- ```ts
70
- const model = deepseek.model({ name: "deepseek-reasoner" }); // reasoning auto-true
71
- await model.complete(messages, { reasoning: { effort: "high" } }); // → reasoning_effort: "high"
72
- ```
73
-
74
- ## Embeddings & images
75
-
76
- `deepseek.embedder({...})` and `deepseek.image({...})` delegate to the wrapped `OpenAISDK`. **DeepSeek does not officially document an OpenAI-compatible embeddings endpoint or an image-generation endpoint (mid-2026)** — these delegates exist for adapter parity and work against a compatible gateway you point `baseURL` at, but may fail against the stock DeepSeek endpoint. Use a dedicated embeddings provider (e.g. `@warlock.js/ai-openai` / `@warlock.js/ai-google`) for RAG.
77
-
78
- ## Pricing
79
-
80
- The adapter ships **built-in DeepSeek pricing defaults** (USD per 1M tokens, from DeepSeek's published table), so `usage.cost` is computed out of the box:
81
-
82
- ```ts
83
- const deepseek = new DeepSeekSDK({ apiKey }); // deepseek-chat → { input: 0.14, output: 0.28, cachedInput: 0.0028 }
84
- ```
85
-
86
- Override per model or per SDK exactly like the OpenAI adapter. Resolution at `model()` time: per-model `pricing` > SDK `pricing` registry > built-in DeepSeek default > `undefined`.
87
-
88
- ```ts
89
- new DeepSeekSDK({ apiKey, pricing: { "deepseek-reasoner": { input: 0.55, output: 2.19 } } });
90
- ```
91
-
92
- ## Errors
93
-
94
- Raw errors surface through the wrapped OpenAI adapter's wrapper into the typed `@warlock.js/ai` `AIError` hierarchy — see [`@warlock.js/ai/handle-ai-errors/SKILL.md`](@warlock.js/ai/handle-ai-errors/SKILL.md).
95
-
96
- ## When NOT to use this skill
97
-
98
- - OpenAI / Azure OpenAI / OpenRouter / local OpenAI-compatible gateways — use `@warlock.js/ai-openai`.
99
- - Anthropic — `@warlock.js/ai-anthropic`. Gemini — `@warlock.js/ai-google`. Ollama — `@warlock.js/ai-ollama`.
100
- - Calling the DeepSeek HTTP API or the raw `openai` SDK directly without going through `@warlock.js/ai` agents.
101
-
102
- ## See also
103
-
104
- - [`@warlock.js/ai-openai/skills/setup-openai/SKILL.md`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md) — the wrapped adapter; all wire-level behavior.
105
- - [`@warlock.js/ai/run-ai-agent/SKILL.md`](@warlock.js/ai/run-ai-agent/SKILL.md) — passing the model into `ai.agent({...})`.
106
- - [`@warlock.js/ai/pick-ai-provider/SKILL.md`](@warlock.js/ai/pick-ai-provider/SKILL.md) — adapter comparison.
1
+ ---
2
+ name: setup-deepseek
3
+ description: 'Wire @warlock.js/ai-deepseek — new DeepSeekSDK({apiKey, baseURL?, provider?, pricing?}) for DeepSeek''s OpenAI-compatible API, .model({name, reasoning?, vision?, structuredOutput?, responseFormat?}) for ModelContract. Thin wrapper over @warlock.js/ai-openai''s OpenAISDK pinned to https://api.deepseek.com with provider "deepseek"; injects DeepSeek-specific reasoning/vision inference + built-in pricing. Models: deepseek-chat (non-thinking), deepseek-reasoner (thinking/reasoning), deepseek-v4-flash, deepseek-v4-pro. Triggers: `DeepSeekSDK`, `deepseek-chat`, `deepseek-reasoner`, `deepseek-v4`, `api.deepseek.com`, `DEEPSEEK_API_KEY`, reasoning effort on deepseek; "wire deepseek into a warlock agent", "use deepseek-reasoner", "configure deepseek-chat", "route a warlock agent through deepseek". Skip: OpenAI/Azure/OpenRouter — `@warlock.js/ai-openai`; agent wiring — `@warlock.js/ai/run-ai-agent/SKILL.md`; adapter comparison — `@warlock.js/ai/pick-ai-provider/SKILL.md`; raw deepseek HTTP / the `openai` SDK directly. Typical import `import { DeepSeekSDK } from "@warlock.js/ai-deepseek"`.'
4
+ ---
5
+
6
+ # `@warlock.js/ai-deepseek`
7
+
8
+ Provider adapter for DeepSeek. DeepSeek's API is **OpenAI-compatible**, so this package is a **thin wrapper** over [`@warlock.js/ai-openai`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md)'s `OpenAISDK`: it constructs an internal `OpenAISDK` pinned to `https://api.deepseek.com` with `provider: "deepseek"` and delegates `model()` / `embedder()` / `image()` / `count()` to it — while injecting DeepSeek's own capability inference and pricing so the right flags are set even though the model names aren't OpenAI names. Pair with `@warlock.js/ai` for the agent / tool / system-prompt surface.
9
+
10
+ ## Construction
11
+
12
+ ```ts
13
+ import { DeepSeekSDK } from "@warlock.js/ai-deepseek";
14
+
15
+ const deepseek = new DeepSeekSDK({ apiKey: process.env.DEEPSEEK_API_KEY! });
16
+ ```
17
+
18
+ `apiKey` is the only required field — `baseURL` defaults to `https://api.deepseek.com` (DeepSeek's OpenAI-compatible endpoint) and `provider` defaults to `"deepseek"`. Override `baseURL` only for a proxy/gateway, or `provider` to relabel the upstream:
19
+
20
+ ```ts
21
+ new DeepSeekSDK({ apiKey, baseURL: "https://my-gateway/deepseek", provider: "deepseek-proxy" });
22
+ ```
23
+
24
+ `DeepSeekSDK` is a class (like `OpenAISDK`) holding one long-lived wrapped client — construct once per account and reuse.
25
+
26
+ ## Producing a model
27
+
28
+ ```ts
29
+ deepseek.model({ name: "deepseek-chat" }) // V3 lineage, non-thinking
30
+ deepseek.model({ name: "deepseek-reasoner" }) // R1 lineage, reasoning-capable
31
+ deepseek.model({ name: "deepseek-chat", temperature: 0.2 })
32
+ ```
33
+
34
+ Returns a `ModelContract` you pass straight into `ai.agent({ model })`.
35
+
36
+ ## Models
37
+
38
+ | Model | Notes |
39
+ | --- | --- |
40
+ | `deepseek-chat` | Non-thinking surface (V3 lineage). Fast, cheap, broad coverage. Reasoning **off**. |
41
+ | `deepseek-reasoner` | Thinking surface (R1 lineage). Emits a reasoning channel. Reasoning **on**. |
42
+ | `deepseek-v4-flash` | Newer flash tier. Reasoning **off** by default. |
43
+ | `deepseek-v4-pro` | Newer quality tier. Reasoning **on** by default. |
44
+
45
+ DeepSeek announced the legacy `deepseek-chat` / `deepseek-reasoner` names retire 2026/07/24 in favor of the `deepseek-v4-*` family; both name sets are understood by the capability inference. `deepseek.model({ name })` accepts any id the upstream serves.
46
+
47
+ ## Capabilities — what's auto-set
48
+
49
+ | Flag | Default |
50
+ | --- | --- |
51
+ | `reasoning` | Inferred from the DeepSeek model name. `true` for `deepseek-reasoner` and the `*-pro` tier; `false` for `deepseek-chat` / `*-flash`. Drives whether the reasoning-effort knob is forwarded. |
52
+ | `vision` | `false` for every DeepSeek model — no DeepSeek chat model documents image input (mid-2026). |
53
+ | `structuredOutput` | `true` (inherited from the wrapped OpenAI model), unless `responseFormat` is set to a loose mode. |
54
+ | `promptCaching` | `true` (inherited). DeepSeek reports cache hits via `usage.cachedTokens`, the same shape as OpenAI. |
55
+
56
+ **Override any flag explicitly** via `.model({ name, reasoning?, vision?, structuredOutput? })` — an explicit value always wins over the injected inference.
57
+
58
+ ```ts
59
+ deepseek.model({ name: "deepseek-chat", reasoning: true }) // force thinking flag
60
+ deepseek.model({ name: "deepseek-reasoner", reasoning: false }) // suppress it
61
+ ```
62
+
63
+ ## Uses the OpenAI-compatible endpoint
64
+
65
+ Everything on the wire — Chat Completions request/response shape, streaming loop, tool-call accumulation, structured-output `response_format`, multipart message mapping, and error wrapping — is inherited **unchanged** from `OpenAIModel`. See [`setup-openai`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md) for the wire-level detail; it all applies here against `https://api.deepseek.com`.
66
+
67
+ Structured output, reasoning effort, and streaming therefore behave exactly as documented for the OpenAI adapter:
68
+
69
+ ```ts
70
+ const model = deepseek.model({ name: "deepseek-reasoner" }); // reasoning auto-true
71
+ await model.complete(messages, { reasoning: { effort: "high" } }); // → reasoning_effort: "high"
72
+ ```
73
+
74
+ ## Embeddings & images
75
+
76
+ `deepseek.embedder({...})` and `deepseek.image({...})` delegate to the wrapped `OpenAISDK`. **DeepSeek does not officially document an OpenAI-compatible embeddings endpoint or an image-generation endpoint (mid-2026)** — these delegates exist for adapter parity and work against a compatible gateway you point `baseURL` at, but may fail against the stock DeepSeek endpoint. Use a dedicated embeddings provider (e.g. `@warlock.js/ai-openai` / `@warlock.js/ai-google`) for RAG.
77
+
78
+ ## Pricing
79
+
80
+ The adapter ships **built-in DeepSeek pricing defaults** (USD per 1M tokens, from DeepSeek's published table), so `usage.cost` is computed out of the box:
81
+
82
+ ```ts
83
+ const deepseek = new DeepSeekSDK({ apiKey }); // deepseek-chat → { input: 0.14, output: 0.28, cachedInput: 0.0028 }
84
+ ```
85
+
86
+ Override per model or per SDK exactly like the OpenAI adapter. Resolution at `model()` time: per-model `pricing` > SDK `pricing` registry > built-in DeepSeek default > `undefined`.
87
+
88
+ ```ts
89
+ new DeepSeekSDK({ apiKey, pricing: { "deepseek-reasoner": { input: 0.55, output: 2.19 } } });
90
+ ```
91
+
92
+ ## Errors
93
+
94
+ Raw errors surface through the wrapped OpenAI adapter's wrapper into the typed `@warlock.js/ai` `AIError` hierarchy — see [`@warlock.js/ai/handle-ai-errors/SKILL.md`](@warlock.js/ai/handle-ai-errors/SKILL.md).
95
+
96
+ ## When NOT to use this skill
97
+
98
+ - OpenAI / Azure OpenAI / OpenRouter / local OpenAI-compatible gateways — use `@warlock.js/ai-openai`.
99
+ - Anthropic — `@warlock.js/ai-anthropic`. Gemini — `@warlock.js/ai-google`. Ollama — `@warlock.js/ai-ollama`.
100
+ - Calling the DeepSeek HTTP API or the raw `openai` SDK directly without going through `@warlock.js/ai` agents.
101
+
102
+ ## See also
103
+
104
+ - [`@warlock.js/ai-openai/skills/setup-openai/SKILL.md`](@warlock.js/ai-openai/skills/setup-openai/SKILL.md) — the wrapped adapter; all wire-level behavior.
105
+ - [`@warlock.js/ai/run-ai-agent/SKILL.md`](@warlock.js/ai/run-ai-agent/SKILL.md) — passing the model into `ai.agent({...})`.
106
+ - [`@warlock.js/ai/pick-ai-provider/SKILL.md`](@warlock.js/ai/pick-ai-provider/SKILL.md) — adapter comparison.