aiopt 0.2.6 → 0.2.8
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 +30 -3
- package/dist/cli.js +379 -79
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,14 @@ No server. No upload. No account. No payments inside the CLI.
|
|
|
15
15
|
```bash
|
|
16
16
|
npx aiopt install --force
|
|
17
17
|
# baseline: your existing usage log
|
|
18
|
-
npx aiopt guard --context-mult 1.2
|
|
18
|
+
npx aiopt guard --context-mult 1.2 --call-mult 3 --budget-monthly 200
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 1-minute demo
|
|
22
|
+
```bash
|
|
23
|
+
npx aiopt quickstart --demo
|
|
24
|
+
npx aiopt dashboard --port 3010
|
|
25
|
+
# open http://127.0.0.1:3010/
|
|
19
26
|
```
|
|
20
27
|
|
|
21
28
|
Exit codes:
|
|
@@ -23,15 +30,35 @@ Exit codes:
|
|
|
23
30
|
- `2` WARN (cost accident possible)
|
|
24
31
|
- `3` FAIL (merge-blocking)
|
|
25
32
|
|
|
26
|
-
Common knobs:
|
|
33
|
+
Common knobs (transform mode):
|
|
27
34
|
- `--context-mult <n>` (prompt/context grows)
|
|
28
35
|
- `--output-mult <n>` (output grows)
|
|
29
36
|
- `--retries-delta <n>` (more retries/attempts)
|
|
30
37
|
- `--call-mult <n>` (traffic spike / call volume)
|
|
31
38
|
|
|
39
|
+
Budget gate:
|
|
40
|
+
- `--budget-monthly <usd>` (FAIL if candidate monthly cost exceeds your budget)
|
|
41
|
+
|
|
42
|
+
Diff mode (real before/after logs):
|
|
43
|
+
```bash
|
|
44
|
+
npx aiopt guard --baseline ./usage-baseline.jsonl --candidate ./usage-candidate.jsonl
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Output includes a short **Top causes** summary (1–3) to explain the biggest drivers.
|
|
48
|
+
In diff mode, it also prints **token deltas** and **top cost deltas** by model + feature.
|
|
49
|
+
|
|
32
50
|
## CI integration (GitHub Actions)
|
|
33
51
|
You can run `aiopt guard` in CI to catch accidental cost blow-ups before merge.
|
|
34
52
|
|
|
53
|
+
### Diff mode (recommended)
|
|
54
|
+
Compare two real log sets (no guesswork):
|
|
55
|
+
```bash
|
|
56
|
+
npx aiopt guard --baseline ./baseline.jsonl --candidate ./candidate.jsonl
|
|
57
|
+
```
|
|
58
|
+
Diff mode also prints:
|
|
59
|
+
- token deltas (input/output)
|
|
60
|
+
- top deltas by model and by feature
|
|
61
|
+
|
|
35
62
|
### 1) Non-blocking (report only)
|
|
36
63
|
```yaml
|
|
37
64
|
- name: AI cost guard (non-blocking)
|
|
@@ -53,7 +80,7 @@ Tip: print guard output into the GitHub Actions **Step Summary** so you don’t
|
|
|
53
80
|
npx aiopt dashboard --port 3010
|
|
54
81
|
```
|
|
55
82
|
- Binds to **127.0.0.1** (local-only)
|
|
56
|
-
-
|
|
83
|
+
- Shows: guard verdict + guard history + 7-day cost trend (sparkline)
|
|
57
84
|
|
|
58
85
|
## Optional: deeper local analysis (`scan`)
|
|
59
86
|
`scan` generates a more detailed local report + patch stubs (still local-only).
|