npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-rerun-llm-cache

v0.1.2

Published

Content-addressed model response cache for dsh-rerun attempts: replays a byte-identical request, records a new one

Readme

dsh-rerun-llm-cache

Content-addressed model response cache, mounted INSIDE an attempt.

The key is the hash of the complete assembled request — route, sampling parameters, system prompt, tool schemas, and every message. A hit means the request was byte-identical to one already recorded, so replaying its response changes nothing about the experiment; a miss means the request genuinely differs and honestly costs a model call.

This is the opposite of dsh-llm-replay, which serves recorded responses by CALL POSITION. Positional replay is right for snapshot tests, where the script and the harness move together. It is wrong here: the moment a harness change alters a prompt, position N no longer answers request N, and the run would quietly measure a conversation that never happened.

What it buys: re-running a baseline is free and bit-identical; two variants share every request up to the point the change bites; strict mode makes a run provably offline and exactly repeatable.

What it does not buy: a candidate's FIRST run. A changed system prompt diverges at step zero.

Why the key normalizes paths

DSH's persona carries the working directory (Your working directory is {{cwd}}), and every attempt gets its own — <root>/<run>/<cell>/workspace. So without normalization the system prompt differs for every repeat and every run, every request misses, and none of the above is true.

The key therefore tokenizes the attempt's OWN paths — workspace, home, session root, run id, and their macOS /private spellings — before hashing. What makes that sound rather than convenient is that the set is CLOSED: only paths the framework itself minted for this attempt, read from the environment it set. It is not fuzzy matching, and there is deliberately no knob for adding patterns — anything else that varies between two attempts of the same cell is a real confound, and hiding it from the cache would leave it in the experiment.

Normalization affects the KEY only. The request that reaches the provider and the response recorded against it are untouched.

A run whose served rate is near zero says so at the top of its report, because that is the symptom of exactly this class of bug reappearing for a new reason.

- id: rerun-llm-cache
  name: 'dsh-rerun-llm-cache'
  config: { root: .rerun/cache, mode: read-write }

Model Experience

None of its own. It intercepts the llm/stream waterfall and either replays a recorded chunk sequence or delegates unchanged; it never adds to, removes from, or reorders a request.

KV Cache effect

None on the assembled request — the prefix the provider sees is untouched. On a cache HIT no provider request is made at all, so that step reports no usage, which is why an attempt's cacheHitRatio and this cache's hit rate are separate figures.

Known Limitations and Deferred Work

  • A partial stream is never recorded, so a response truncated by a cancel or a network fault is re-fetched next time rather than made permanent. The cost is that a genuinely long stream interrupted near the end is paid for twice.
  • The cache never expires. It grows with every distinct request, and nothing prunes it; the directory is plain files and safe to delete.
  • Entries store complete request bodies. See SECURITY.md.
  • Normalization knows only the paths rerun minted. A prompt carrying a timestamp, a hostname, or a path from somewhere else still misses every time. That is reported rather than papered over: the report's dead-cache caveat fires below a 20% served rate.