Re-plan cost when re-plans are hours apart #184

Open
opened 2026-11-08 18:18:43 +00:00 by chris-kreidl · 2 comments
chris-kreidl commented 2026-11-08 18:18:43 +00:00 (Migrated from github.com)

Re-plan cost when re-plans are hours apart (session 14): the 18.4k-token prefix is written to the cache on most real re-plans (5-minute TTL), about US$0.046 of a US$0.06 call on Sonnet; a cache hit costs US$0.02–0.03. Options: no cache breakpoint for re-plans (saves the 25% write premium, loses it for repairs), a smaller library block for re-plans (they rarely need every workout), or the 1-hour TTL if re-plans cluster. Whole-plan schedule changes (8k output, 40–50 s, US$0.10–0.15) stay over both targets; the slug-reference lever in the generation follow-up would cut them too. (parked 2026-10-23: fine for one athlete who rarely regenerates whole plans)

Moved from docs/history.md → Parked follow-ups on 2026-11-08.

**Re-plan cost when re-plans are hours apart** (session 14): the 18.4k-token prefix is written to the cache on most real re-plans (5-minute TTL), about US$0.046 of a US$0.06 call on Sonnet; a cache hit costs US$0.02–0.03. Options: no cache breakpoint for re-plans (saves the 25% write premium, loses it for repairs), a smaller library block for re-plans (they rarely need every workout), or the 1-hour TTL if re-plans cluster. Whole-plan schedule changes (8k output, 40–50 s, US$0.10–0.15) stay over both targets; the slug-reference lever in the generation follow-up would cut them too. (parked 2026-10-23: fine for one athlete who rarely regenerates whole plans) _Moved from docs/history.md → Parked follow-ups on 2026-11-08._
chris-kreidl commented 2026-11-08 20:19:47 +00:00 (Migrated from github.com)

What this is about. Each re-plan sends a long fixed prefix (rules, workout library, about 18k tokens) that's cached for 5 minutes. Re-plans are usually hours apart, so the cache expires and almost every re-plan pays to write it again: about US$0.046 of a US$0.06 call. A cache hit would cost US$0.02–0.03.

Options:

  1. No cache for re-plans.
  2. A smaller library block for re-plans.
  3. The 1-hour cache TTL.

Big schedule changes (US$0.10–0.15, 40–50 s) are over target either way.

Status (checked 2026-11-08): unchanged; parked on 2026-10-23. Session 51 (#226) holds re-plans until End chat or a nightly run, which changes how they cluster. Re-check the numbers after it.

**What this is about.** Each re-plan sends a long fixed prefix (rules, workout library, about 18k tokens) that's cached for 5 minutes. Re-plans are usually hours apart, so the cache expires and almost every re-plan pays to write it again: about US$0.046 of a US$0.06 call. A cache hit would cost US$0.02–0.03. **Options:** 1. No cache for re-plans. 2. A smaller library block for re-plans. 3. The 1-hour cache TTL. Big schedule changes (US$0.10–0.15, 40–50 s) are over target either way. **Status (checked 2026-11-08):** unchanged; parked on 2026-10-23. Session 51 (#226) holds re-plans until End chat or a nightly run, which changes how they cluster. Re-check the numbers after it.
chris-kreidl commented 2026-11-19 03:21:40 +00:00 (Migrated from github.com)

Status (checked 2026-11-18): session 51 (#226, held re-plans) has merged. Re-plans now wait for End chat or the nightly 09:00 UTC run, which changes how often they land within the 5-minute cache window. Re-check the cache-write share in recent AiCall rows before choosing an option.

**Status (checked 2026-11-18):** session 51 (#226, held re-plans) has merged. Re-plans now wait for End chat or the nightly 09:00 UTC run, which changes how often they land within the 5-minute cache window. Re-check the cache-write share in recent `AiCall` rows before choosing an option.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ckreidl/trainer#184
No description provided.