Harness Swap Lifts Same Model from 46.7% to 66.7% Success
In a Composio benchmark, DeepSeek V4 Flash running across 8 agent harnesses passed 20 of 30 hard tasks with Pi (66.7%), while Claude Code, Codex, and Deep Agents each passed 16. Pi's cost per successful task was $0.028, about 1/7 of Claude Code's $0.195. Community numbers show Pi and DeepSeek hitting 99.93% cache hits, processing nearly 1B input tokens for just $2.65 instead of an estimated $132. The article explains DeepSeek's prefix cache: matches must start from the first token, so harnesses must keep the prompt head stable. Reasonix and pi-deepseek-cache demonstrate concrete tactics: frozen environment summaries at startup, append-only context, separate sessions for executor and planner, and hash-cached deterministic summaries, cutting input token prices by 98-99%. Useful for engineers choosing agent harnesses or optimizing LLM API spend.
On August 11, Pi Harness founder Mario Zechner shared some data: developer 0xEvan used Pi to call DeepSeek V4 Flash, processed nearly 1 billion input tokens, achieved a cache hit rate of 99.93%, and ended up spending just $2.65. Without caching, the same usage would have cost an estimated $132.

That same day, another developer, Shantanu Goel, said that DeepSeek V4 Flash typically maintains a cache hit rate of 94% to 97% in other harnesses, but in Pi it consistently stays above 99%. Mario commented: "This is especially useful when using local models."

There are plenty more cases like this in the community.

This also brings to mind what Mario said in May this year about the Pi + DeepSeek V4 combination: "pi + ds4 == sovereign AI enterprise ready clearly." In plain Chinese, something like: "Pi + DeepSeek 4—enterprise-grade AI, done."

At the time, it was just a joke he made after seeing a developer run a terminal Tetris with Pi and DeepSeek V4. Three months later, a public head-to-head test unexpectedly supplied the data to back it up.
8 月 11 日,Pi Harness 创始人 Mario Zechner 转发了一组数据:开发者 0xEvan 用 Pi 调用 DeepSeek V4 Flash,处理了近 10 亿输入 Token,缓存命中率达到 99.93%,最终只花了 2.65 美元。如果没有缓存,同等用量预计需要 132 美元。

同一天,另一名开发者 Shantanu Goel 表示,DeepSeek V4 Flash 在其他 Harness 中的缓存命中率通常为 94%至 97%,到了 Pi 中却能持续达到 99%以上。Mario 对此评论道:“使用本地模型时,这一点尤其好用。”

社区里这种案例还有不少。

这也让人想起 Mario 今年 5 月对 Pi 与 DeepSeek V4 这一组合的评价:“pi + ds4 == sovereign AI enterprise ready clearly.”换成更符合中文语境的话,大概就是:“Pi + DeepSeek 4,企业级 AI 这不就成了吗。”

当时,这只是他看到开发者用 Pi 搭配 DeepSeek V4 跑通一个终端俄罗斯方块后的一句调侃。三个月后,一项公开横向测试,却意外给这句话补上了数据。
Composio is a company that builds tools for AI agents. It recently ran a public comparative test. It took the same model—DeepSeek V4 Flash—and ran it in 8 different agent harnesses across 30 challenging agent tasks. These tasks required the agent to take actions, use tools, and complete the entire job independently.
Pi Agent came in first: it passed 20 of 30 tasks, a success rate of 66.7%. Oh My Pi passed 17, taking second. Claude Code, Codex, and Deep Agents each passed 16. Prime Agent passed 15, with 6 runs not scored—2 because the scorer timed out processing them, and 4 because they left no records. Hermes Agent also passed 15. OpenCode passed 14, ranking last.

Composio 是一家为 AI 智能体开发工具的公司,最近进行了一项公开对比测试。他们选用同一个模型 DeepSeek V4 Flash,让它分别运行在 8 种不同的智能体 Harness 中,完成 30 项高难度的智能体任务。这些任务要求智能体采取行动、调用工具,并独立完成整个工作。
拿下第一名的是 Pi Agent:30 项任务通过 20 项,成功率达到 66.7%;Oh My Pi 通过 17 项,排名第二;Claude Code、Codex 和 Deep Agents 均通过 16 项;Prime Agent 通过 15 项,另有 6 次运行未被计分,其中 2 次因评分器处理超时而无法评分,另外 4 次没有留下记录;Hermes Agent 同样通过 15 项;OpenCode 通过 14 项,排名最后。

