How Pi’s Harness Achieves a 99.93% Cache Hit Rate for DeepSeek and Cuts Cost Up to 7×

The open‑source Pi harness for DeepSeek delivers a 99.93% cache hit rate, reducing token‑processing costs to $0.028 per successful task—about seven times cheaper than Claude Code—while supporting extensible file‑operation tools and demonstrating dramatic cost differences across competing agent harnesses.

Machine Learning Algorithms & Natural Language Processing
Machine Learning Algorithms & Natural Language Processing
Machine Learning Algorithms & Natural Language Processing
How Pi’s Harness Achieves a 99.93% Cache Hit Rate for DeepSeek and Cuts Cost Up to 7×

Pi is an open‑source programming‑agent harness designed for DeepSeek, currently starring around 86 000 GitHub stars. It provides a minimal default toolset—read file, write file, modify file, and execute command—and allows additional capabilities (planning mode, sub‑agents, MCP, Git checkpoints, permission control) to be added as extensions or Skills.

The term “harness” refers to the surrounding engineering system that gives a large language model (LLM) the ability to read files, invoke terminals, and run tests. Because different harnesses expose different tool interfaces, the same LLM can exhibit vastly different performance and cost characteristics.

Pi implements an automatic prefix‑cache: when the system prompt, tool definitions, and conversation history remain unchanged, the cache reuses the previously computed token prefix, so the model only processes newly added information. Cache hit rate is defined as the proportion of input tokens that are successfully reused.

In a real‑world test by developer Evan Kim, Pi achieved a 99.93% cache hit rate (only 0.07% miss) after integrating DeepSeek. A later measurement reported a 99.97% hit rate (0.03% miss), confirming the effectiveness of the cache.

Cost analysis shows that a successful task with Pi averages $0.028, whereas Claude Code averages $0.195—approximately seven times higher. Processing 1 billion tokens with the cache costs roughly $19, compared with over $900 without caching.

Composio’s horizontal benchmark of eight mainstream agent harnesses using DeepSeek V4 Flash highlighted that the choice of harness can cause cost differences of up to sevenfold, underscoring the importance of cache‑friendly designs.

DeepSeek’s own official harness is under development and aims to match Claude Code’s capabilities, but Pi remains a valuable third‑party solution that offers users full control over tools, workflows, and model providers.

References: Composio tweet (https://x.com/composio/status/2086814488162972027) and Pi GitHub repository (https://github.com/earendil-works/pi).

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DeepSeekBenchmarkCache OptimizationPiLLM CostAgent Harness
Machine Learning Algorithms & Natural Language Processing
Written by

Machine Learning Algorithms & Natural Language Processing

Focused on frontier AI technologies, empowering AI researchers' progress.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.