rightmodeler 0.2.1 → 0.4.0
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/dist-bundle/cli.js +18011 -12067
- package/dist-bundle/provenance.js +89 -0
- package/dist-bundle/proxy/container-supervisor.mjs +6 -0
- package/dist-bundle/proxy/proxy-runtime.mjs +120 -21
- package/dist-bundle/transport/stream.js +8 -2
- package/docs/commands.md +149 -22
- package/docs/evaluators.md +88 -9
- package/docs/exit-codes.md +47 -2
- package/docs/gateways.md +109 -0
- package/docs/getting-started.md +170 -6
- package/docs/github-actions.md +328 -0
- package/docs/github.md +110 -0
- package/docs/modeb.md +34 -0
- package/docs/model-routes.md +111 -0
- package/package.json +4 -1
package/docs/commands.md
CHANGED
|
@@ -38,8 +38,9 @@ Commands:
|
|
|
38
38
|
rollback [options] open a draft pull request restoring a prior model swap
|
|
39
39
|
drift [options] detect drift against the active replay corpus
|
|
40
40
|
watch [options] reconcile one open model-swap pull request
|
|
41
|
-
report
|
|
41
|
+
report [options] write report.md and report.json
|
|
42
42
|
status [options] summarize the current store
|
|
43
|
+
docs [name] print documentation packaged with this CLI
|
|
43
44
|
help [command] display help for command
|
|
44
45
|
```
|
|
45
46
|
|
|
@@ -51,7 +52,8 @@ Usage: rightmodeler init [options]
|
|
|
51
52
|
run the resumable Phase A pipeline
|
|
52
53
|
|
|
53
54
|
Options:
|
|
54
|
-
--traces <path> trace input file
|
|
55
|
+
--traces <path> trace input file or directory
|
|
56
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
55
57
|
--include-free include zero-priced models in candidate
|
|
56
58
|
shortlists
|
|
57
59
|
--modeb-config <path> versioned Mode B runtime configuration
|
|
@@ -59,9 +61,30 @@ Options:
|
|
|
59
61
|
--base-url <url> OpenAI-compatible provider base URL
|
|
60
62
|
--api-key-env <name> environment variable containing the
|
|
61
63
|
provider API key
|
|
64
|
+
--route <kind> where candidate replays run: api (the
|
|
65
|
+
--base-url endpoint), claude-login or
|
|
66
|
+
codex-login (the claude or codex CLI
|
|
67
|
+
signed in on this machine); a plan route
|
|
68
|
+
needs --judge-route (choices: "api",
|
|
69
|
+
"claude-login", "codex-login")
|
|
70
|
+
--judge-route <kind> where the built-in judge runs: api,
|
|
71
|
+
claude-login or codex-login; use a vendor
|
|
72
|
+
other than the candidates' (choices:
|
|
73
|
+
"api", "claude-login", "codex-login")
|
|
62
74
|
--max-cost-usd <amount> optional hard spend cap in USD; omit to
|
|
63
75
|
run uncapped so every case and judge cell
|
|
64
76
|
completes
|
|
77
|
+
--max-concurrency <n> maximum concurrent provider requests
|
|
78
|
+
--pricing-file <path> JSON map from model id to per-token input
|
|
79
|
+
and output USD, for catalogs without
|
|
80
|
+
pricing
|
|
81
|
+
--header <header> extra HTTP header for every provider
|
|
82
|
+
request, as 'name: value' (repeatable)
|
|
83
|
+
--catalog-reference <url-or-path> upstream /models URL or file that fills
|
|
84
|
+
pricing, context and capabilities the
|
|
85
|
+
provider catalog lacks
|
|
86
|
+
--policy <path> release policy JSON file: quality floor,
|
|
87
|
+
shortlist size, model allow and deny lists
|
|
65
88
|
--evaluator <provider> external evaluator provider (choices:
|
|
66
89
|
"braintrust", "langfuse", "langsmith",
|
|
67
90
|
"promptfoo")
|
|
@@ -84,8 +107,10 @@ Options:
|
|
|
84
107
|
"ingest", "reconcile", "scrub", "corpus",
|
|
85
108
|
"audit-sample", "shortlist", "replay",
|
|
86
109
|
"aggregate", "confirm", "report")
|
|
87
|
-
--
|
|
88
|
-
|
|
110
|
+
--code-graph <path> Graphify graph.json for static code
|
|
111
|
+
context in the report; never evidence
|
|
112
|
+
--yes accept the newest discovered trace and the
|
|
113
|
+
saved model route without prompting
|
|
89
114
|
-h, --help display help for command
|
|
90
115
|
```
|
|
91
116
|
|
|
@@ -97,7 +122,8 @@ Usage: rightmodeler estimate [options]
|
|
|
97
122
|
project replay spend before paid model calls
|
|
98
123
|
|
|
99
124
|
Options:
|
|
100
|
-
--traces <path> trace input file
|
|
125
|
+
--traces <path> trace input file or directory
|
|
126
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
101
127
|
--include-free include zero-priced models in candidate
|
|
102
128
|
shortlists
|
|
103
129
|
--modeb-config <path> versioned Mode B runtime configuration
|
|
@@ -105,9 +131,30 @@ Options:
|
|
|
105
131
|
--base-url <url> OpenAI-compatible provider base URL
|
|
106
132
|
--api-key-env <name> environment variable containing the
|
|
107
133
|
provider API key
|
|
134
|
+
--route <kind> where candidate replays run: api (the
|
|
135
|
+
--base-url endpoint), claude-login or
|
|
136
|
+
codex-login (the claude or codex CLI
|
|
137
|
+
signed in on this machine); a plan route
|
|
138
|
+
needs --judge-route (choices: "api",
|
|
139
|
+
"claude-login", "codex-login")
|
|
140
|
+
--judge-route <kind> where the built-in judge runs: api,
|
|
141
|
+
claude-login or codex-login; use a vendor
|
|
142
|
+
other than the candidates' (choices:
|
|
143
|
+
"api", "claude-login", "codex-login")
|
|
108
144
|
--max-cost-usd <amount> optional hard spend cap in USD; omit to
|
|
109
145
|
run uncapped so every case and judge cell
|
|
110
146
|
completes
|
|
147
|
+
--max-concurrency <n> maximum concurrent provider requests
|
|
148
|
+
--pricing-file <path> JSON map from model id to per-token input
|
|
149
|
+
and output USD, for catalogs without
|
|
150
|
+
pricing
|
|
151
|
+
--header <header> extra HTTP header for every provider
|
|
152
|
+
request, as 'name: value' (repeatable)
|
|
153
|
+
--catalog-reference <url-or-path> upstream /models URL or file that fills
|
|
154
|
+
pricing, context and capabilities the
|
|
155
|
+
provider catalog lacks
|
|
156
|
+
--policy <path> release policy JSON file: quality floor,
|
|
157
|
+
shortlist size, model allow and deny lists
|
|
111
158
|
--evaluator <provider> external evaluator provider (choices:
|
|
112
159
|
"braintrust", "langfuse", "langsmith",
|
|
113
160
|
"promptfoo")
|
|
@@ -125,8 +172,8 @@ Options:
|
|
|
125
172
|
--evaluator-gate-metric <name> scorer metric used for release gates
|
|
126
173
|
--evaluator-gate-threshold <value> fallback pass threshold when the evaluator
|
|
127
174
|
omits a pass decision
|
|
128
|
-
--yes accept the newest discovered trace
|
|
129
|
-
prompting
|
|
175
|
+
--yes accept the newest discovered trace and the
|
|
176
|
+
saved model route without prompting
|
|
130
177
|
--approved-run <digest> scope projection to one merged approved
|
|
131
178
|
swap
|
|
132
179
|
-h, --help display help for command
|
|
@@ -140,7 +187,8 @@ Usage: rightmodeler scan [options]
|
|
|
140
187
|
run through the scan stage
|
|
141
188
|
|
|
142
189
|
Options:
|
|
143
|
-
--traces <path> trace input file
|
|
190
|
+
--traces <path> trace input file or directory
|
|
191
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
144
192
|
--include-free include zero-priced models in candidate shortlists
|
|
145
193
|
--modeb-config <path> versioned Mode B runtime configuration JSON file
|
|
146
194
|
-h, --help display help for command
|
|
@@ -154,7 +202,8 @@ Usage: rightmodeler ingest [options]
|
|
|
154
202
|
run through the ingest stage
|
|
155
203
|
|
|
156
204
|
Options:
|
|
157
|
-
--traces <path> trace input file
|
|
205
|
+
--traces <path> trace input file or directory
|
|
206
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
158
207
|
--include-free include zero-priced models in candidate shortlists
|
|
159
208
|
--modeb-config <path> versioned Mode B runtime configuration JSON file
|
|
160
209
|
-h, --help display help for command
|
|
@@ -168,7 +217,8 @@ Usage: rightmodeler reconcile [options]
|
|
|
168
217
|
run through the reconcile stage
|
|
169
218
|
|
|
170
219
|
Options:
|
|
171
|
-
--traces <path> trace input file
|
|
220
|
+
--traces <path> trace input file or directory
|
|
221
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
172
222
|
--include-free include zero-priced models in candidate shortlists
|
|
173
223
|
--modeb-config <path> versioned Mode B runtime configuration JSON file
|
|
174
224
|
-h, --help display help for command
|
|
@@ -182,7 +232,8 @@ Usage: rightmodeler scrub [options]
|
|
|
182
232
|
run through the scrub stage
|
|
183
233
|
|
|
184
234
|
Options:
|
|
185
|
-
--traces <path> trace input file
|
|
235
|
+
--traces <path> trace input file or directory
|
|
236
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
186
237
|
--include-free include zero-priced models in candidate shortlists
|
|
187
238
|
--modeb-config <path> versioned Mode B runtime configuration JSON file
|
|
188
239
|
-h, --help display help for command
|
|
@@ -196,7 +247,8 @@ Usage: rightmodeler shortlist [options]
|
|
|
196
247
|
run through the shortlist stage
|
|
197
248
|
|
|
198
249
|
Options:
|
|
199
|
-
--traces <path> trace input file
|
|
250
|
+
--traces <path> trace input file or directory
|
|
251
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
200
252
|
--include-free include zero-priced models in candidate shortlists
|
|
201
253
|
--modeb-config <path> versioned Mode B runtime configuration JSON file
|
|
202
254
|
-h, --help display help for command
|
|
@@ -210,7 +262,8 @@ Usage: rightmodeler replay [options]
|
|
|
210
262
|
run through the replay stage
|
|
211
263
|
|
|
212
264
|
Options:
|
|
213
|
-
--traces <path> trace input file
|
|
265
|
+
--traces <path> trace input file or directory
|
|
266
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
214
267
|
--include-free include zero-priced models in candidate
|
|
215
268
|
shortlists
|
|
216
269
|
--modeb-config <path> versioned Mode B runtime configuration
|
|
@@ -218,9 +271,30 @@ Options:
|
|
|
218
271
|
--base-url <url> OpenAI-compatible provider base URL
|
|
219
272
|
--api-key-env <name> environment variable containing the
|
|
220
273
|
provider API key
|
|
274
|
+
--route <kind> where candidate replays run: api (the
|
|
275
|
+
--base-url endpoint), claude-login or
|
|
276
|
+
codex-login (the claude or codex CLI
|
|
277
|
+
signed in on this machine); a plan route
|
|
278
|
+
needs --judge-route (choices: "api",
|
|
279
|
+
"claude-login", "codex-login")
|
|
280
|
+
--judge-route <kind> where the built-in judge runs: api,
|
|
281
|
+
claude-login or codex-login; use a vendor
|
|
282
|
+
other than the candidates' (choices:
|
|
283
|
+
"api", "claude-login", "codex-login")
|
|
221
284
|
--max-cost-usd <amount> optional hard spend cap in USD; omit to
|
|
222
285
|
run uncapped so every case and judge cell
|
|
223
286
|
completes
|
|
287
|
+
--max-concurrency <n> maximum concurrent provider requests
|
|
288
|
+
--pricing-file <path> JSON map from model id to per-token input
|
|
289
|
+
and output USD, for catalogs without
|
|
290
|
+
pricing
|
|
291
|
+
--header <header> extra HTTP header for every provider
|
|
292
|
+
request, as 'name: value' (repeatable)
|
|
293
|
+
--catalog-reference <url-or-path> upstream /models URL or file that fills
|
|
294
|
+
pricing, context and capabilities the
|
|
295
|
+
provider catalog lacks
|
|
296
|
+
--policy <path> release policy JSON file: quality floor,
|
|
297
|
+
shortlist size, model allow and deny lists
|
|
224
298
|
--evaluator <provider> external evaluator provider (choices:
|
|
225
299
|
"braintrust", "langfuse", "langsmith",
|
|
226
300
|
"promptfoo")
|
|
@@ -252,7 +326,8 @@ Usage: rightmodeler aggregate [options]
|
|
|
252
326
|
run through the aggregate stage
|
|
253
327
|
|
|
254
328
|
Options:
|
|
255
|
-
--traces <path> trace input file
|
|
329
|
+
--traces <path> trace input file or directory
|
|
330
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
256
331
|
--include-free include zero-priced models in candidate shortlists
|
|
257
332
|
--modeb-config <path> versioned Mode B runtime configuration JSON file
|
|
258
333
|
-h, --help display help for command
|
|
@@ -266,7 +341,8 @@ Usage: rightmodeler confirm [options]
|
|
|
266
341
|
run through the confirm stage
|
|
267
342
|
|
|
268
343
|
Options:
|
|
269
|
-
--traces <path> trace input file
|
|
344
|
+
--traces <path> trace input file or directory
|
|
345
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
270
346
|
--include-free include zero-priced models in candidate
|
|
271
347
|
shortlists
|
|
272
348
|
--modeb-config <path> versioned Mode B runtime configuration
|
|
@@ -274,9 +350,30 @@ Options:
|
|
|
274
350
|
--base-url <url> OpenAI-compatible provider base URL
|
|
275
351
|
--api-key-env <name> environment variable containing the
|
|
276
352
|
provider API key
|
|
353
|
+
--route <kind> where candidate replays run: api (the
|
|
354
|
+
--base-url endpoint), claude-login or
|
|
355
|
+
codex-login (the claude or codex CLI
|
|
356
|
+
signed in on this machine); a plan route
|
|
357
|
+
needs --judge-route (choices: "api",
|
|
358
|
+
"claude-login", "codex-login")
|
|
359
|
+
--judge-route <kind> where the built-in judge runs: api,
|
|
360
|
+
claude-login or codex-login; use a vendor
|
|
361
|
+
other than the candidates' (choices:
|
|
362
|
+
"api", "claude-login", "codex-login")
|
|
277
363
|
--max-cost-usd <amount> optional hard spend cap in USD; omit to
|
|
278
364
|
run uncapped so every case and judge cell
|
|
279
365
|
completes
|
|
366
|
+
--max-concurrency <n> maximum concurrent provider requests
|
|
367
|
+
--pricing-file <path> JSON map from model id to per-token input
|
|
368
|
+
and output USD, for catalogs without
|
|
369
|
+
pricing
|
|
370
|
+
--header <header> extra HTTP header for every provider
|
|
371
|
+
request, as 'name: value' (repeatable)
|
|
372
|
+
--catalog-reference <url-or-path> upstream /models URL or file that fills
|
|
373
|
+
pricing, context and capabilities the
|
|
374
|
+
provider catalog lacks
|
|
375
|
+
--policy <path> release policy JSON file: quality floor,
|
|
376
|
+
shortlist size, model allow and deny lists
|
|
280
377
|
--evaluator <provider> external evaluator provider (choices:
|
|
281
378
|
"braintrust", "langfuse", "langsmith",
|
|
282
379
|
"promptfoo")
|
|
@@ -305,7 +402,8 @@ Usage: rightmodeler corpus [options] [command]
|
|
|
305
402
|
build or import the replay corpus
|
|
306
403
|
|
|
307
404
|
Options:
|
|
308
|
-
--traces <path> trace input file
|
|
405
|
+
--traces <path> trace input file or directory
|
|
406
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
309
407
|
--include-free include zero-priced models in candidate shortlists
|
|
310
408
|
--modeb-config <path> versioned Mode B runtime configuration JSON file
|
|
311
409
|
-h, --help display help for command
|
|
@@ -375,7 +473,8 @@ Usage: rightmodeler audit sample [options]
|
|
|
375
473
|
write the audit worksheet without blocking
|
|
376
474
|
|
|
377
475
|
Options:
|
|
378
|
-
--traces <path> trace input file
|
|
476
|
+
--traces <path> trace input file or directory
|
|
477
|
+
--matchers <path> declarative matcher definitions JSON file
|
|
379
478
|
--include-free include zero-priced models in candidate shortlists
|
|
380
479
|
--modeb-config <path> versioned Mode B runtime configuration JSON file
|
|
381
480
|
-h, --help display help for command
|
|
@@ -402,9 +501,14 @@ open a draft pull request for proven model swaps
|
|
|
402
501
|
|
|
403
502
|
Options:
|
|
404
503
|
--owner <owner> GitHub repository owner
|
|
405
|
-
--github-
|
|
504
|
+
--github-repo <repo> GitHub repository name (default: the repository
|
|
505
|
+
directory name)
|
|
506
|
+
--github-base-url <url> GitHub API base URL (default:
|
|
507
|
+
"https://api.github.com")
|
|
406
508
|
--github-token-env <name> environment variable containing the GitHub token
|
|
407
509
|
--dry-run run all machine gates without writing GitHub state
|
|
510
|
+
--code-graph <path> Graphify graph.json for static code context in the
|
|
511
|
+
pull request body; never evidence
|
|
408
512
|
-h, --help display help for command
|
|
409
513
|
```
|
|
410
514
|
|
|
@@ -417,8 +521,11 @@ open a draft pull request restoring a prior model swap
|
|
|
417
521
|
|
|
418
522
|
Options:
|
|
419
523
|
--owner <owner> GitHub repository owner
|
|
524
|
+
--github-repo <repo> GitHub repository name (default: the repository
|
|
525
|
+
directory name)
|
|
420
526
|
--pr <number> merged pull request number
|
|
421
|
-
--github-base-url <url> GitHub API base URL
|
|
527
|
+
--github-base-url <url> GitHub API base URL (default:
|
|
528
|
+
"https://api.github.com")
|
|
422
529
|
--github-token-env <name> environment variable containing the GitHub token
|
|
423
530
|
-h, --help display help for command
|
|
424
531
|
```
|
|
@@ -474,9 +581,11 @@ reconcile one open model-swap pull request
|
|
|
474
581
|
|
|
475
582
|
Options:
|
|
476
583
|
--owner <owner> GitHub repository owner
|
|
477
|
-
--github-repo <repo> GitHub repository name
|
|
584
|
+
--github-repo <repo> GitHub repository name (default: the repository
|
|
585
|
+
directory name)
|
|
478
586
|
--pr <number> pull request number
|
|
479
|
-
--github-base-url <url> GitHub API base URL
|
|
587
|
+
--github-base-url <url> GitHub API base URL (default:
|
|
588
|
+
"https://api.github.com")
|
|
480
589
|
--github-token-env <name> environment variable containing the GitHub token
|
|
481
590
|
-h, --help display help for command
|
|
482
591
|
```
|
|
@@ -489,7 +598,9 @@ Usage: rightmodeler report [options]
|
|
|
489
598
|
write report.md and report.json
|
|
490
599
|
|
|
491
600
|
Options:
|
|
492
|
-
-
|
|
601
|
+
--code-graph <path> Graphify graph.json for static code context in the
|
|
602
|
+
report; never evidence
|
|
603
|
+
-h, --help display help for command
|
|
493
604
|
```
|
|
494
605
|
|
|
495
606
|
## `rightmodeler status`
|
|
@@ -503,3 +614,19 @@ Options:
|
|
|
503
614
|
--run <runId> report one detached replay run
|
|
504
615
|
-h, --help display help for command
|
|
505
616
|
```
|
|
617
|
+
|
|
618
|
+
## `rightmodeler docs`
|
|
619
|
+
|
|
620
|
+
```text
|
|
621
|
+
Usage: rightmodeler docs [options] [name]
|
|
622
|
+
|
|
623
|
+
print documentation packaged with this CLI
|
|
624
|
+
|
|
625
|
+
Arguments:
|
|
626
|
+
name packaged document name (choices: "commands", "evaluators",
|
|
627
|
+
"exit-codes", "gateways", "getting-started", "github",
|
|
628
|
+
"github-actions", "modeb", "model-routes")
|
|
629
|
+
|
|
630
|
+
Options:
|
|
631
|
+
-h, --help display help for command
|
|
632
|
+
```
|
package/docs/evaluators.md
CHANGED
|
@@ -1,16 +1,95 @@
|
|
|
1
1
|
# Evaluators
|
|
2
2
|
|
|
3
|
-
The default evaluator is the built-in judge selected from the configured provider catalog. Candidate and reference families are excluded when choosing the judge.
|
|
3
|
+
The default evaluator is the built-in judge selected from the configured provider catalog. Candidate and reference families are excluded when choosing the judge. The exclusion applies per replayed call site: when the call sites of one traced family use models of different vendors (for example `openai/...` and `anthropic/...`), each call site's cases are judged by a model from neither the candidate's model family nor that call site's. Confirmation judges the recorded final output, so its judge also comes from outside the final step's model family. In replay, when the recorded answer is one assistant message of text, the judge compares the candidate's answer with that text; any other recorded answer, such as one that calls tools, has parts other than text or holds several messages, is shown to the judge as recorded.
|
|
4
4
|
|
|
5
|
-
An external evaluator
|
|
5
|
+
An external evaluator is requested with `--evaluator <provider>` on `init`, `estimate`, `replay`, and `confirm`, where the provider is `braintrust`, `langfuse`, `langsmith`, or `promptfoo`. Every other `--evaluator-*` option is a usage error without `--evaluator`.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- one or more `--evaluator-scorer <name>` options (required)
|
|
9
|
-
- `--evaluator-api-key-env <name>` (defaults to `BRAINTRUST_API_KEY`)
|
|
10
|
-
- `--evaluator-base-url <url>` (defaults to the provider API)
|
|
11
|
-
- `--evaluator-gate-metric <name>` when more than one scorer is configured
|
|
12
|
-
- `--evaluator-gate-threshold <value>` when the evaluator does not return a pass decision
|
|
7
|
+
## Options shared by every provider
|
|
13
8
|
|
|
14
|
-
|
|
9
|
+
- `--evaluator-scorer <name>` (required, repeatable): the scorer names the provider must return for every case.
|
|
10
|
+
- `--evaluator-gate-metric <name>`: the scorer used for release gates. Required when more than one scorer is configured; with a single scorer it defaults to that scorer. It must name a configured scorer.
|
|
11
|
+
- `--evaluator-gate-threshold <value>`: pass threshold applied only when the evaluator omits a pass decision for a metric.
|
|
12
|
+
|
|
13
|
+
## Provider options
|
|
14
|
+
|
|
15
|
+
One table per provider. A rejected option is a usage error with that provider (exit code 2, `invalid_option`).
|
|
16
|
+
|
|
17
|
+
### braintrust
|
|
18
|
+
|
|
19
|
+
`--evaluator-project-id` names the Braintrust project that receives the experiment.
|
|
20
|
+
|
|
21
|
+
| Option | Requirement | Default |
|
|
22
|
+
| ----------------------------------- | ----------- | ---------------------------- |
|
|
23
|
+
| `--evaluator-project-id <id>` | required | |
|
|
24
|
+
| `--evaluator-api-key-env <name>` | optional | `BRAINTRUST_API_KEY` |
|
|
25
|
+
| `--evaluator-base-url <url>` | optional | `https://api.braintrust.dev` |
|
|
26
|
+
| `--evaluator-public-key-env <name>` | rejected | |
|
|
27
|
+
| `--evaluator-command <path>` | rejected | |
|
|
28
|
+
| `--evaluator-config <path>` | rejected | |
|
|
29
|
+
|
|
30
|
+
### langfuse
|
|
31
|
+
|
|
32
|
+
Langfuse authenticates with a public key and a secret key read from environment variables. The keys select the project, so there is no project option.
|
|
33
|
+
|
|
34
|
+
| Option | Requirement | Default |
|
|
35
|
+
| ----------------------------------- | ----------- | ---------------------------- |
|
|
36
|
+
| `--evaluator-api-key-env <name>` | optional | `LANGFUSE_SECRET_KEY` |
|
|
37
|
+
| `--evaluator-public-key-env <name>` | optional | `LANGFUSE_PUBLIC_KEY` |
|
|
38
|
+
| `--evaluator-base-url <url>` | optional | `https://cloud.langfuse.com` |
|
|
39
|
+
| `--evaluator-project-id <id>` | rejected | |
|
|
40
|
+
| `--evaluator-command <path>` | rejected | |
|
|
41
|
+
| `--evaluator-config <path>` | rejected | |
|
|
42
|
+
|
|
43
|
+
### langsmith
|
|
44
|
+
|
|
45
|
+
`--evaluator-project-id` names the LangSmith dataset the experiment references. A scorer may be written `metric=rule-id` to bind a metric name to an evaluator rule; a bare name is used for both.
|
|
46
|
+
|
|
47
|
+
| Option | Requirement | Default |
|
|
48
|
+
| ----------------------------------- | ----------- | --------------------------------- |
|
|
49
|
+
| `--evaluator-project-id <id>` | required | |
|
|
50
|
+
| `--evaluator-api-key-env <name>` | optional | `LANGSMITH_API_KEY` |
|
|
51
|
+
| `--evaluator-base-url <url>` | optional | `https://api.smith.langchain.com` |
|
|
52
|
+
| `--evaluator-public-key-env <name>` | rejected | |
|
|
53
|
+
| `--evaluator-command <path>` | rejected | |
|
|
54
|
+
| `--evaluator-config <path>` | rejected | |
|
|
55
|
+
|
|
56
|
+
### promptfoo
|
|
57
|
+
|
|
58
|
+
promptfoo runs locally. `--evaluator-config` is the assertions file passed to `promptfoo eval --assertions`; `--evaluator-command` is the executable, one path or one command on `PATH` (so not `npx promptfoo`: install it with `npm install -g promptfoo@0.123.1` or pass the path to its binary). No API or project option applies.
|
|
59
|
+
|
|
60
|
+
| Option | Requirement | Default |
|
|
61
|
+
| ----------------------------------- | ----------- | ----------- |
|
|
62
|
+
| `--evaluator-config <path>` | required | |
|
|
63
|
+
| `--evaluator-command <path>` | optional | `promptfoo` |
|
|
64
|
+
| `--evaluator-base-url <url>` | rejected | |
|
|
65
|
+
| `--evaluator-api-key-env <name>` | rejected | |
|
|
66
|
+
| `--evaluator-project-id <id>` | rejected | |
|
|
67
|
+
| `--evaluator-public-key-env <name>` | rejected | |
|
|
68
|
+
|
|
69
|
+
rightmodeler is verified against promptfoo 0.123.1. Other releases work as long as they write the same results layout; one that does not stops the run with an error naming its version and the layout rightmodeler reads. A missing executable counts as unreachable (see below); any other promptfoo failure, such as a broken `promptfooconfig.*` next to the assertions file, stops the run with promptfoo's own message.
|
|
70
|
+
|
|
71
|
+
Each evaluation runs one command in the assertions file's directory, with standard input closed:
|
|
72
|
+
|
|
73
|
+
`<command> eval --assertions <assertions file> --model-outputs <model outputs file, relative to that directory> --output <temporary results file> --no-write --no-share --no-table --no-progress-bar`
|
|
74
|
+
|
|
75
|
+
The command gets your environment plus `PROMPTFOO_DISABLE_UPDATE=true`, `PROMPTFOO_DISABLE_VAR_EXPANSION=true`, `PROMPTFOO_FAILED_TEST_EXIT_CODE=100`, `PROMPTFOO_SHORT_CIRCUIT_TEST_FAILURES=false`, `PROMPTFOO_STRIP_GRADING_RESULT=false`, `PROMPTFOO_STRIP_RESPONSE_OUTPUT=false`, and `PROMPTFOO_STRIP_TEST_VARS=false`. So every output is graded exactly once against every assertion, the batch is neither saved to promptfoo's history nor shared, promptfoo skips its startup update check, and your own promptfoo settings cannot change the exit code, turn a failed assertion into an error, or strip the fields rightmodeler reads. Everything else, including your promptfoo login, cache, telemetry setting, and model-graded assertion providers, works as when you run promptfoo yourself. promptfoo receives each candidate output and its execution id only; the input, messages, and reference answer are never sent.
|
|
76
|
+
|
|
77
|
+
Put `metric: <name>` on every assertion that feeds an `--evaluator-scorer`. A metric's score is promptfoo's named score for it, and it passes only when every assertion carrying it passes. promptfoo always decides pass or fail, so `--evaluator-gate-threshold` never applies. Each assessment's rubric version is `promptfoo@<version>/<metric>/<digest>`, where the digest is the first 16 hex characters of the canonical SHA-256 of the assertions carrying that metric, so editing one of them, or upgrading promptfoo, changes it. A scorer that no assertion carries stops the run with an error naming it.
|
|
78
|
+
|
|
79
|
+
Before grading, promptfoo renders `{{ }}` templates in an output, reads a `file://` path or loads a `package:` module it names, and strips one trailing newline. rightmodeler compares the output promptfoo graded with the output it sent. A case whose graded output differs beyond that one newline is recorded absent as `external_output_mismatch`, because the grade is not of the candidate's output; a case promptfoo could not grade at all, such as a `file://` path that does not exist, is recorded absent as `external_evaluator_error`, and the other cases in its batch keep their grades. Neither counts as evidence. Nor does a metric whose grader failed, which promptfoo marks `graderError` (for example when a model-graded assertion's grading call fails): it is left out rather than recorded as a failure, and a case that loses its gate metric this way is recorded absent as `external_evaluator_error`. Replayed outputs are kept in the store, so a rerun after fixing promptfoo does not repeat model calls.
|
|
80
|
+
|
|
81
|
+
promptfoo also loads a `promptfooconfig.*` and a `.env` file from the directory it runs in, so any next to the assertions file apply: a `defaultTest` there adds its assertions to every case, a `defaultTest` transform makes every case `external_output_mismatch`, and its `env` block can override the settings above. Every grade, and a detached replay's identity (`replay --detach`), covers the assertions file and every `promptfooconfig.*` next to it (see [Changing an evaluator](#changing-an-evaluator)); a `.env` there is not covered. Keep the assertions file in a directory of its own unless you want those files to apply.
|
|
82
|
+
|
|
83
|
+
## Changing an evaluator
|
|
84
|
+
|
|
85
|
+
Every grade records the evaluator configuration it was made under: the provider, every evaluator option as given, and for promptfoo the bytes of the assertions file and of every `promptfooconfig.*` beside it. When that configuration changes, the next `init` or `replay` re-grades every stored candidate output that was graded under another configuration. The outputs are reused rather than replayed, so no candidate model is called again, and an `evaluator_regrade` warning counts the outputs being re-graded and says why. The earlier grades stay in the store, but no verdict or report uses them, and `export` leaves them out. A replay run after upgrading from a version that did not record the configuration re-grades once for the same reason.
|
|
86
|
+
|
|
87
|
+
`--evaluator-scorer`, `--evaluator-gate-metric` and `--evaluator-gate-threshold` are different: they define the question the evidence answers, so changing one replays the candidates again. Whenever replay runs, a model the provider catalog now selects that was never replayed is replayed like any new candidate, within `--max-cost-usd`.
|
|
88
|
+
|
|
89
|
+
rightmodeler cannot see a change it is not given: a scorer edited inside Braintrust, an evaluator edited inside Langfuse, a LangSmith rule edited in place, a file an assertion loads with `file://`, a `.env` beside the assertions file, or a promptfoo upgrade behind the same `--evaluator-command`. To re-grade after one of these, edit the assertions file, or bind the LangSmith metric to the new rule's id (`metric=rule-id`). For Braintrust and Langfuse, the grades already held stay in use until an evaluator option changes.
|
|
90
|
+
|
|
91
|
+
## Reachability, polling, and absences
|
|
92
|
+
|
|
93
|
+
If the external evaluator is unreachable, the pipeline warns and uses the built-in judge. Hosted scorers run asynchronously, so after launching a run the pipeline polls for up to 5 minutes, starting 250 ms after launch and doubling the wait between polls up to 10 seconds. If a reachable run fails, is still pending when the budget ends, or omits required case results, the pipeline records the missing assessments instead of fabricating scores.
|
|
15
94
|
|
|
16
95
|
See [Commands](commands.md) for the complete option text and [Getting started](getting-started.md) for provider setup.
|
package/docs/exit-codes.md
CHANGED
|
@@ -6,7 +6,7 @@ Rightmodeler reserves exit codes `0` through `3` for machine-readable outcomes.
|
|
|
6
6
|
|
|
7
7
|
- `0`: the command completed and no recommendation is being reported. Planning and partial `--through` runs also return `0` when successful.
|
|
8
8
|
- `1`: a complete `init` or `report` found an actionable recommendation.
|
|
9
|
-
- `2`: the run needs input at a resumable boundary, such as missing traces, a cancelled trace prompt, provider configuration,
|
|
9
|
+
- `2`: the run needs input at a resumable boundary, such as missing traces, a cancelled trace prompt, provider configuration, required confirmation configuration, or a plan's usage limit (rerun after it resets).
|
|
10
10
|
- `3`: the cost budget was reached at a resumable boundary.
|
|
11
11
|
- `10` or greater: command-line or runtime failure.
|
|
12
12
|
|
|
@@ -14,13 +14,58 @@ Rightmodeler reserves exit codes `0` through `3` for machine-readable outcomes.
|
|
|
14
14
|
|
|
15
15
|
- `0`: changes were applied, or a dry run was clean.
|
|
16
16
|
- `1`: the change was refused by a machine gate.
|
|
17
|
+
- `2`: no completed run in the store (for example `stage_not_completed`); the JSON error on standard error names the remedy.
|
|
18
|
+
- `10` or greater: runtime failure.
|
|
19
|
+
|
|
20
|
+
See [GitHub](github.md) for tokens, reviewers and refusal codes.
|
|
21
|
+
|
|
22
|
+
## Rollback
|
|
23
|
+
|
|
24
|
+
- `0`: the rollback pull request was opened, or already exists.
|
|
25
|
+
- `1`: the rollback was refused by a machine gate.
|
|
26
|
+
- `10` or greater: runtime failure.
|
|
27
|
+
|
|
28
|
+
## Drift
|
|
29
|
+
|
|
30
|
+
- `0`: the drift check completed.
|
|
31
|
+
- `2`: `--traces` is missing.
|
|
17
32
|
- `10` or greater: runtime failure.
|
|
18
33
|
|
|
19
34
|
## Watch
|
|
20
35
|
|
|
21
36
|
- `0`: no action was required.
|
|
22
37
|
- `1`: review or continuous-integration actions were taken.
|
|
23
|
-
- `2`: another watcher holds the lock.
|
|
38
|
+
- `2`: another watcher holds the lock, or the store has no completed run. A held lock prints a result with `"status":"lock_held"` on standard output; a missing run prints an error such as `stage_not_completed` on standard error and nothing on standard output.
|
|
24
39
|
- `10` or greater: runtime failure.
|
|
25
40
|
|
|
26
41
|
Use `--output json` for one result object or `--output jsonl` for stage events followed by the result. Errors use the selected machine-readable mode on standard error. See [Commands](commands.md) for command-specific options.
|
|
42
|
+
|
|
43
|
+
## Error codes
|
|
44
|
+
|
|
45
|
+
- `active_corpus_usage_unavailable` (exit `2`): publish a corpus version built from traces that include token usage, then rerun.
|
|
46
|
+
- `ambiguous_trace_format` (exit `2`): pass a trace file that unambiguously matches one supported format.
|
|
47
|
+
- `budget_cap_refusal` (exit `3`): the run reached the cost boundary; raise `--max-cost-usd` to the cap named in the remedy and rerun.
|
|
48
|
+
- `coverage_gate_failed` (exit `2`): add matcher coverage for the listed AI dependency surfaces, or pass `--matchers <file>` with declarative matchers that close them.
|
|
49
|
+
- `empty_traces_directory` (exit `2`): point `--traces` at a directory containing `.json` or `.jsonl` trace files, or at a single trace file.
|
|
50
|
+
- `git_repository_has_no_commits` (exit `2`): create the first commit, then rerun the command.
|
|
51
|
+
- `invalid_catalog_reference` (exit `2`): pass `--catalog-reference` an http(s) URL or a readable file that returns an OpenAI-compatible `/models` document, or remove it, then rerun.
|
|
52
|
+
- `invalid_matchers_file` (exit `2`): fix the listed matcher definitions in the `--matchers` file and rerun.
|
|
53
|
+
- `invalid_modeb_config` (exit `2`): fix the named field in the `--modeb-config` file and rerun.
|
|
54
|
+
- `invalid_option` (exit `2`): correct the option and rerun; use `rightmodeler <command> --help` for accepted values.
|
|
55
|
+
- `invalid_policy_file` (exit `2`): fix the named field in the `--policy` file and rerun; `qualityFloor` must be greater than 0.8 and less than 1, `shortlistTop` a positive integer, `allowModels` and `denyModels` arrays of model ids.
|
|
56
|
+
- `invalid_pricing_file` (exit `2`): fix `--pricing-file` to map each model id to non-negative `input` and `output` USD per token and, optionally, a positive integer `maxOutputTokens`, then rerun.
|
|
57
|
+
- `judge_family_unknown` (exit `2`): the catalog's model ids name no vendor, so the built-in judge could share a vendor with the candidate or the recorded model; use a gateway whose ids carry their vendor (`vendor/model`), or grade with `--evaluator`.
|
|
58
|
+
- `missing_provider_configuration` (exit `2`): pass `--base-url <url>` and, if needed, `--api-key-env <environment-variable-name>` naming a populated variable.
|
|
59
|
+
- `missing_traces_path` (exit `2`): pass `--traces <path>` pointing to an existing trace file or directory.
|
|
60
|
+
- `mixed_trace_formats` (exit `2`): split the directory so every file uses the same trace format, or pass one file with `--traces`.
|
|
61
|
+
- `modeb_cloud_unavailable` (exit `2`): install the optional sandbox SDK and set its credentials, or set `"backend": "docker"` in the `--modeb-config` file, then rerun.
|
|
62
|
+
- `no_neutral_judge` (exit `2`): the catalog has no priced model from a vendor other than both the candidate's and the recorded model's, which the built-in judge needs; list or price one (a multi-vendor gateway, `--catalog-reference` or `--pricing-file`), run the judge through another vendor's CLI with `--judge-route`, or grade with `--evaluator`.
|
|
63
|
+
- `no_priced_candidates` (exit `2`): point `--base-url` at a catalog that publishes per-token pricing, pass `--catalog-reference <url>`, expose priced LiteLLM `GET /model/info`, or pass `--pricing-file <path>`, then rerun.
|
|
64
|
+
- `no_replayable_call_sites` (exit `2`): point `--repo` at a service with plain text completions, or add a matcher for a text call site, then rerun.
|
|
65
|
+
- `not_git_repository` (exit `2`): run the command again from a Git repository with at least one commit.
|
|
66
|
+
- `plan_cli_unavailable` (exit `2`): the CLI a plan route runs is missing, older than the verified version, or changed an output shape, or `CI` is set; install or update it (`claude update`, or `npm install -g @openai/codex@latest` for `codex`), unset `CI` on your own machine, or use an API route with `--base-url`.
|
|
67
|
+
- `plan_login_required` (exit `2`): sign the CLI in to your plan (`claude auth login`, or `codex login` with ChatGPT) and remove any API key setting it would use, or use an API route with `--base-url`; finished calls are kept.
|
|
68
|
+
- `plan_usage_limit` (exit `2`): a plan you are signed in to reached its usage limit; rerun the same command after the reset time in the message, and completed replay and judge calls are kept and not repeated; or choose a route that does not use this plan with `--route` or `--judge-route`.
|
|
69
|
+
- `stage_not_completed` (exit `2`): run `rightmodeler init --through <stage>` first, then rerun the command.
|
|
70
|
+
- `unusable_trace_input` (exit `2`): the selected discovered trace could not be adapted; rerun and choose a different trace file.
|
|
71
|
+
- `usage_error` (exit `10`): the command line is invalid; `message` carries the parser text.
|