The same model, with only the outer harness swapped, saw its success rate jump from 46.7% to 66.7%—a full 20 percentage points.
The cost gap is even more striking. Pi spent an average of $0.028 per successful task, while Claude Code needed $0.195, nearly seven times as much.

Pi's median time to complete a task was 132.2 seconds, slightly slower than Claude Code's 122.7 and OpenCode's 129.7. But when you weigh success rate, speed, and cost together, Pi turned in the most impressive performance in this round.

同一个模型,仅仅更换外面的 Harness,成功率便从 46.7%升至 66.7%,相差整整 20 个百分点。
成本差距更加明显。Pi 平均完成一项成功任务只花费 0.028 美元,Claude Code 需要 0.195 美元,接近前者的 7 倍。

Pi 完成任务的中位时间为 132.2 秒,虽然略慢于 Claude Code 的 122.7 秒和 OpenCode 的 129.7 秒,但综合成功率、速度与成本来看,它交出了这轮测试中最突出的成绩。

The test demonstrates what's called the "harness multiplier effect": the tooling built around an AI amplifies or weakens how the model actually performs. Choose the right harness, and the same model becomes more reliable and more efficient at the same time. Choose the wrong one, and even if the underlying model's intelligence is identical, task success rates and runtime efficiency can drop noticeably.
Composio stresses, therefore, that models should not be evaluated in isolation. If an agent leaderboard only names the model without saying which harness was used, that score is incomplete.
这项测试体现了所谓的“Harness 乘数效应”:围绕 AI 搭建的工具会放大或削弱模型的实际表现。选对 Harness,同一个模型可以同时变得更可靠、更高效;选错 Harness,即使底层模型的智能水平完全相同,任务成功率和运行效率也可能明显下降。
Composio 因此强调,不应孤立评测模型;如果一份 Agent 排行榜只写模型名称,却没有交代使用了哪套 Harness,那么这个分数就是不完整的。
There's another detail in Composio's test that's worth noting: Pi had almost no extra configuration. It used a fresh, unmodified default installation, and only had the MCP server plugins needed for the test plugged in. Beyond that, Pi had no custom settings, no tuning, no special configuration. This near-out-of-the-box setup ended up passing the most tasks.
Now look at Prime Agent. It produced the largest sessions of the eight harnesses, with some sessions consuming as many as 3.5 million tokens and making 33 tool calls. Imagine an agent that, before actually starting to work, writes itself a task list as long as a phone book.
Those sessions became so huge that the scorer itself timed out while handling them. Two runs couldn't be scored, and four left no records, so six runs were excluded from the results. Even looking only at valid runs, Prime passed about as many tasks as Hermes, but took nearly twice as long as Pi.
These numbers show a stark contrast: Prime, with the most elaborate setup and the largest sessions, was dragged down by its own operational overhead, while the lighter Pi passed the most tasks at lower cost. In this test at least, adding more layers did not buy better outcomes.
Composio 公司的测试还有一个值得注意的细节:Pi 几乎没有添加额外配置,采用的是全新、未经修改的默认安装,只接入了测试所需的 MCP 服务器插件。除此之外,Pi 没有进行自定义设置、调优或特殊配置。正是这样一套接近开箱即用的方案,最终通过了最多的任务。
再看 Prime Agent。它在八种 Harness 中产生了最庞大的会话,部分会话消耗多达 350 万 Token,并进行了 33 次工具调用。可以把它想象成一个智能体还没有真正开始工作,就先给自己列出了一份电话簿那么长的任务清单。
这些会话规模过于庞大,评分器仅仅为了处理它们就发生了超时。两次运行无法评分,另外四次没有留下记录,因此共有六次运行未被计入成绩。即使只看有效运行,Prime 通过的任务数量也只与 Hermes 相当,耗时却接近 Pi 的两倍。
这组数据呈现出一个明显的反差:功能和会话最为庞杂的 Prime,最终被自身的运行负担拖慢;更加轻量的 Pi 则以较低开销通过了最多任务。至少在这项测试中,增加更多层并没有换来更好的结果。
This also challenges the old assumption that more configuration means better results. People typically reach for the largest model, then pile on every plugin, every extension, and every layer of complex features, assuming that more capabilities make a stronger agent. This test offers a different approach: pick a fast, low-cost model, put it inside a clean, lightweight harness, and let real tasks validate the pairing.
DeepSeek V4 Flash, as the name suggests, is a Flash model. Its positioning favors speed and operational efficiency, not winning model intelligence contests. The reason the lightweight Pi came out ahead is also simple. Every added layer is another place the agent can get lost. Every added tool is another decision it has to make. Every large instruction file is more noise it has to read before acting.
So a clean harness gives the model a short path from receiving a task to completing it, while a bloated harness makes it wander. That's why a default installation can beat heavyweight configurations: the path is shorter, and there are fewer chances to go in the wrong direction.
这也对过去“配置越多,效果越好”的思路提出了挑战。人们通常会选择最大的模型,叠加每一个插件、每一个扩展以及各种复杂的功能层,默认功能越多,智能体就越强。这项测试提供了另一种思路:选择一款速度快、成本低的模型,把它放进干净、轻量的 Harness 中,再用真实任务检验两者的组合。
DeepSeek V4 Flash 顾名思义是一款 Flash 模型,定位更侧重速度和运行效率,并不以赢得模型智能竞赛为目标。轻量化配置的 Pi 此次占优,原因其实也简单。每增加一层,智能体就多了一个可能迷路的地方;每增加一个工具,它就多了一项需要做出的选择;每增加一份庞大的指令文件,它在行动前就要阅读更多噪声。
因此,干净的 Harness 会给模型提供一条从接收任务到完成任务的短路径,臃肿的 Harness 则会让它四处绕路。这就是默认安装能够击败重量级配置的原因:路径更短,走错方向的机会也更少。
Pi itself is not a harness designed specifically for DeepSeek. It's more of an open agent foundation for developers: Pi lets developers modify the system prompt through extensions, filter conversation history, customize context compression, and dynamically add, remove, enable, or disable tools. Before a request goes to the model, developers can even inspect and rewrite the final payload directly. This programmability leaves a lot of room for optimizing DeepSeek's cache.
Pi 本身并不是一款专门为 DeepSeek 设计的 Harness。它更像是一套面向开发者开放的 Agent 底座:Pi 允许开发者通过扩展修改系统提示词、筛选对话历史、自定义上下文压缩,并动态增删或启停工具;在请求发给模型之前,开发者甚至可以直接检查和改写最终载荷。这种可编程性给 DeepSeek 的缓存优化留下了很大空间。
The DeepSeek API caches the prefix of the prompt in a request. If the token sequence at the start of the next request is exactly the same as the last one, the server reads those tokens directly from cache and bills them at a far lower price than normal input tokens. A cache hit costs much less than a cache miss.
The key point is that this is a prefix cache: matching must start from the very first token. If the front of the context changes, many tokens downstream may no longer hit the existing cache. The earlier the prefix changes, the more tokens get dragged down along with it.
A typical agent request includes the system prompt, tool definitions, conversation history, and new content for the current turn. On every step, the agent has to carry along a large chunk of context that has already appeared before. The longer the session, the more repeated content there is, and the better suited it is to caching in theory. But if the harness reorganizes this content on every turn—adding new timestamps, changing tool order, or rewriting the history summary—even a very long context is hard to reuse reliably.
DeepSeek API 会缓存请求中提示词的前缀。如果下一次请求开头的 Token 序列与上一次完全相同,服务端就会直接从缓存中读取这些 Token,并以远低于普通输入 Token 的价格计费。缓存命中的价格,要比缓存未命中低得多。
关键在于,这是一种前缀缓存,匹配需要从第一个 Token 开始。如果上下文前部发生变化,其后的大量 Token 就可能无法继续命中原有缓存。前缀越早发生变化,后面被“连坐”的 Token 就越多。
一套典型的 Agent 请求里,通常包含系统提示词、工具定义、对话历史和本轮新增内容。Agent 每执行一步,都要再次携带前面已经出现过的大量上下文。会话越长,重复内容越多,理论上越适合使用缓存。但如果 Harness 每轮都重新整理这些内容,加入新的时间戳、改变工具顺序或者重写历史摘要,再长的上下文也很难被稳定复用。
This has spawned a wave of harness projects dedicated to optimizing DeepSeek's cache. The open-source Reasonix is a terminal coding agent designed around DeepSeek's prefix cache, and its cache performance has drawn a lot of attention from developers. One developer who prefers Pi even built DeepPi specifically to port Reasonix's cache optimization methods over to Pi. He says that when calling the DeepSeek API, DeepPi's cache hit rate stays consistently between 99.7% and 99.9%.

