Task statement 5.3 · Model selection and optimization
5.3 · Model Selection and Tradeoffs
In Shelfwise, the course example, the model family decides whether an answer can stay under $0.01: with the prefix cached, Haiku-family pricing lands near $0.007 an answer and Sonnet-family pricing near $0.014. Choosing a family weighs quality, latency and cost, and a new model release has to be checked for what it breaks before staff see it.
share
Two reasonable instincts fail when choosing or changing a model. One picks from the price list, the strongest to be safe or the cheapest per token, when only your own evals show which one meets the requirement. The other changes only the model ID for a newer release, but a release can reject request settings the old model accepted, or change a default with no error.
KnowledgeOpus, Sonnet and Haiku
Claude's current models come in families that trade capability against latency and price per token. Of the three the guide names, Opus is the most capable and the slowest, Haiku the fastest and lowest-priced, and Sonnet sits between them. Context window and thinking support also differ, so a requirement can rule a family out before quality is measured. Thinking support is the clearest case (5.1 lists the modes and defaults). Haiku-family models offer only extended thinking, off unless you enable it. So among current models, a workload that needs thinking off fits Haiku-family. The newest Sonnet-family model can turn off only its up-front thinking (thinking before the reply) through the API, and the newest Opus-family model can't turn it off at all.
Long-running agentic coding, complex reasoning, large refactors and computer use, at moderate latency.
LimitsA 1M-token window and 128k output, and adaptive thinking that can't be turned off.
Code generation, data analysis, content creation and agentic tool use, with fast responses.
LimitsThe same window and output, with adaptive thinking on by default and effort available.
Real-time features, high-volume processing and subagent tasks, at the lowest latency and price per token.
LimitsA 200k-token window and 64k output, with extended thinking only and no effort parameter.
More precise than the guide. The guide compares Opus, Sonnet and Haiku. The models overview also lists a fourth current family, Fable, above Opus for demanding reasoning and long-horizon agentic work (Mythos-family models are invitation-only), and says that if you are unsure, start most workloads on Opus (as of 2026-10-04). Exam answer: among the three named families, Opus is the capability-first choice and the other two give up capability for speed and a lower price; Fable, where it appears, ranks above Opus.
KnowledgeTrading quality, latency and cost
The docs' guide to choosing a model offers two starts. Efficiency-first begins on Haiku-family and moves up a tier only for a gap your tests show, and capability-first begins on Opus-family and moves down once quality is secured. Before changing family, test each effort level on the current model, because effort trades quality against latency and cost inside one model, and fast mode buys Opus-family output speed at a higher price per token (5.1). Compare candidates on cost per completed task on your own traffic, hardest tasks included, because a model that costs more per token can finish in fewer turns. When traffic mixes routine and hard steps, combine models: in the advisor strategy a lower-cost model runs the loop and escalates hard decisions to a stronger one, and in the orchestrator strategy a stronger model hands independent pieces to lower-cost workers. 5.4 covers the mechanics behind each bill.
KnowledgeBreaking changes across model releases
A breaking change is a difference in a model release that makes working code fail or behave differently. Three groups of settings return a 400 error. The newest models reject non-default sampling settings (5.1) and a manual budget_tokens (2.3). Claude 4.6 and later models also reject assistant prefill, a final assistant turn that starts Claude's reply. The newest Opus-, Sonnet-, Fable- and Mythos-family models reject a forced tool call: tool_choice, the field that controls tool use, set to any or tool. The migration guides replace a format prefill with structured outputs, and forced tool choice with auto plus strict tool use. Other changes raise no error: the newer tokenizer counts the same text as more tokens (5.1), the newest Opus-family model runs at a lower default effort than its predecessor, and the latest models write more concisely and follow instructions more literally. So read the target model's migration guide, then change the request on a branch, re-run the evals, recount tokens and pin the new ID in configuration (2.6), with the platform's own ID and dates on Bedrock or Google Cloud (2.3).
SkillChecking a candidate model for Shelfwise
The deprecations page lists a single active Haiku-family model, with a tentative retirement date, so Shelfwise's team tried the next tier up on a branch, changing only the model ID in config/release.toml:
# branch: model = newest Sonnet-family ID; options still say thinking "disabled" eval run → 150/150, no errors usage → thinking billed as output count_tokens → ≈9,100 input tokens a request, not ≈7,000 # Claude Code can't turn thinking off on this model; here "disabled" was ignored cost per answer → over $0.01 (≈$0.014 before the extra tokens)
Nothing failed, which makes this change dangerous. Claude Code, which the Agent SDK runs, can't turn thinking off on this model, and in this trial the SDK's "disabled" was ignored rather than rejected. Quality held, but cost ruled the candidate out, because Sonnet-family pricing already lands near $0.014 an answer before thinking and a tokenizer that adds about 30%. The team closed the pull request with the result recorded: any replacement must be priced near Haiku-family rates, or the $0.01 requirement goes back to the owners.
Interactive · the checks a candidate model passes before Shelfwise switches
Choose the model behind Shelfwise's request and follow it through the checks.
The current Haiku-family model: thinking stays off as configured, the eval set passes, and with the prefix cached an answer costs about $0.007, so the pinned ID stays.
The newest Sonnet-family model with the same options: the request is accepted, but Claude Code can't turn thinking off on this model, and in this trial "disabled" was ignored, so thinking is billed as output. Quality holds; the extra tokens and Sonnet-family pricing put every answer over $0.01.
- Opus, Sonnet and Haiku trade capability against latency and price per token, and context window and thinking support can rule a family out first.
- Price candidates per completed task on your own traffic, not per token.
- A model release can reject old request settings with a 400 or change a default silently, so read its migration guide before the model ID changes.