llm-api-adapter-deepseek 0.1.0__tar.gz
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.
- llm_api_adapter_deepseek-0.1.0/LICENSE +21 -0
- llm_api_adapter_deepseek-0.1.0/MANIFEST.in +10 -0
- llm_api_adapter_deepseek-0.1.0/PKG-INFO +191 -0
- llm_api_adapter_deepseek-0.1.0/README.md +143 -0
- llm_api_adapter_deepseek-0.1.0/pyproject.toml +66 -0
- llm_api_adapter_deepseek-0.1.0/setup.cfg +4 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/__init__.py +3 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/adapter.py +1050 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/clients/__init__.py +12 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/clients/async_client.py +88 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/clients/sync_client.py +258 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/plugin.py +27 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/py.typed +0 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/registry/__init__.py +42 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/registry/cache_pricing.py +136 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/registry/organizations/deepseek.json +21 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek/streaming.py +582 -0
- llm_api_adapter_deepseek-0.1.0/src/llm_api_adapter_deepseek.egg-info/SOURCES.txt +18 -0
- llm_api_adapter_deepseek-0.1.0/tests/test_capability_discovery.py +107 -0
- llm_api_adapter_deepseek-0.1.0/tests/test_deepseek_adapter.py +1493 -0
- llm_api_adapter_deepseek-0.1.0/tests/test_package_scaffold.py +53 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Sergey Inozemtsev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include src/llm_api_adapter_deepseek/py.typed
|
|
4
|
+
recursive-include src/llm_api_adapter_deepseek/registry/organizations *.json
|
|
5
|
+
|
|
6
|
+
global-exclude *.py[cod]
|
|
7
|
+
prune **/__pycache__
|
|
8
|
+
prune **/.pytest_cache
|
|
9
|
+
global-exclude *.egg-info
|
|
10
|
+
prune **/*.egg-info
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: llm-api-adapter-deepseek
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Official DeepSeek API package for llm-api-adapter
|
|
5
|
+
Author: Sergey Inozemtsev
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Sergey Inozemtsev
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Repository, https://github.com/Inozem/llm_api_adapter/
|
|
29
|
+
Keywords: llm,deepseek,adapter,api
|
|
30
|
+
Classifier: Programming Language :: Python :: 3
|
|
31
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
32
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
36
|
+
Classifier: Typing :: Typed
|
|
37
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
+
Classifier: Operating System :: OS Independent
|
|
39
|
+
Requires-Python: >=3.10
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
License-File: LICENSE
|
|
42
|
+
Requires-Dist: llm-api-adapter<1.0.0,>=0.9.6
|
|
43
|
+
Provides-Extra: async
|
|
44
|
+
Requires-Dist: llm-api-adapter[async]<1.0.0,>=0.9.6; extra == "async"
|
|
45
|
+
Provides-Extra: httpx
|
|
46
|
+
Requires-Dist: llm-api-adapter[httpx]<1.0.0,>=0.9.6; extra == "httpx"
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
|
|
49
|
+
# llm-api-adapter-deepseek
|
|
50
|
+
|
|
51
|
+
Official direct DeepSeek API support for
|
|
52
|
+
[llm-api-adapter](https://github.com/Inozem/llm_api_adapter/).
|
|
53
|
+
|
|
54
|
+
This independently versioned package targets Core `>=0.9.6,<1.0.0` and adds no
|
|
55
|
+
DeepSeek SDK dependency. Select it through the existing
|
|
56
|
+
`UniversalLLMAPIAdapter` facade with organization `deepseek` and the canonical
|
|
57
|
+
model `deepseek-flash`.
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install "llm-api-adapter[deepseek]"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Direct installation is also supported when Core is managed separately:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
pip install llm-api-adapter-deepseek
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The Core extra and the direct package install provide the same organization
|
|
72
|
+
plugin. The extra is the recommended route when installing Core and its
|
|
73
|
+
optional organization support together; direct installation is useful when
|
|
74
|
+
Core is already installed or managed by a separate dependency set.
|
|
75
|
+
|
|
76
|
+
## Core discovery behavior
|
|
77
|
+
|
|
78
|
+
Core recognizes `deepseek` as an optional organization without importing this
|
|
79
|
+
package in its base installation. Selecting `deepseek` before installing the
|
|
80
|
+
package raises an actionable error:
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
Organization 'deepseek' is not installed. Install it with: pip install llm-api-adapter-deepseek
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
After either installation route, the entry point is loaded lazily when the
|
|
87
|
+
facade selects `organization="deepseek"`. An unknown name such as
|
|
88
|
+
`organization="deepseek-like"` is not treated as an uninstalled DeepSeek
|
|
89
|
+
package and instead raises the distinct unsupported-organization error.
|
|
90
|
+
|
|
91
|
+
## Quick start
|
|
92
|
+
|
|
93
|
+
```python
|
|
94
|
+
import os
|
|
95
|
+
|
|
96
|
+
from llm_api_adapter.models.messages.chat_message import UserMessage
|
|
97
|
+
from llm_api_adapter.universal_adapter import UniversalLLMAPIAdapter
|
|
98
|
+
|
|
99
|
+
adapter = UniversalLLMAPIAdapter(
|
|
100
|
+
organization="deepseek",
|
|
101
|
+
model="deepseek-flash",
|
|
102
|
+
api_key=os.environ["DEEPSEEK_API_KEY"],
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
response = adapter.chat(
|
|
106
|
+
messages=[UserMessage("Explain retrieval-augmented generation.")],
|
|
107
|
+
max_tokens=256,
|
|
108
|
+
)
|
|
109
|
+
print(response.content)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Supported model and compatibility
|
|
113
|
+
|
|
114
|
+
The package exposes one exact, verified model ID: `deepseek-flash`. It uses the
|
|
115
|
+
official Responses API and keeps the public Core request shape unchanged.
|
|
116
|
+
|
|
117
|
+
| Capability | `deepseek-flash` |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| Text `chat()` / `achat()` | Supported |
|
|
120
|
+
| Sync and async streaming | Supported |
|
|
121
|
+
| Application function tools | Supported; named tool selection and tool-result continuation force `reasoning_level="none"` and emit a warning because DeepSeek thinking rejects that function-tool combination. Provider-built-in tools are rejected. |
|
|
122
|
+
| Portable JSON Schema and Pydantic output | Supported |
|
|
123
|
+
| Reasoning | Supported levels: `none`, `low`, `high`, `max`; visible reasoning is opt-in |
|
|
124
|
+
| Images | User-message URL, bytes, and base64 data URI; JPEG, PNG, GIF, and WebP only |
|
|
125
|
+
| Documents and generic files | Unsupported; rejected before transport |
|
|
126
|
+
| OCR, Files API upload, local conversion, and document fallback | Not implemented |
|
|
127
|
+
|
|
128
|
+
The adapter rejects unsupported capabilities before either the synchronous or
|
|
129
|
+
asynchronous client is invoked. It does not infer support from model prefixes,
|
|
130
|
+
retired aliases, or an endpoint name.
|
|
131
|
+
|
|
132
|
+
## Images and the file boundary
|
|
133
|
+
|
|
134
|
+
`ImagePart` may be supplied only on a `UserMessage`. DeepSeek accepts an
|
|
135
|
+
HTTP(S) image URL, image bytes with an explicit supported MIME type, or a
|
|
136
|
+
base64 data URI. The adapter validates the documented boundary locally:
|
|
137
|
+
|
|
138
|
+
- supported media types are `image/jpeg`, `image/png`, `image/gif`, and
|
|
139
|
+
`image/webp`;
|
|
140
|
+
- external image URLs are limited to 8,192 characters;
|
|
141
|
+
- inline image data is limited to 32 MiB per image; and
|
|
142
|
+
- a request may contain at most 600 images.
|
|
143
|
+
|
|
144
|
+
Every `DocumentPart`, generic `FilePart`, non-user image, unsupported image
|
|
145
|
+
form, OCR/upload/conversion route, and other non-image file input raises a
|
|
146
|
+
compatibility error before an outbound request. The package never fetches
|
|
147
|
+
document URLs, uploads files, runs OCR, converts documents, or silently falls
|
|
148
|
+
back to another endpoint or model.
|
|
149
|
+
|
|
150
|
+
## History and continuation privacy
|
|
151
|
+
|
|
152
|
+
DeepSeek Responses requests are stateless. Keep the complete conversation in
|
|
153
|
+
the normal `messages` list, including assistant tool calls and `ToolMessage`
|
|
154
|
+
results. `previous_response` does not send a provider
|
|
155
|
+
`previous_response_id`; it is used only to carry the matching opaque reasoning
|
|
156
|
+
replay material required by a subsequent DeepSeek request.
|
|
157
|
+
|
|
158
|
+
That replay material is kept in `ChatResponse.provider_data`, never merged into
|
|
159
|
+
visible assistant text or `reasoning_events`, never included in `repr` or
|
|
160
|
+
public serialization, and never logged. Set `capture_reasoning=True` only when
|
|
161
|
+
the caller explicitly wants provider reasoning summaries exposed through the
|
|
162
|
+
normal reasoning callbacks.
|
|
163
|
+
|
|
164
|
+
## Usage and standard-rate estimates
|
|
165
|
+
|
|
166
|
+
DeepSeek reports normalized `input_tokens`, `output_tokens`, and
|
|
167
|
+
`total_tokens`, plus optional `usage.input_tokens_details.cached_tokens` and
|
|
168
|
+
`usage.output_tokens_details.reasoning_tokens`. The package retains those
|
|
169
|
+
details when they are valid and calculates a USD standard-rate estimate from
|
|
170
|
+
the UTC request-dispatch window:
|
|
171
|
+
|
|
172
|
+
| Window | Cache-hit input / 1M | Cache-miss input / 1M | Output / 1M |
|
|
173
|
+
| --- | ---: | ---: | ---: |
|
|
174
|
+
| Peak (weekdays 01:00–04:00 and 06:00–10:00 UTC) | $0.006 | $0.30 | $1.20 |
|
|
175
|
+
| Off-peak (all other times) | $0.003 | $0.15 | $0.60 |
|
|
176
|
+
|
|
177
|
+
These values are a standard estimate, not an invoice. Context caching is
|
|
178
|
+
managed by DeepSeek; the SDK does not store or control a cache. If usage,
|
|
179
|
+
cached-token details, the dispatch timestamp, or the selected rate cannot be
|
|
180
|
+
verified, the relevant cost field remains unavailable rather than being
|
|
181
|
+
guessed. See the [DeepSeek pricing](https://api-docs.deepseek.com/quick_start/pricing/)
|
|
182
|
+
and [Responses usage](https://api-docs.deepseek.com/guides/responses_api/)
|
|
183
|
+
documentation for provider semantics.
|
|
184
|
+
|
|
185
|
+
## Official DeepSeek references
|
|
186
|
+
|
|
187
|
+
- [Models and pricing](https://api-docs.deepseek.com/quick_start/pricing/)
|
|
188
|
+
- [Responses API](https://api-docs.deepseek.com/guides/responses_api/)
|
|
189
|
+
- [Vision input](https://api-docs.deepseek.com/guides/vision/)
|
|
190
|
+
- [Context caching](https://api-docs.deepseek.com/guides/kv_cache/)
|
|
191
|
+
- [Error codes](https://api-docs.deepseek.com/quick_start/error_codes/)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# llm-api-adapter-deepseek
|
|
2
|
+
|
|
3
|
+
Official direct DeepSeek API support for
|
|
4
|
+
[llm-api-adapter](https://github.com/Inozem/llm_api_adapter/).
|
|
5
|
+
|
|
6
|
+
This independently versioned package targets Core `>=0.9.6,<1.0.0` and adds no
|
|
7
|
+
DeepSeek SDK dependency. Select it through the existing
|
|
8
|
+
`UniversalLLMAPIAdapter` facade with organization `deepseek` and the canonical
|
|
9
|
+
model `deepseek-flash`.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pip install "llm-api-adapter[deepseek]"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Direct installation is also supported when Core is managed separately:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pip install llm-api-adapter-deepseek
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The Core extra and the direct package install provide the same organization
|
|
24
|
+
plugin. The extra is the recommended route when installing Core and its
|
|
25
|
+
optional organization support together; direct installation is useful when
|
|
26
|
+
Core is already installed or managed by a separate dependency set.
|
|
27
|
+
|
|
28
|
+
## Core discovery behavior
|
|
29
|
+
|
|
30
|
+
Core recognizes `deepseek` as an optional organization without importing this
|
|
31
|
+
package in its base installation. Selecting `deepseek` before installing the
|
|
32
|
+
package raises an actionable error:
|
|
33
|
+
|
|
34
|
+
```text
|
|
35
|
+
Organization 'deepseek' is not installed. Install it with: pip install llm-api-adapter-deepseek
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
After either installation route, the entry point is loaded lazily when the
|
|
39
|
+
facade selects `organization="deepseek"`. An unknown name such as
|
|
40
|
+
`organization="deepseek-like"` is not treated as an uninstalled DeepSeek
|
|
41
|
+
package and instead raises the distinct unsupported-organization error.
|
|
42
|
+
|
|
43
|
+
## Quick start
|
|
44
|
+
|
|
45
|
+
```python
|
|
46
|
+
import os
|
|
47
|
+
|
|
48
|
+
from llm_api_adapter.models.messages.chat_message import UserMessage
|
|
49
|
+
from llm_api_adapter.universal_adapter import UniversalLLMAPIAdapter
|
|
50
|
+
|
|
51
|
+
adapter = UniversalLLMAPIAdapter(
|
|
52
|
+
organization="deepseek",
|
|
53
|
+
model="deepseek-flash",
|
|
54
|
+
api_key=os.environ["DEEPSEEK_API_KEY"],
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
response = adapter.chat(
|
|
58
|
+
messages=[UserMessage("Explain retrieval-augmented generation.")],
|
|
59
|
+
max_tokens=256,
|
|
60
|
+
)
|
|
61
|
+
print(response.content)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Supported model and compatibility
|
|
65
|
+
|
|
66
|
+
The package exposes one exact, verified model ID: `deepseek-flash`. It uses the
|
|
67
|
+
official Responses API and keeps the public Core request shape unchanged.
|
|
68
|
+
|
|
69
|
+
| Capability | `deepseek-flash` |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| Text `chat()` / `achat()` | Supported |
|
|
72
|
+
| Sync and async streaming | Supported |
|
|
73
|
+
| Application function tools | Supported; named tool selection and tool-result continuation force `reasoning_level="none"` and emit a warning because DeepSeek thinking rejects that function-tool combination. Provider-built-in tools are rejected. |
|
|
74
|
+
| Portable JSON Schema and Pydantic output | Supported |
|
|
75
|
+
| Reasoning | Supported levels: `none`, `low`, `high`, `max`; visible reasoning is opt-in |
|
|
76
|
+
| Images | User-message URL, bytes, and base64 data URI; JPEG, PNG, GIF, and WebP only |
|
|
77
|
+
| Documents and generic files | Unsupported; rejected before transport |
|
|
78
|
+
| OCR, Files API upload, local conversion, and document fallback | Not implemented |
|
|
79
|
+
|
|
80
|
+
The adapter rejects unsupported capabilities before either the synchronous or
|
|
81
|
+
asynchronous client is invoked. It does not infer support from model prefixes,
|
|
82
|
+
retired aliases, or an endpoint name.
|
|
83
|
+
|
|
84
|
+
## Images and the file boundary
|
|
85
|
+
|
|
86
|
+
`ImagePart` may be supplied only on a `UserMessage`. DeepSeek accepts an
|
|
87
|
+
HTTP(S) image URL, image bytes with an explicit supported MIME type, or a
|
|
88
|
+
base64 data URI. The adapter validates the documented boundary locally:
|
|
89
|
+
|
|
90
|
+
- supported media types are `image/jpeg`, `image/png`, `image/gif`, and
|
|
91
|
+
`image/webp`;
|
|
92
|
+
- external image URLs are limited to 8,192 characters;
|
|
93
|
+
- inline image data is limited to 32 MiB per image; and
|
|
94
|
+
- a request may contain at most 600 images.
|
|
95
|
+
|
|
96
|
+
Every `DocumentPart`, generic `FilePart`, non-user image, unsupported image
|
|
97
|
+
form, OCR/upload/conversion route, and other non-image file input raises a
|
|
98
|
+
compatibility error before an outbound request. The package never fetches
|
|
99
|
+
document URLs, uploads files, runs OCR, converts documents, or silently falls
|
|
100
|
+
back to another endpoint or model.
|
|
101
|
+
|
|
102
|
+
## History and continuation privacy
|
|
103
|
+
|
|
104
|
+
DeepSeek Responses requests are stateless. Keep the complete conversation in
|
|
105
|
+
the normal `messages` list, including assistant tool calls and `ToolMessage`
|
|
106
|
+
results. `previous_response` does not send a provider
|
|
107
|
+
`previous_response_id`; it is used only to carry the matching opaque reasoning
|
|
108
|
+
replay material required by a subsequent DeepSeek request.
|
|
109
|
+
|
|
110
|
+
That replay material is kept in `ChatResponse.provider_data`, never merged into
|
|
111
|
+
visible assistant text or `reasoning_events`, never included in `repr` or
|
|
112
|
+
public serialization, and never logged. Set `capture_reasoning=True` only when
|
|
113
|
+
the caller explicitly wants provider reasoning summaries exposed through the
|
|
114
|
+
normal reasoning callbacks.
|
|
115
|
+
|
|
116
|
+
## Usage and standard-rate estimates
|
|
117
|
+
|
|
118
|
+
DeepSeek reports normalized `input_tokens`, `output_tokens`, and
|
|
119
|
+
`total_tokens`, plus optional `usage.input_tokens_details.cached_tokens` and
|
|
120
|
+
`usage.output_tokens_details.reasoning_tokens`. The package retains those
|
|
121
|
+
details when they are valid and calculates a USD standard-rate estimate from
|
|
122
|
+
the UTC request-dispatch window:
|
|
123
|
+
|
|
124
|
+
| Window | Cache-hit input / 1M | Cache-miss input / 1M | Output / 1M |
|
|
125
|
+
| --- | ---: | ---: | ---: |
|
|
126
|
+
| Peak (weekdays 01:00–04:00 and 06:00–10:00 UTC) | $0.006 | $0.30 | $1.20 |
|
|
127
|
+
| Off-peak (all other times) | $0.003 | $0.15 | $0.60 |
|
|
128
|
+
|
|
129
|
+
These values are a standard estimate, not an invoice. Context caching is
|
|
130
|
+
managed by DeepSeek; the SDK does not store or control a cache. If usage,
|
|
131
|
+
cached-token details, the dispatch timestamp, or the selected rate cannot be
|
|
132
|
+
verified, the relevant cost field remains unavailable rather than being
|
|
133
|
+
guessed. See the [DeepSeek pricing](https://api-docs.deepseek.com/quick_start/pricing/)
|
|
134
|
+
and [Responses usage](https://api-docs.deepseek.com/guides/responses_api/)
|
|
135
|
+
documentation for provider semantics.
|
|
136
|
+
|
|
137
|
+
## Official DeepSeek references
|
|
138
|
+
|
|
139
|
+
- [Models and pricing](https://api-docs.deepseek.com/quick_start/pricing/)
|
|
140
|
+
- [Responses API](https://api-docs.deepseek.com/guides/responses_api/)
|
|
141
|
+
- [Vision input](https://api-docs.deepseek.com/guides/vision/)
|
|
142
|
+
- [Context caching](https://api-docs.deepseek.com/guides/kv_cache/)
|
|
143
|
+
- [Error codes](https://api-docs.deepseek.com/quick_start/error_codes/)
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "llm-api-adapter-deepseek"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Official DeepSeek API package for llm-api-adapter"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {file = "LICENSE"}
|
|
12
|
+
authors = [{name = "Sergey Inozemtsev"}]
|
|
13
|
+
keywords = ["llm", "deepseek", "adapter", "api"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"Programming Language :: Python :: 3.10",
|
|
17
|
+
"Programming Language :: Python :: 3.11",
|
|
18
|
+
"Programming Language :: Python :: 3.12",
|
|
19
|
+
"Programming Language :: Python :: 3.13",
|
|
20
|
+
"Programming Language :: Python :: 3.14",
|
|
21
|
+
"Typing :: Typed",
|
|
22
|
+
"License :: OSI Approved :: MIT License",
|
|
23
|
+
"Operating System :: OS Independent",
|
|
24
|
+
]
|
|
25
|
+
dependencies = ["llm-api-adapter>=0.9.6,<1.0.0"]
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
async = ["llm-api-adapter[async]>=0.9.6,<1.0.0"]
|
|
29
|
+
httpx = ["llm-api-adapter[httpx]>=0.9.6,<1.0.0"]
|
|
30
|
+
|
|
31
|
+
[project.entry-points."llm_api_adapter.organizations"]
|
|
32
|
+
deepseek = "llm_api_adapter_deepseek.plugin:PLUGIN"
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Repository = "https://github.com/Inozem/llm_api_adapter/"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools.package-dir]
|
|
38
|
+
"" = "src"
|
|
39
|
+
|
|
40
|
+
[tool.setuptools.packages.find]
|
|
41
|
+
where = ["src"]
|
|
42
|
+
include = ["llm_api_adapter_deepseek*"]
|
|
43
|
+
exclude = ["tests*", "*/tests*"]
|
|
44
|
+
|
|
45
|
+
[tool.setuptools]
|
|
46
|
+
include-package-data = true
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.package-data]
|
|
49
|
+
"llm_api_adapter_deepseek" = ["py.typed", "registry/organizations/*.json"]
|
|
50
|
+
|
|
51
|
+
[tool.pytest.ini_options]
|
|
52
|
+
markers = [
|
|
53
|
+
"unit: unit tests (no network, pure logic, mocks)",
|
|
54
|
+
"integration: integration tests (mocked HTTP, no real organizations)",
|
|
55
|
+
"e2e: end-to-end tests (real LLM organizations)",
|
|
56
|
+
"e2e_builtin: aggregate end-to-end tests for all built-in core organizations",
|
|
57
|
+
"e2e_openai: end-to-end tests for the built-in OpenAI organization",
|
|
58
|
+
"e2e_anthropic: end-to-end tests for the built-in Anthropic organization",
|
|
59
|
+
"e2e_google: end-to-end tests for the built-in Google organization",
|
|
60
|
+
"e2e_mistral: end-to-end tests for the external Mistral organization package",
|
|
61
|
+
"e2e_xai: end-to-end tests for the external xAI organization package",
|
|
62
|
+
"e2e_kimi: end-to-end tests for the external Kimi organization package",
|
|
63
|
+
"e2e_qwen: end-to-end tests for the external Qwen organization package",
|
|
64
|
+
"e2e_deepseek: end-to-end tests for the external DeepSeek organization package",
|
|
65
|
+
"e2e_feature(name): capability required by a parametrized Core E2E scenario",
|
|
66
|
+
]
|