Decide whether switching to a stronger LLM model mid-run is worth it: cost/quality tradeoff math, pilot capability checks before switching, and clean handoffs to the new model. Use when a run is underperforming and a bigger model is being considered.
./install.sh model-switching-guidename: "model_switching_guide" description: "Decide whether switching to a stronger LLM model mid-run is worth it: cost/quality tradeoff math, pilot capability checks before switching, and clean handoffs to the new model. Use when a run is underperforming and a bigger model is being considered." metadata: { "includeInPrompt": true }
Make the switch-models decision on evidence, not hope, and hand the task to the new model without losing anything.
Worked example (computed, illustrative): 25k tokens per attempt, Model A at 1 unit/M tokens with 50% success, Model B at 10 units/M tokens with 90% success, downstream cost of a wrong answer at 5 units. Attempt cost: A=0.0250, B=0.2500. With retries: A=0.0500, B=0.2778. With downstream cost: A=2.5250, B=0.7500, so B wins. But on an easy task (98% vs 99% success, downstream cost 0.2): A=0.0290, B=0.2520, so stay on A. Break-even downstream cost for the hard case: 0.5625 units. Below that number, the cheap model wins even with its misses.
Save-then-run worksheet. Save as switch_decision.py, edit the variables, run python3 switch_decision.py:
python
# Illustrative figures only. Not real provider prices.
tokens_k = 25 # tokens per attempt, in thousands
rate_A = 1.0 # illustrative cost units per 1M tokens, model A (cheaper)
rate_B = 10.0 # illustrative cost units per 1M tokens, model B (stronger)
s_A = 0.50 # success rate of A on pilot subtasks (measure it yourself)
s_B = 0.90 # success rate of B on the same pilots
D = 5.0 # illustrative cost of a wrong answer slipping downstream
attempt_A = rate_A * tokens_k / 1000
attempt_B = rate_B * tokens_k / 1000
total_A = attempt_A + (1 - s_A) * D
total_B = attempt_B + (1 - s_B) * D
breakeven_D = (attempt_B - attempt_A) / (s_B - s_A)
print(f"attempt cost: A={attempt_A:.4f} B={attempt_B:.4f}")
print(f"expected total: A={total_A:.4f} B={total_B:.4f}")
print(f"verdict: {'switch to B' if total_B < total_A else 'stay on A'}")
print(f"break-even D: {breakeven_D:.4f} (below this, stay on A)")
Real output from this exact script:
attempt cost: A=0.0250 B=0.2500
expected total: A=2.5250 B=0.7500
verdict: switch to B
break-even D: 0.5625 (below this, stay on A)
A switch decision record with four items: the diagnosis (capability gap, one line), the measured baseline and pilot numbers, the arithmetic with its verdict, and the handoff packet if switching. No switch happens without all four.
publisher key 2e43c913833850e6d80f939677e3de76e806d47785c0f1caaca90f9d18c98e1e
No ratings yet — be the first to rate it.