@askalf/dario 6.19.2 → 6.20.1

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/docs/keys.md CHANGED
@@ -34,12 +34,45 @@ on its next request, no restart.
34
34
  | `--expires=30d` | Refused after this, like a revoked key. `12h`, `2w`, or an ISO date. |
35
35
  | `--budget=$5/day` | A daily cap on the API-equivalent price of the key's traffic. See **Budgets**. |
36
36
  | `--budget-tokens=2M/day` | A daily cap on tokens, every bucket counted. See **Budgets**. |
37
+ | `--effort=low` | The effort this key's requests run at when they name none themselves (no model-name suffix, no effort field). `low`, `medium`, `high`, `xhigh` or `max`. See **Default effort**. |
37
38
 
38
39
  `dario keys revoke <name>` refuses a key from now on and keeps it in the list;
39
40
  `dario keys rotate <name>` prints a new secret under the same name, seat,
40
41
  models and expiry, and the old secret stops at once; `dario keys remove
41
42
  <name>` forgets it.
42
43
 
44
+ ## Default effort
45
+
46
+ `dario keys create alice --effort=low`, or `dario keys effort alice low` on an
47
+ existing key (`--clear` to remove it), sets the effort the key's requests run
48
+ at when they name none themselves. Resolution per request, first match wins:
49
+
50
+ 1. an effort suffix on the model name (`claude-opus-5-5:low`);
51
+ 2. the proxy's `--effort` / `DARIO_EFFORT` pin, when set to a level (`client`
52
+ is not a level: under it the key's default still fills in);
53
+ 3. the client's own effort field (`output_config.effort`, `reasoning_effort`, `reasoning.effort`);
54
+ 4. the key's default;
55
+ 5. `high`, the proxy's long-standing fallback.
56
+
57
+ So a key default never overrules a client that chose, and the operator's pin
58
+ still overrules everything, as it always has. On the Claude path the level
59
+ goes out as `output_config.effort`.
60
+
61
+ On the Codex path it goes out as `reasoning.effort`, on both routes: the
62
+ Messages-shape request dario translates, and the Responses body Codex CLI
63
+ sends, which dario otherwise forwards as written (the level is added to its
64
+ `reasoning` object; `summary` and the rest stay). Two differences there. The
65
+ proxy pin has never reached the Codex backend, so it is not in the order. And
66
+ a Messages-shape client's `thinking.budget_tokens` is that client's choice on
67
+ Codex (it becomes `reasoning.effort`), so it outranks the key's default the
68
+ way the client's own field does. With none of those, the backend's own
69
+ default applies, not `high`.
70
+ Why the knob is per key: a reasoning model at its default effort can spend
71
+ most of its output thinking on work that did not need it (the `Thinking:` line
72
+ in `dario usage` shows the share per key), and the lane that needs the cap is
73
+ usually one consumer, not the whole proxy. `dario keys list` shows an EFFORT
74
+ column; `GET /admin/keys` and `dario keys --json` carry `effort`.
75
+
43
76
  ## Budgets
44
77
 
45
78
  `dario keys create alice --budget=$5/day --budget-tokens=2M/day` — or
@@ -91,7 +124,9 @@ fields (an empty body clears), audited as `key_budget`.
91
124
  to the key; the header cannot overrule a credential.
92
125
  - **`dario usage --by-key`** — the lifetime API-equivalent number split per
93
126
  consumer: named keys, header names, and the `u_…` hash of a client's user
94
- id, whichever named the request.
127
+ id, whichever named the request. The tokens line under each key includes
128
+ its thinking share: how many of the key's output tokens were the model's
129
+ reasoning, and what they cost at the output rate.
95
130
  - **The log file** — `consumer` on every request line; `reject: "key-model"`
96
131
  on a model refusal; `event: "admin.key_create|key_rotate|key_revoke"` with
97
132
  `key: <name>` when the admin API changed something.
@@ -69,8 +69,11 @@ The rolling window forgets on every restart; the **ledger** does not. Since 6.6
69
69
  Claude $388 1,204 reqs (Opus 5 $301 · Sonnet 5 $86.68)
