Metadata-Version: 2.4
Name: deepseek-harness
Version: 0.2.0
Summary: Protocol-aware client for DeepSeek V4-Pro / V4-Flash. Survives the 16 documented quirks; ships the cache discount.
Author: Henry Zhang
License: MIT
Project-URL: Homepage, https://github.com/HenryZ838978/deepseek-harness
Project-URL: Reports, https://github.com/HenryZ838978/deepseek-harness/tree/main/reports
Project-URL: Spec, https://github.com/HenryZ838978/deepseek-harness/tree/main/spec
Keywords: deepseek,llm,openai,agent,harness,mcp
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: openai>=1.50.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: tiktoken>=0.7.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: ruff>=0.5.0; extra == "dev"
Provides-Extra: dotenv
Requires-Dist: python-dotenv>=1.0.0; extra == "dotenv"

# `deepseek-harness`

Protocol-aware Python client for **DeepSeek V4-Pro / V4-Flash**.
Survives the [16 documented quirks](https://github.com/HenryZ838978/deepseek-harness/blob/main/reports/REPORT_2026-05-09.md); ships the 50× cache discount.

```bash
pip install deepseek-harness
```

```python
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](https://github.com/HenryZ838978/deepseek-harness) for the full spec, probe corpus, and three other distribution forms (`dsh` CLI, `@deepseek-harness/mcp` server, Anthropic `SKILL.md`).

License: MIT.