"I tried to port some of Reasonix's performance advantages into a Deepseek package optimized for Pi. It only activates when you use the Deepseek API, but once activated, my cache hit rate stabilized between 99.7% and 99.9%."
这也催生了一批专门优化 DeepSeek 缓存的 Harness 项目。开源 Reasonix 是一款围绕 DeepSeek 前缀缓存设计的终端编程 Agent,其缓存表现受到不少开发者关注。一名更喜欢 Pi 的开发者甚至专门制作了 DeepPi,试图把 Reasonix 的缓存优化方法移植到 Pi 中。他称,DeepPi 在调用 DeepSeek API 时,缓存命中率可以稳定达到 99.7%至 99.9%。

我尝试将 Reasonix 的一些性能优势移植到针对 Pi 优化的 Deepseek 软件包中。它只有在使用 Deepseek API 时才会激活,但激活后,我的缓存命中率稳定在 99.7% 到 99.9% 之间。
Reasonix's core design principle is to keep the front of the context stable, use appending rather than modifying, and minimize the cost of change.
In practice, Reasonix injects a concise, stable environment summary at startup instead of regenerating it every turn. Outdated tool output is truncated and cleaned before it triggers summary compression, so the massive result of a cat command twenty turns ago doesn't keep sitting in the prompt prefix. Reasonix also documents the schema contracts of its built-in tools and does regression reviews when they change, because if tool definitions are silently reordered, it invalidates the cache in ways that aren't visible on the surface.
In dual-model mode, the execution model and the planning model run in separate, cache-stable sessions instead of being interleaved in the same context. This is the project's most clever design. The simplest way to add a planning model would be to insert planning turns directly into the same conversation, but that breaks cache stability for both roles. Keeping them in separate sessions lets each prompt prefix stay unchanged.
Reasonix 的核心设计原则是:保持上下文前端稳定,采用追加而非修改的方式,并将变更成本降至最低。
具体实现上,Reasonix 在启动时会注入一份精简、稳定的环境摘要,而不会在每轮对话中重新生成。过时的工具输出会在触发摘要压缩之前被截断和清理,因此,二十轮前一次 cat 命令产生的大量结果,不会一直留在提示词前缀中。Reasonix 还对内置工具的 Schema 契约进行了文档化,并在变更时进行回归审查,因为工具定义一旦在没有提示的情况下被重新调整,就会导致缓存失效,而且表面上看不出任何异常。
在双模型模式下,执行模型和规划模型会分别运行在各自独立且缓存稳定的会话中,而不会被交错放进同一个上下文。这一点是这个项目中最巧妙的设计。引入规划模型最简单的做法,是把规划轮次直接插入同一段对话,但这会破坏两个角色的缓存稳定性。将它们放在独立会话中,可以让各自的提示词前缀保持不变。
The Pi ecosystem has also seen plenty of similar third-party extensions. Take pi-deepseek-cache: it also makes DeepSeek cache optimization its core goal, and its design shares a lot in common with Reasonix.
Reasonix emphasizes "injecting a stable environment summary at startup." pi-deepseek-cache's P0 layer does exactly the same thing—it freezes the date and current working directory when the agent starts, eliminating at the root the cache invalidation caused by dynamic content in Pi's default system prompt, such as Current date: YYYY-MM-DD and Current working directory:.
Reasonix emphasizes "pruning and cleaning outdated tool output before compression." pi-deepseek-cache's P3 layer achieves this through cache-friendly compression: when the conversation history gets too long and needs summarizing, it uses deepseek-v4-flash at temperature 0 for deterministic summarization, and hashes the summary result for caching. This ensures the same history input always reuses a byte-identical summary, avoiding a broken prefix caused by fluctuating summary wording.
Reasonix also mentions "documenting tool Schema contracts and running regression reviews on changes." pi-deepseek-cache's P2 layer offers a similar safeguard: it uses SHA-256 hashing to diagnose the prefix and track when the prefix changes, so developers can quickly find the root cause of cache invalidation.

