Skip to content

Missing MODEL_COSTS for muse-spark-1.3 + no prompt_cache_key sent (cache collapse on Contrib) #83

Description

@beyondhumanwork

Issue: Missing MODEL_COSTS for muse-spark-1.3 + no prompt_cache_key sent (cache collapse on Contrib)

Provider version: 0.6.4
Models affected: meta/muse-spark-1.3, meta/muse-spark-1.3-contributor

Bug 1 — 1.3 models bill $0.00 locally (pricing table never updated for 1.3)

src/pricing.ts (PRICING_LAST_VERIFIED = "2026-09-01") has entries for
meta/muse-spark-1.1, meta/muse-spark-1.2, meta/muse-spark-1.2-contributor
— but nothing for 1.3, even though src/commandcode-catalog.ts already lists
both 1.3 IDs. index.ts:128 then falls back silently:

cost: MODEL_COSTS[model.id] ?? ZERO_MODEL_COST,

Verified in my session logs: all 387 meta/muse-spark-1.3-contributor
assistant messages record
usage.cost = {input:0, output:0, cacheRead:0, cacheWrite:0, total:0} while the
server billed real money (81% of 5h cap, 76% of weekly cap burned in ~12h).
Anything downstream of local cost (quota display, overflow decisions) is blind
for these two models.

Fix: add both 1.3 entries (same rates as 1.2 / 1.2-contrib per
commandcode.ai plan pages: 1.3-contrib = $0.10 / $0.20 / $0.002), and consider
warning instead of silently zeroing unknown models.

Feature 2 — send prompt_cache_key so server-side prefix caching can hit

src/core.ts (~L566-569) sends only max_tokens, temperature,
reasoning_effort. No prompt_cache_key is ever sent, although Meta documents
it as the lever that raises hit rates at scale
(dev.meta.ai/docs/cookbook/prompt-caching: "at scale [a prompt_cache_key]
routes same-prefix requests to the same backend and raises the hit rate").

Measured impact from my own session logs (pi session, 387 requests on
meta/muse-spark-1.3-contributor, single continuous session):

  • fresh-input distribution: min 120, p10 309, median 1,670, p75 125,179,
    p90 335,074, max 392,880
  • i.e. caching works early, then collapses entirely in the tail (~100 requests
    at near-100% fresh, ~$0.035 each)
  • same harness on xiaomi/mimo-v2.5: avg ~7k fresh / ~160k cached (~95% hits)

Independent corroboration:

  • HN (news.ycombinator.com/item?id=49493163): "Muse Spark drops the cache in
    less than 5m. MiMo keeps it around for at least an hour... A 500K token input
    repeatedly read for full input price 12 times an hour = $0.60 vs expected
    $0.012 — a 50x difference."
  • r/openclaw (.../muse_spark_12_contributor_cache_not_working_well): 1.2
    Contributor cache hit rate "stuck at 0%" with a 25-min heartbeat.
  • r/CommandCode (.../commandcode_extremely_high_token_usage_in_any): 30M
    tokens billed on a 250k conversation via opencode/Claude Code; same prompt in
    the first-party CLI bills 500k–1M.
  • Even Meta's own team reports ~45% hit rates on agentic runs with an
    explicit key and 24h TTL.

Sending one stable prompt_cache_key per session/prefix (as Meta's cookbook
recommends for production) is the cheapest available mitigation for every
pi-commandcode-provider user on Contrib models. Happy to test a branch.


Teams affected: anyone running long agentic sessions on Contrib tiers through
pi. Current behavior turns a $0.0002/req assumption into ~$0.036/req reality.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions