Claude Track
Module 08
Claude Track -- Module 08
Picking the Right Size: ShopMate uses three different models depending on the task: Haiku for quick sentiment checks and order status lookups (fast, cheap), Sonnet for product descriptions and email replies (balanced), and Opus for generating the seasonal campaign copy that Maya reviews personally (highest quality). The right model for each job keeps costs low without sacrificing quality where it matters.

The Claude 4 Model Family

Anthropic offers three models optimised for different speed, capability, and cost trade-offs. Choosing the right model for each task is critical for building efficient production systems.

Claude Opus 4.6

Most capable model. Best for complex reasoning, nuanced analysis, and agentic tasks that require deep judgment. Highest cost, slowest speed.

claude-opus-4-6

Claude Sonnet 4.6

Best balance of intelligence and speed. Ideal for most production workloads: coding, data extraction, document analysis, customer support.

claude-sonnet-4-6

Claude Haiku 4.5

Fastest and most cost-efficient. Best for high-throughput applications, simple classification, quick summaries, and latency-sensitive tasks.

claude-haiku-4-5-20251001

!
Model Selection Rule

Start development with Sonnet. Upgrade to Opus only for tasks where quality materially differs. Use Haiku for pre-processing, routing, classification, and any latency-sensitive path. The cost difference between Haiku and Opus is roughly 10x.

i
Pricing Disclaimer

All prices shown are per 1 million tokens (input / output) and were current as of April 2026. Verify the latest rates at anthropic.com/pricing before building cost models.

ShopMate -- Model Router

Python -- shopmate/router.py
# shopmate/router.py -- Right model for each ShopMate task
from enum import Enum

class Task(Enum):
    CLASSIFY    = "classify"    # sentiment check, category label
    WRITE       = "write"       # product descriptions, email replies
    CAMPAIGN    = "campaign"    # seasonal campaign copy, Maya reviews

# Model choice + max tokens per task
ROUTING = {
    Task.CLASSIFY: ("claude-haiku-4-5-20251001",  30),   # fastest, cheapest
    Task.WRITE:    ("claude-haiku-4-5-20251001",  250),  # good quality, low cost
    Task.CAMPAIGN: ("claude-sonnet-4-6",          800),  # best quality for Maya
}

# Cost per 1 million tokens (input / output) — verify at anthropic.com/pricing
PRICES = {
    "claude-haiku-4-5-20251001": (0.80,  4.00),   # $0.80 input / $4.00 output per 1M tokens
    "claude-sonnet-4-6":        (3.00, 15.00),  # $3.00 input / $15.00 output per 1M tokens
}

def route(task: Task) -> tuple[str, int]:
    return ROUTING[task]

def monthly_cost_estimate() -> None:
    volumes = {Task.CLASSIFY: 2000, Task.WRITE: 500, Task.CAMPAIGN: 8}
    total = 0
    print(f"{'Task':<15} {'Model':<35} {'Vol':>5} {'Cost':>8}")
    print("-" * 68)
    for task, vol in volumes.items():
        model, max_out = ROUTING[task]
        cin, cout = PRICES[model]
        cost = ((400/1e6)*cin + (max_out/1e6)*cout) * vol
        total += cost
        print(f"{task.value:<15} {model:<35} {vol:>5} ${cost:>7.2f}")
    print(f"
Estimated monthly total: ${total:.2f}")

monthly_cost_estimate()