Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepseek_harness-0.3.0.tar.gz (20.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepseek_harness-0.3.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file deepseek_harness-0.3.0.tar.gz.

File metadata

  • Download URL: deepseek_harness-0.3.0.tar.gz
  • Upload date:
  • Size: 20.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for deepseek_harness-0.3.0.tar.gz
Algorithm Hash digest
SHA256 4c3615cbe440f079c69c6c563e0c9665d64a43855ad52662db731d82fef7f493
MD5 f38bc174a6e05f88d0780a4e5d18645b
BLAKE2b-256 ea4097bb5468c4030ad5a05e1f25c85df9e5eaa240d7893e4bae7dd4f256f185

See more details on using hashes here.

File details

Details for the file deepseek_harness-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deepseek_harness-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 994f8d9414a68962927fff9019b26ccfc5960da7c62eab007081f50474901032
MD5 05f1691d74ca35fd0b97863a4bd9557b
BLAKE2b-256 e5e47a28cdfcef273eb85e1442b0c1139bbd53239de1d0020337871b9d6d94f3

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page