Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/offer-fable-5-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@paddock/server": patch
---

Offer the three newest Claude models in the picker: **Fable 5.2** (`claude-fable-5-2`, $8/$40, 0.025× cache reads), **Sonnet 5.5** (`claude-sonnet-5-5`, $2/$10, 0.05× cache reads) and **Haiku 5.5** (`claude-haiku-5-5`, $0.10/$0.50). Each supersedes a model that stays in the catalog, so existing per-project pins keep resolving, and the default is unchanged (Opus 5.5).

Note that Haiku 5.5 is a **1M-context** model, unlike the 200K Haiku 4.5 it supersedes — the model-picker hint no longer says Haiku means 200K. Its cost estimate is pinned at the base (≤100k-prompt) tier: Haiku 5.5 is the one model priced by prompt length, and a chat's cumulative token totals can't distinguish the tiers, so a long Haiku 5.5 chat is under-estimated. Tracked separately.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ you visit, more a service your other tools talk to.
- 📱 **Works from your phone** — the same launchpad, fully responsive
- 🔀 **Chat ergonomics** — star to pin, mark unread, fork or rewind from any message, queue-while-streaming, stop, search, archive; spawned chats nest under the chat that created them
- 🎛️ **Settings, per project and per instance** — model, permission mode, curation budgets and more per project; an instance-wide **Config** screen edits `paddock.config.yaml` from the UI
- 🧠 **Claude Opus 5.5 by default** — with Opus 5, Opus 4.8, Fable 5.1, Fable 5, Sonnet 5 and Haiku 4.5 selectable, and an allow-list if you'd rather offer fewer
- 🧠 **Claude Opus 5.5 by default** — with Opus 5, Opus 4.8, Fable 5.2, Fable 5.1, Fable 5, Sonnet 5.5, Sonnet 5, Haiku 5.5 and Haiku 4.5 selectable, and an allow-list if you'd rather offer fewer
- 📈 **Token & cost tracking** — per-chat context meter and estimated API cost, live
- 🎙️ **Voice dictation & slash commands** — mic-to-text in the composer, `/`-autocomplete for skills
- 🔌 **Built on herdctl** — anything the fleet engine can do, Paddock can wire in
Expand Down
46 changes: 37 additions & 9 deletions packages/server/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
* constants — so changing the available models or a context limit is a one-file
* edit here.
*
* Context limits (verified against the Models API): Opus 5.5, Opus 5, Fable 5.1,
* Fable 5, Opus 4.8 and Sonnet 5 all have a 1,000,000-token context window;
* Haiku 4.5 is 200,000.
* Context limits (verified against the Models API): every catalog model has a
* 1,000,000-token context window EXCEPT Haiku 4.5, which is 200,000. Note that
* Haiku 5.5 — unlike the 4.5 it supersedes — is a 1M model.
* On the Max plan the keeper agents run Opus at its full 1M window, so the
* context meter must use 1M for it — otherwise a long chat reads >100%.
*/
Expand All @@ -32,12 +32,13 @@ export interface ModelPricing {
outputPer1M: number;
/**
* Cache-read price as a multiple of {@link inputPer1M}, when the model departs
* from the standard 0.1× ({@link CACHE_READ_MULTIPLIER}). Two models do:
* Fable 5.1 (and Mythos 5.1) read cached tokens at **0.025×** ($0.25/MTok
* against a $10 base), and Opus 5.5 at **0.05×** ($0.20/MTok against a $4
* base). Every other model is the standard tenth. Cache reads dominate a long
* chat's token counts, so getting this wrong overstates a Fable 5.1 chat's
* cost ~4× and an Opus 5.5 chat's ~2×.
* from the standard 0.1× ({@link CACHE_READ_MULTIPLIER}). Four models do:
* Fable 5.2 and Fable 5.1 (and their Mythos twins) read cached tokens at
* **0.025×** ($0.20/MTok against an $8 base, $0.25 against $10), and Opus 5.5
* and Sonnet 5.5 at **0.05×** ($0.20/MTok against a $4 base, $0.10 against
* $2). Every other model is the standard tenth. Cache reads dominate a long
* chat's token counts, so getting this wrong overstates a Fable chat's cost
* ~4× and an Opus 5.5 / Sonnet 5.5 chat's ~2×.
*/
cacheReadMultiplier?: number;
}
Expand Down Expand Up @@ -78,6 +79,12 @@ export const MODELS: ModelInfo[] = [
contextLimit: 1_000_000,
pricing: { inputPer1M: 5, outputPer1M: 25 },
},
{
id: "claude-fable-5-2",
label: "Fable 5.2",
contextLimit: 1_000_000,
pricing: { inputPer1M: 8, outputPer1M: 40, cacheReadMultiplier: 0.025 },
},
{
id: "claude-fable-5-1",
label: "Fable 5.1",
Expand All @@ -90,6 +97,12 @@ export const MODELS: ModelInfo[] = [
contextLimit: 1_000_000,
pricing: { inputPer1M: 10, outputPer1M: 50 },
},
{
id: "claude-sonnet-5-5",
label: "Sonnet 5.5",
contextLimit: 1_000_000,
pricing: { inputPer1M: 2, outputPer1M: 10, cacheReadMultiplier: 0.05 },
},
{
id: "claude-sonnet-5",
label: "Sonnet 5",
Expand All @@ -100,6 +113,21 @@ export const MODELS: ModelInfo[] = [
// happened, overstating every Sonnet 5 cost estimate by 50%.
pricing: { inputPer1M: 2, outputPer1M: 10 },
},
{
id: "claude-haiku-5-5",
label: "Haiku 5.5",
contextLimit: 1_000_000,
// ⚠️ Haiku 5.5 is the one model priced by PROMPT LENGTH, not by a flat rate:
// a request whose prompt (input + cache reads + cache writes) exceeds
// 100,000 tokens is billed at $0.50/$2.50 rather than the $0.10/$0.50 below,
// each request judged on its own. {@link estimateCostUsd} prices a chat's
// CUMULATIVE totals, which no longer carry per-request prompt lengths, so it
// cannot tell the tiers apart and always applies the cheaper one. A chat that
// runs long on Haiku 5.5 is therefore UNDER-estimated, by up to 5×. Priced at
// the base tier deliberately: it is exact for short chats (the common case for
// the cheap model) rather than wrong in both directions. Tracked in #1003.
pricing: { inputPer1M: 0.1, outputPer1M: 0.5 },
},
{
id: "claude-haiku-4-5-20251001",
label: "Haiku 4.5",
Expand Down
3 changes: 3 additions & 0 deletions packages/server/test/integration/routes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ describe("integration: REST route coverage (real app, fake claude)", () => {
expect(ids).toContain("claude-opus-5-5");
expect(ids).toContain("claude-opus-5");
expect(ids).toContain("claude-opus-4-8");
expect(ids).toContain("claude-fable-5-2");
expect(ids).toContain("claude-fable-5-1");
expect(ids).toContain("claude-fable-5");
expect(ids).toContain("claude-sonnet-5-5");
expect(ids).toContain("claude-sonnet-5");
expect(ids).toContain("claude-haiku-5-5");
// Every model carries a positive context limit (drives the meter).
for (const m of body.models) expect(m.contextLimit).toBeGreaterThan(0);
// The box-wide keeper drive-mode default (issue #122): the Settings tab reads
Expand Down
28 changes: 28 additions & 0 deletions packages/server/test/unit/models.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ describe("models", () => {
"claude-opus-5-5",
"claude-opus-5",
"claude-opus-4-8",
"claude-fable-5-2",
"claude-fable-5-1",
"claude-fable-5",
"claude-sonnet-5-5",
"claude-sonnet-5",
"claude-haiku-5-5",
"claude-haiku-4-5-20251001",
]);
expect(MODELS[0].id).toBe(DEFAULT_MODEL);
Expand All @@ -45,6 +48,9 @@ describe("models", () => {
expect(getContextLimit("claude-opus-5")).toBe(1_000_000);
expect(getContextLimit("claude-opus-4-8")).toBe(1_000_000);
expect(getContextLimit("claude-haiku-4-5-20251001")).toBe(200_000);
// Haiku 5.5 breaks the "Haiku means 200k" habit — it is a 1M model, and the
// picker hint in SettingsPane.tsx is worded to match.
expect(getContextLimit("claude-haiku-5-5")).toBe(1_000_000);
expect(getContextLimit("nope")).toBe(200_000);
});

Expand All @@ -61,13 +67,35 @@ describe("models", () => {
contextLimit: 1_000_000,
pricing: { inputPer1M: 10, outputPer1M: 50, cacheReadMultiplier: 0.025 },
});
// Fable 5.2 is 20% cheaper than 5.1 per token but keeps the 0.025× cache read.
expect(getModelInfo("claude-fable-5-2")).toEqual({
id: "claude-fable-5-2",
label: "Fable 5.2",
contextLimit: 1_000_000,
pricing: { inputPer1M: 8, outputPer1M: 40, cacheReadMultiplier: 0.025 },
});
// Opus 5.5 is the second model to depart from the standard 0.1× cache read.
expect(getModelInfo("claude-opus-5-5")).toEqual({
id: "claude-opus-5-5",
label: "Opus 5.5",
contextLimit: 1_000_000,
pricing: { inputPer1M: 4, outputPer1M: 20, cacheReadMultiplier: 0.05 },
});
expect(getModelInfo("claude-sonnet-5-5")).toEqual({
id: "claude-sonnet-5-5",
label: "Sonnet 5.5",
contextLimit: 1_000_000,
pricing: { inputPer1M: 2, outputPer1M: 10, cacheReadMultiplier: 0.05 },
});
// Haiku 5.5 is pinned at its BASE (≤100k prompt) tier. The over-100k tier
// ($0.50/$2.50) is deliberately not modelled — see the note in models.ts and
// issue #1003 — so this is the rate a long chat is under-estimated at.
expect(getModelInfo("claude-haiku-5-5")).toEqual({
id: "claude-haiku-5-5",
label: "Haiku 5.5",
contextLimit: 1_000_000,
pricing: { inputPer1M: 0.1, outputPer1M: 0.5 },
});
// Pinned because we shipped $3/$15 for a price rise that was cancelled; the
// standard price is $2/$10. Guards against re-importing the stale schedule.
expect(getModelInfo("claude-sonnet-5")).toEqual({
Expand Down
59 changes: 59 additions & 0 deletions packages/server/test/unit/usage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,65 @@ describe("estimateCostUsd (models)", () => {
).toBeCloseTo(1.0, 6);
});

it("prices Fable 5.2 at $8/$40 with the 0.025× cache read", () => {
// Fable 5.2: input $8/1M, output $40/1M — 20% under Fable 5.1 — with the
// same 0.025× cache read, so $0.20/1M rather than 5.1's $0.25.
const cost = estimateCostUsd("claude-fable-5-2", {
inputTokens: 1_000_000, // $8.00
outputTokens: 1_000_000, // $40.00
cacheCreationTokens: 1_000_000, // $10.00 (8 × 1.25)
cacheReadTokens: 1_000_000, // $0.20 (8 × 0.025), NOT $0.80
});
expect(cost).toBeCloseTo(58.2, 6);
});

it("prices Sonnet 5.5 at $2/$10 with the 0.05× cache read", () => {
// Sonnet 5.5 keeps Sonnet 5's $2/$10 but halves the cache read: 0.05×in =
// $0.10/1M, where Sonnet 5 pays the standard $0.20.
const cost = estimateCostUsd("claude-sonnet-5-5", {
inputTokens: 0,
outputTokens: 0,
cacheCreationTokens: 0,
cacheReadTokens: 1_000_000, // $0.10 (2 × 0.05), NOT $0.20
});
expect(cost).toBeCloseTo(0.1, 6);

// Control: Sonnet 5 has no override, so it stays on the standard tenth.
expect(
estimateCostUsd("claude-sonnet-5", {
inputTokens: 0,
outputTokens: 0,
cacheCreationTokens: 0,
cacheReadTokens: 1_000_000,
}),
).toBeCloseTo(0.2, 6);
});

it("prices Haiku 5.5 at its base tier, flat — the documented long-prompt gap", () => {
// Base (≤100k prompt) tier: input $0.10/1M, output $0.50/1M, cache write
// 1.25×in = $0.125, cache read the standard 0.1×in = $0.01.
const cost = estimateCostUsd("claude-haiku-5-5", {
inputTokens: 1_000_000, // $0.10
outputTokens: 1_000_000, // $0.50
cacheCreationTokens: 1_000_000, // $0.125
cacheReadTokens: 1_000_000, // $0.01
});
expect(cost).toBeCloseTo(0.735, 6);

// KNOWN LIMITATION (#1003), pinned so a change is deliberate: Haiku 5.5 bills
// a request whose prompt exceeds 100k tokens at $0.50/$2.50 instead, but
// cumulative totals carry no per-request prompt length, so the estimate stays
// on the cheap tier however large the chat gets — scaling here is linear, not
// tiered. A long Haiku 5.5 chat is under-estimated by up to 5×.
const big = estimateCostUsd("claude-haiku-5-5", {
inputTokens: 10_000_000,
outputTokens: 10_000_000,
cacheCreationTokens: 10_000_000,
cacheReadTokens: 10_000_000,
});
expect(big).toBeCloseTo(7.35, 6);
});

it("honours Opus 5.5's 0.05× cache-read multiplier", () => {
// Opus 5.5: input $4/1M, output $20/1M; cache-read is 0.05×in = $0.20/1M —
// half the standard 0.1× tenth. Second model to depart from the shared rate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ const CATALOG = [
"claude-opus-4-8",
"claude-fable-5-1",
"claude-fable-5",
"claude-sonnet-5-5",
"claude-sonnet-5",
"claude-haiku-5-5",
"claude-haiku-4-5-20251001",
];
const JOINED = CATALOG.join(", ");
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/components/SettingsPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ export function SettingsPane({
))}
</select>
</label>
<Hint>Larger context windows (Opus/Fable/Sonnet: 1M; Haiku: 200K) fit longer chats.</Hint>
<Hint>Larger context windows fit longer chats — every model here is 1M except Haiku 4.5 (200K).</Hint>
</div>
<div className="block">
<label className="block">
Expand Down
Loading