@prompt-diff/core 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -0
- package/dist/eval.js +1 -1
- package/dist/eval.js.map +1 -1
- package/package.json +5 -2
package/README.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
# Prompt-Diff
|
|
2
|
+
|
|
3
|
+
One prompt, many models — compare quality, speed, and cost.
|
|
4
|
+
|
|
5
|
+
[npm CLI](https://www.npmjs.com/package/@prompt-diff/cli)
|
|
6
|
+
[npm core](https://www.npmjs.com/package/@prompt-diff/core)
|
|
7
|
+
[License: MIT](./LICENSE)
|
|
8
|
+
[Node.js](https://nodejs.org)
|
|
9
|
+
[Live demo](https://prompt-diff-oss.vercel.app/)
|
|
10
|
+
[GitHub](https://github.com/darkrishabh/prompt-diff)
|
|
11
|
+
|
|
12
|
+
**[Live demo →](https://prompt-diff-oss.vercel.app/)** · [Quick start](#quick-start) · [Web UI](#web-ui) · [CLI](#cli-usage) · [Providers](#providers) · [Eval suites](#eval-suites-yaml) · [Architecture](#architecture) · [npm packages](docs/blog/npm-packages.md)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
**Prompt-Diff** runs **one prompt against many LLMs** and lines up answers, latency, tokens, and cost in a **CLI** (npm package `**@prompt-diff/cli`**, command `**prompt-diff`** when installed globally) and a **Next.js** web UI — so you can compare providers with evidence instead of juggling tabs and copy-paste.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx @prompt-diff/cli "Explain the CAP theorem in one paragraph" --models claude,ollama
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Works on **macOS**, **Linux**, and **Windows** with **Node.js 18+**.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Table of contents
|
|
27
|
+
|
|
28
|
+
- [Why Prompt-Diff?](#why-prompt-diff)
|
|
29
|
+
- [Features](#features)
|
|
30
|
+
- [Quick start](#quick-start)
|
|
31
|
+
- [Providers](#providers)
|
|
32
|
+
- [Configuration](#configuration)
|
|
33
|
+
- [Eval suites (YAML)](#eval-suites-yaml)
|
|
34
|
+
- [Web UI](#web-ui)
|
|
35
|
+
- [CLI usage](#cli-usage)
|
|
36
|
+
- [Architecture](#architecture)
|
|
37
|
+
- [Contributing](#contributing)
|
|
38
|
+
- [npm packages (blog)](docs/blog/npm-packages.md)
|
|
39
|
+
- [License](#license)
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Why Prompt-Diff?
|
|
44
|
+
|
|
45
|
+
Picking the right model shouldn't mean mentally mapping *which output came from where*. Prompt-Diff keeps every model's answer and metrics in one place so you can decide with data.
|
|
46
|
+
|
|
47
|
+
> **Tip:** Use the **CLI** in CI and scripts (`--output json`). Use the **web app** when you want a polished compare view, YAML test suites, and judge-backed rubrics — without restarting the server when you change models.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Features
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
| | |
|
|
55
|
+
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| **Side-by-side compare** | Same prompt, every enabled model — outputs, errors, and metrics in one grid. |
|
|
57
|
+
| **YAML eval suites** | Prompt templates × variable matrices × assertions (`contains`, `latency`, `cost`, `llm-rubric`). |
|
|
58
|
+
| **Live suite logs** | Streamed run log in the web UI so you see each LLM and judge call as it happens. |
|
|
59
|
+
| **OpenAI model list** | With an API key, the UI loads chat models from OpenAI's `/v1/models` (plus presets & "Other"). |
|
|
60
|
+
| **Secrets & judge** | Web settings for secret variables, Anthropic/Ollama judge, and YAML import/export. |
|
|
61
|
+
| **CLI + core library** | `npx @prompt-diff/cli` (or `npm i -g @prompt-diff/cli` then `prompt-diff`); `@prompt-diff/core` for programmatic diffs and suites. |
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Quick start
|
|
67
|
+
|
|
68
|
+
### CLI — zero install
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
ANTHROPIC_API_KEY=sk-... npx @prompt-diff/cli "What is LoRA?"
|
|
72
|
+
|
|
73
|
+
npx @prompt-diff/cli "Review this function" --file ./utils.py --models claude,ollama
|
|
74
|
+
|
|
75
|
+
# Average latency over 5 runs
|
|
76
|
+
npx @prompt-diff/cli "Summarize this" --runs 5 --output json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Web UI — hosted
|
|
80
|
+
|
|
81
|
+
Open **[https://prompt-diff-oss.vercel.app/](https://prompt-diff-oss.vercel.app/)**. Add API keys under **Settings** in the browser; test suites live at `/suite`.
|
|
82
|
+
|
|
83
|
+
### Web UI — local dev
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
git clone https://github.com/darkrishabh/prompt-diff
|
|
87
|
+
cd prompt-diff
|
|
88
|
+
npm install
|
|
89
|
+
npm run dev
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then open [http://localhost:3000](http://localhost:3000) (or `3001` if 3000 is busy).
|
|
93
|
+
|
|
94
|
+
> **Note:** Suite streaming and eval need a Node deployment (not `output: 'export'`). The suite API sets a long `maxDuration` for hosts like Vercel; very heavy runs may still need a higher limit or a long-lived server.
|
|
95
|
+
|
|
96
|
+
### Deploying on Vercel
|
|
97
|
+
|
|
98
|
+
Required settings or you'll get a plain `NOT_FOUND` on `*.vercel.app`:
|
|
99
|
+
|
|
100
|
+
1. **Root Directory** → set to `packages/web` (not `.` and not empty).
|
|
101
|
+
2. **Build Command** → leave empty (uses `packages/web/vercel.json: npm run build`) or set explicitly to `npm run build`. Do not use `next build` only — it skips compiling `@prompt-diff/core`.
|
|
102
|
+
3. **Install** → default `npm install` from the repository root is correct for npm workspaces.
|
|
103
|
+
4. **Include files outside Root Directory** → leave enabled so `packages/core` is visible during the build.
|
|
104
|
+
|
|
105
|
+
`packages/web/next.config.ts` sets `outputFileTracingRoot` to the monorepo root so API routes bundle correctly.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Providers
|
|
110
|
+
|
|
111
|
+
### Cloud APIs
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
| Provider | Env var | Notes |
|
|
115
|
+
| -------------- | -------------------------------------- | ------------------------------- |
|
|
116
|
+
| **Claude** | `ANTHROPIC_API_KEY` | Haiku, Sonnet, Opus |
|
|
117
|
+
| **OpenAI** | `OPENAI_API_KEY` | Full list in UI when key is set |
|
|
118
|
+
| **Groq** | `GROQ_API_KEY` | Very fast inference |
|
|
119
|
+
| **OpenRouter** | `OPENROUTER_API_KEY` | Many models, one key |
|
|
120
|
+
| **Together** | `TOGETHER_API_KEY` | Open-weight models |
|
|
121
|
+
| **NVIDIA NIM** | `NVIDIA_NIM_API_KEY` | NIM endpoints |
|
|
122
|
+
| **Perplexity** | `PERPLEXITY_API_KEY` | Search-grounded |
|
|
123
|
+
| **Minimax** | `MINIMAX_API_KEY` + `MINIMAX_GROUP_ID` | API + group ID |
|
|
124
|
+
| **Custom** | — | Any OpenAI-compatible base URL |
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
### Local & CLI
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
| Provider | Requirements |
|
|
131
|
+
| -------------- | ------------------------------------------------------------------------ |
|
|
132
|
+
| **Ollama** | [ollama.ai](https://ollama.ai) — local tags discovered via `/api/models` |
|
|
133
|
+
| **Claude CLI** | `@anthropic-ai/claude-code` on `PATH` |
|
|
134
|
+
| **Codex CLI** | `@openai/codex` on `PATH` |
|
|
135
|
+
| **LM Studio** | OpenAI-compatible server (e.g. `localhost:1234`) via **Custom** |
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Configuration
|
|
141
|
+
|
|
142
|
+
Copy `.env.example` to `.env.local` for the web app, or export vars in your shell for the CLI.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
146
|
+
OLLAMA_BASE_URL=http://localhost:11434 # optional
|
|
147
|
+
|
|
148
|
+
OPENAI_API_KEY=sk-...
|
|
149
|
+
GROQ_API_KEY=gsk_...
|
|
150
|
+
OPENROUTER_API_KEY=sk-or-...
|
|
151
|
+
TOGETHER_API_KEY=...
|
|
152
|
+
NVIDIA_NIM_API_KEY=nvapi-...
|
|
153
|
+
PERPLEXITY_API_KEY=pplx-...
|
|
154
|
+
|
|
155
|
+
MINIMAX_API_KEY=...
|
|
156
|
+
MINIMAX_GROUP_ID=...
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Eval suites (YAML)
|
|
162
|
+
|
|
163
|
+
Define prompt templates, test rows (`vars`), and assertions: `contains`, `not-contains`, `latency`, `cost`, and `llm-rubric` (needs a judge — Claude when a key is available, or `--judge ollama` / `none`).
|
|
164
|
+
|
|
165
|
+
Full example: `[examples/prompt-diff.yaml](examples/prompt-diff.yaml)`
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npx @prompt-diff/cli run --config examples/prompt-diff.yaml --models claude,ollama,minimax
|
|
169
|
+
npx @prompt-diff/cli run --config examples/prompt-diff.yaml --output json --fail-on-error
|
|
170
|
+
npx @prompt-diff/cli run --config examples/prompt-diff.yaml --judge none
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
With a global install (`npm i -g @prompt-diff/cli`), use `prompt-diff` instead of `npx @prompt-diff/cli`.
|
|
174
|
+
|
|
175
|
+
The web app runs the same engine at `POST /api/suite` with SSE live logs when `stream: true`.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Web UI
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
| Capability | Description |
|
|
183
|
+
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
184
|
+
| **Run workspace** | Prompt card, colored model chips, **+ add model**, **Run**, then **Responses / Compare & evaluate / History** |
|
|
185
|
+
| **Responses** | **Grid** (wrapping cards, 4+ models), **Side-by-side** (horizontal scroll), or **Diff** (line-level LCS between two outputs) |
|
|
186
|
+
| **Model cards** | Provider label, model ID, highlight pills (fastest / slowest / cheapest / best rated), 3-column metrics, markdown body, star rating + **Copy** |
|
|
187
|
+
| **Quick comparison** | Sticky footer mini-bars for latency, output tokens, and cost; **Full compare** jumps to the evaluate tab |
|
|
188
|
+
| **History** | Last runs stored in `localStorage`; click an entry to reload prompt + results |
|
|
189
|
+
| **Test suites** | `/suite` — YAML editor, run target banner, judge summary, live log, matrix results, recent runs (last 15, browser `localStorage`) |
|
|
190
|
+
| **Settings** | Models, secrets, judge, YAML import/export — stored in `localStorage` |
|
|
191
|
+
| **API routes** | `/api/diff`, `/api/suite`, `/api/models` (Ollama GET, OpenAI POST) |
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
---
|
|
195
|
+
|
|
196
|
+
## CLI usage
|
|
197
|
+
|
|
198
|
+
The on-disk command is `**prompt-diff`** after `npm i -g @prompt-diff/cli`; with `npx`, call `**npx @prompt-diff/cli`** instead.
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
Usage: prompt-diff <prompt> [options]
|
|
202
|
+
|
|
203
|
+
Arguments:
|
|
204
|
+
prompt Prompt to send to all providers
|
|
205
|
+
|
|
206
|
+
Options:
|
|
207
|
+
--file <path> Append file contents to the prompt
|
|
208
|
+
--models <list> Comma-separated providers (default: "claude,ollama")
|
|
209
|
+
--runs <n> Runs for latency averaging (default: 1)
|
|
210
|
+
--output <format> pretty | json (default: "pretty")
|
|
211
|
+
-V, --version Show version
|
|
212
|
+
-h, --help Show help
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
prompt-diff "Implement binary search in Python" --models claude,ollama
|
|
217
|
+
prompt-diff "Hello" --models groq,claude --runs 10 --output json | jq '.results[].latencyMs'
|
|
218
|
+
prompt-diff "Find bugs" --file ./server.ts
|
|
219
|
+
prompt-diff "Explain recursion" --models claude-cli,codex
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Architecture
|
|
225
|
+
|
|
226
|
+
```mermaid
|
|
227
|
+
flowchart LR
|
|
228
|
+
subgraph clients [Clients]
|
|
229
|
+
CLI[CLI / Ink]
|
|
230
|
+
WEB[Next.js UI]
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
subgraph pkg [packages]
|
|
234
|
+
CORE["@prompt-diff/core\nrunDiff · runSuite · providers"]
|
|
235
|
+
API[API routes]
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
CLI --> CORE
|
|
239
|
+
WEB --> API
|
|
240
|
+
API --> CORE
|
|
241
|
+
CORE --> P1[Claude / Ollama / OpenAI-compat …]
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
| Package | Role |
|
|
248
|
+
| ----------------------------------- | ------------------------------------------------------------------ |
|
|
249
|
+
| `packages/core` | `Provider` interface, `runDiff`, `runSuite`, YAML parsing, pricing |
|
|
250
|
+
| `packages/cli` (`@prompt-diff/cli`) | Commander + terminal UI; `**prompt-diff**` binary |
|
|
251
|
+
| `packages/web` | Next.js App Router, streaming suite API, model discovery proxy |
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
**Adding a provider** is on the order of tens of lines: implement `Provider` in core and wire it in the web API (and CLI config if needed). `OpenAICompatibleProvider` covers most REST APIs; subprocess adapters cover local CLIs.
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Contributing
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
git clone https://github.com/darkrishabh/prompt-diff.git
|
|
262
|
+
cd prompt-diff
|
|
263
|
+
npm install
|
|
264
|
+
npm run dev # turbo: CLI watch + Next dev
|
|
265
|
+
npm run build
|
|
266
|
+
npm run type-check
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
If your local `origin` still uses the old repository name:
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
git remote set-url origin https://github.com/darkrishabh/prompt-diff.git
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
Ideas that move the needle: new providers (Gemini, Bedrock, Azure OpenAI), richer diff UX, terminal markdown, tighter CI eval stories.
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
## License
|
|
280
|
+
|
|
281
|
+
MIT — see [LICENSE](./LICENSE).
|
|
282
|
+
|
|
283
|
+
Built by [@darkrishabh](https://github.com/darkrishabh)
|
package/dist/eval.js
CHANGED
|
@@ -36,7 +36,7 @@ async function runAssertion(assertion, result, judgeProvider, onLog) {
|
|
|
36
36
|
pass: false,
|
|
37
37
|
score: 0,
|
|
38
38
|
rubricCriterion: criterion,
|
|
39
|
-
reason: "No judge provider configured — set ANTHROPIC_API_KEY or use `prompt-diff run --judge ollama` (or --judge claude)",
|
|
39
|
+
reason: "No judge provider configured — set ANTHROPIC_API_KEY or use `npx @prompt-diff/cli run --judge ollama` (or --judge claude)",
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
if (result.error || !result.output) {
|
package/dist/eval.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval.js","sourceRoot":"","sources":["../src/eval.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,gFAAgF;AAEhF,KAAK,UAAU,YAAY,CACzB,SAAoB,EACpB,MAAsB,EACtB,aAAwB,EACxB,KAAiC;IAEjC,QAAQ,SAAS,CAAC,IAAI,EAAE,CAAC;QACvB,KAAK,UAAU,CAAC,CAAC,CAAC;YAChB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC;YACjF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IA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S;YACjB,CAAC,CAAC,KAAK,EAAE,CAAC;YACV,IAAI,EAAE,CAAC,IAAI;gBAAE,CAAC,CAAC,MAAM,EAAE,CAAC;;gBAAM,CAAC,CAAC,MAAM,EAAE,CAAC;YACzC,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC,SAAS,CAAC;YAC/B,CAAC,CAAC,YAAY,IAAI,EAAE,CAAC,OAAO,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,MAAM,OAAO,GAAsB,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACtE,GAAG,CAAC;QACJ,KAAK,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC3C,YAAY,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KACrE,CAAC,CAAC,CAAC;IAEJ,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prompt-diff/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Core engine for Prompt-Diff — providers, runDiff, runSuite, YAML eval config.",
|
|
5
|
+
"keywords": ["llm", "diff", "eval", "yaml", "anthropic", "openai"],
|
|
4
6
|
"repository": {
|
|
5
7
|
"type": "git",
|
|
6
8
|
"url": "https://github.com/darkrishabh/prompt-diff.git",
|
|
7
9
|
"directory": "packages/core"
|
|
8
10
|
},
|
|
11
|
+
"homepage": "https://github.com/darkrishabh/prompt-diff#readme",
|
|
9
12
|
"publishConfig": {
|
|
10
13
|
"access": "public"
|
|
11
14
|
},
|
|
12
15
|
"type": "module",
|
|
13
|
-
"files": ["dist"],
|
|
16
|
+
"files": ["dist", "README.md"],
|
|
14
17
|
"main": "./dist/index.js",
|
|
15
18
|
"types": "./dist/index.d.ts",
|
|
16
19
|
"exports": {
|