deepseek-harness
Protocol-aware Python client for DeepSeek V4-Pro / V4-Flash. Survives the 16 documented quirks; ships the 50× cache discount.
pip install deepseek-harness
from deepseek_harness import DeepSeekHarness
c = DeepSeekHarness(disable_thinking_by_default=True)
out = c.chat(
model="deepseek-v4-pro",
messages=[{"role": "user", "content": "Hello"}],
max_tokens=4096,
)
print(out["message"]["content"])
print(f"cost: ${out['usage']['estimated_cost_usd']:.6f} · cache hit: {out['usage']['cache_hit_rate']:.0%}")
The harness wraps openai.OpenAI and enforces 10 contract rules by default. See the main repository for the full spec, probe corpus, and three other distribution forms (dsh CLI, @deepseek-harness/mcp server, Anthropic SKILL.md).
License: MIT.
Metadata
Release files for deepseek-harness 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deepseek_harness-0.3.1.tar.gz | 22.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deepseek_harness-0.3.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.8 kB
Release files / deepseek_harness-0.3.1.tar.gz
| Download URL | deepseek_harness-0.3.1.tar.gz |
|---|---|
| Size | 22.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7995ecdbbbccd5fc58e4c9f29787b844142113aca816d1d2b5dd97ccc932aea9
|
|
BLAKE2b-256 checksum How to use checksums |
fe7b6ef35261bc5bd856f27ee1dda72ee5b50f94f9704b5d8df9e060d78005ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / deepseek_harness-0.3.1-py3-none-any.whl
| Download URL | deepseek_harness-0.3.1-py3-none-any.whl |
|---|---|
| Size | 21.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95781ae9223a8c6effd724517f9855d1fe08d473e3cbc16663b9d8ef48e290cb
|
|
BLAKE2b-256 checksum How to use checksums |
9875ee074b3f6016bb5fb2797f681ec04896488239b59b9c342842144a187d65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|