70
70
  ChatGPT $24.75 311 reqs (gpt-5.6-terra $24.75)
71
71
  Today $48.20 · Last 7d $413 · Last 30d $413
72
+ Thinking: 2.1M of 3.4M output tokens (62%) · $156 of the number above
72
73
  ```
73
74
 
75
+ The `Thinking:` line is the share of output tokens that were the model's reasoning, read from the usage block upstream returns (Claude's `output_tokens_details.thinking_tokens`, and on the ChatGPT-subscription engine `output_tokens_details.reasoning_tokens`, both counted inside output), and what that reasoning would have cost at each model's output rate. It is the first number to look at when a bill surprises you: a reasoning model at its default effort can spend most of its output thinking on work that did not need it, and `output_config.effort` (or a `:low` model-name suffix, see [configuration](configuration.md#per-request-effort-by-model-name)) is a cheaper fix than a smaller model. `dario usage --by-key` shows the share per key, so the lane that is thinking the most is one line away.
76
+
74
77
  Only served requests count. Traffic that was metered anyway — an API key upstream, or Anthropic's paid `extra_usage` overage — is kept in its own column and reported as spent, not saved. `dario usage --card` writes the headline as a 640×320 SVG you can drop in a README or a post, and `--donut` writes the same number as three rings — by model, by key, subscription vs metered; `--no-ledger` / `DARIO_LEDGER=0` turns the file off, `DARIO_LEDGER_PATH` moves it, and `GET /analytics/ledger` is the per-day table behind the number. Details: [api-equivalent-spend.md](api-equivalent-spend.md).
75
78
 
76
79
  A request served on a Max plan's API credits (the `credits:<model>` rung of the failover chain, key in `DARIO_CREDITS_API_KEY`, [failover](two-plans.md#failover-between-subscriptions)) is counted as spent the same way in the ledger; `/analytics`, `/metrics` and the dashboard show it under its own bucket, `credits`.
@@ -13,6 +13,8 @@ The empirical basis for this feature lives in [`docs/research/system-prompt-clas
13
13
  | `aggressive` | Partial + remove the prompt-level RLHF restatements (`IMPORTANT: Assist with authorized security testing…`, `IMPORTANT: You must NEVER generate or guess URLs…`) and the `# Executing actions with care` section. | <3% above partial |
14
14
  | `<file path>` | Replace the slot entirely with the contents of a file you control. The escape hatch for users running well-defined agent workflows with their own system prompt. | depends on your prompt |
15
15
 
16
+ What `partial` finds to strip depends on the prompt Claude Code sends for the model. The Sonnet 5 prompt has the `# Tone and style` and `# Text output` sections and the Doing-tasks bullets. The Fable prompt has a one-line rule about code comments, which `partial` swaps for a "be thorough" instruction. The base prompt (Claude Code 2.1.316) and the Opus 5 prompt carry none of these, so `partial` sends them unchanged and only `aggressive` changes them.
17
+
16
18
  ## Aggressive vs partial — what's the actual difference?
17
19
 
18
20
  Aggressive is provided for completeness, not because it does meaningful work. The added removals are *prompt-level restatements* of refusal categories — reminders the prompt makes about RLHF behavior that's already trained into the model's weights. Removing the reminder doesn't remove the trained behavior. We measured this: 9 trials (3 prompts × 3 strip levels), aggressive vs partial added <3% practical change on benign tasks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askalf/dario",
3
- "version": "6.19.2",
3
+ "version": "6.20.1",
4
4
  "description": "Use your Claude and ChatGPT subscriptions in Cursor, Cline, Aider, Claude Code and the Agent SDK at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint: either plan answers either wire shape, opt-in failover when one hits its limit, and a ledger of what each plan absorbed.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -91,7 +91,7 @@
91
91
  "node": ">=18.0.0"
92
92
  },
93
93
  "devDependencies": {
94
- "@types/node": "^26.6.5",
94
+ "@types/node": "^26.6.6",
95
95
  "tsx": "^4.23.15",
96
96
  "typescript": "^5.7.0"
97
97
  }