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

prompt-prism

v0.4.3

Published

A transparent local proxy that explains prompt-cache misses.

Readme

Prompt Prism dashboard showing an agent trace

While you build and run an Agent, Prompt Prism sits between it and the model provider. Responses—including SSE streams—are forwarded immediately, while a redacted copy is captured locally for inspection.

your agent  ──►  http://127.0.0.1:1028  ──►  model provider
                       │
                       └──► Trace + Input Diff + Tools + Output + Raw

Quick start

Requires Node.js 20 or later.

npm install -g prompt-prism
p2 start

Open http://127.0.0.1:1028/_pp/ (it opens automatically unless --no-open is used), click Proxy URL, and enter your provider's Base URL. Configure your Agent's model API client to use the generated URL—through its framework settings, SDK baseURL, environment variable, CLI option, or custom HTTP client—and keep using the provider's normal API key.

The generated URL looks like http://127.0.0.1:1028/_proxy/<encoded-upstream>. It selects the upstream for that request, so one Prism instance can connect to different providers without restarting.

The following SDK configurations are examples of connecting an Agent; Prompt Prism does not require either SDK.

Anthropic SDK example

import Anthropic from '@anthropic-ai/sdk';

const client = new Anthropic({
  apiKey: process.env.ANTHROPIC_API_KEY,
  baseURL: 'http://127.0.0.1:1028/_proxy/<encoded-upstream>'
});

OpenAI-compatible SDK example

import OpenAI from 'openai';

const client = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  baseURL: 'http://127.0.0.1:1028/_proxy/<encoded-upstream>'
});

For scripts, p2 url https://api.deepseek.com/v1 prints the same kind of URL as the Dashboard generator. It is an alternative to clicking Proxy URL, not an extra startup step.

If the Agent's model API client replaces the Base URL instead of preserving its path prefix, use the fixed --upstream-base-url compatibility mode described in the Guide.

What you can inspect

  • Trace — follow model, reasoning, tool call, and tool result events across captures.
  • Input Diff — find the first inserted or removed message and understand cache-prefix changes.
  • Tools — inspect declared schemas, parsed parameters, and the tools actually called.
  • Output — read normalized text, reasoning, usage, errors, and tool arguments.
  • Raw — fall back to the original redacted HTTP exchange for unsupported formats.
  • Agent Insights — compare trace-level token use, cache reuse, timing, and tool behavior from the CLI.

Compatibility

| Protocol | JSON | SSE | Tools | Normalized dashboard | | --- | --- | --- | --- | --- | | Anthropic Messages | Yes | Yes | Yes | Yes | | OpenAI Chat Completions | Yes | Yes | Yes | Yes | | OpenAI Responses | Yes | Yes | Yes | Yes | | Other HTTP traffic | Forwarded | Forwarded | Raw only | Raw only |

Realtime, Embeddings, Images, and Audio endpoints are not normalized in this release. They are still forwarded and captured in Raw.

Dynamic Proxy URLs are integration-tested with the official OpenAI and Anthropic JavaScript SDKs. Agent frameworks, CLIs, and custom HTTP clients can use the same route when they support a configurable request target and preserve its path prefix; otherwise, use --upstream-base-url. Non-Agent model traffic is also forwarded and remains available in Raw.

Documentation

  • Guide — provider setup, CLI options, protocol detection, embedding, and local data.
  • Agent Insights — inspect and compare agent runs from the shell.
  • Development — run the demo, work on the monorepo, and understand Trace relationships and Input Diff.
  • Releasing — prepare, verify, and publish a release manually.

Data and privacy

By default, Prompt Prism saves captures in a data folder inside the directory where you run p2 start (./data). For example, running it from /path/to/your-agent stores the data in /path/to/your-agent/data. Use p2 start --data-dir PATH to choose a different local folder. API keys, authorization headers, and cookies are replaced with [REDACTED]; request and response bodies remain on your machine because they are required for analysis. The default storage cap is 1 GB and the oldest captures are evicted first.

See the Guide before using Prompt Prism with sensitive projects.

License

MIT