Pi 生态中也出现了不少类似的第三方扩展。以pi-deepseek-cache为例,它同样将 DeepSeek 缓存优化作为核心目标,设计思路与 Reasonix 有不少共同点。
Reasonix 强调“启动时注入稳定的环境摘要”,pi-deepseek-cache 的 P0 层做的正是同一件事——在 Agent 启动时冻结日期和当前工作目录,从根源上杜绝了 Pi 默认系统提示词中 Current date: YYYY-MM-DD 和 Current working directory: 这类动态内容导致的缓存失效。
Reasonix 强调“过时的工具输出要在压缩之前被剪枝和清理”,pi-deepseek-cache 的 P3 层则通过缓存友好的压缩来实现这一点——当对话历史过长需要总结时,使用 deepseek-v4-flash 在 temperature 为 0 的条件下进行确定性摘要,并对摘要结果做哈希缓存,确保相同的历史输入始终复用字节一致的摘要结果,避免因摘要文字波动而破坏前缀。
Reasonix 还提到“工具 Schema 契约文档化并在变更时回归审查”,pi-deepseek-cache 的 P2 层提供了类似的防护机制——通过 SHA-256 哈希对前缀进行诊断,追踪前缀何时发生变化,让开发者能及时发现缓存失效的根因。

The cost reduction from this extension is easy to see: with deepseek-v4-flash, the input token cost drops from $0.14 to $0.003 per million tokens, a 98% decrease; with deepseek-v4-pro, it drops from $3.00 to $0.025, a 99% decrease.
这个扩展的降本效果非常直观:以 deepseek-v4-flash 为例,输入 Token 成本从每百万 Token 0.14 美元降至 0.003 美元,降幅达 98%;deepseek-v4-pro 则从 3.00 美元降至 0.025 美元,降幅达 99%。
Interestingly, DeepSeek has not yet released its own harness. Just yesterday (August 11), the WeChat official account "DeepSeek Harness Team" was registered, widely read as a strong signal that a Harness product is about to launch. On top of that, internal beta testing has already begun, so an official release shouldn't be far off.
What special value could an official Harness bring? At its core, "native adaptation." Third-party harnesses can only reverse-optimize through public APIs, but an official team can coordinate back-to-back with the model training team. They can optimize the model for the Harness's calling patterns, and the Harness can use non-public information inside the model. That kind of deep integration is something no third party can replicate.
有趣的是,DeepSeek 官方至今还没有推出自己的 Harness。就在昨天(8 月 11 日),“DeepSeek Harness 团队”微信公众号已完成注册,被外界解读为 Harness 产品即将正式发布的重要信号。此外,产品内测也已经启动,正式发布应该不远了。
官方 Harness 能带来什么特别之处?最核心的一点可能还是“原生适配”。第三方 Harness 只能通过公开 API 做逆向优化,而官方团队可以和模型训练团队背靠背协同,让模型针对 Harness 的调用模式做针对性优化,Harness 也能利用模型内部的非公开信息。这种深度整合,是任何第三方都做不到的。
Reference links:
https://x.com/badlogicgames/status/2086877202239353285
https://www.reddit.com/r/DeepSeek/comments/1vhhxvy/deeppi_reasonixlevel_cache_performance_in_pi/