本页目录

📘 第 3 课:Choosing the right model(选对模型)

所属课程:the AI Platform 101(课程 003) 官方课时定位:Section 1「What is the the AI Platform?」— Lesson 3 / 共 12 课时 ID:486252 | 官方地址:https://anthropic.skilljar.com/claude-platform-101/486252 形式:Video(视频课 + 文稿) 针对认证:CCAR-P(架构师 Professional) 整理日期:2026-10-14 ⚠️ 语料来源:官方 Skilljar 课程正文(用户提供,需登录)。CC BY-NC-SA 4.0,仅供个人学习。 ⭐⭐ 本课权重提示:全课最像考题的一课。官方在这里给出了选型判据、一句可背诵的原则、评估集的最小可行做法(20–30 条来自真实工作负载的样例)与按任务路由四件事 —— 分别命中领域 2(13%)、领域 4(16%)与领域 1(17%)。


🎯 本课学习目标

⚠️ 本课官方未提供 What you'll learn 区块。以下按文稿结构反推:

  1. 能说出官方的模型档位及各自定位(含新增的第四档)。
  2. ⭐⭐ 能背出那句选型原则:the right model is the cheapest one whose output you'd actually ship。
  3. 能搭一个最小可行评估(20–30 条真实样例)。
  4. 能按「从低档往上试」的顺序做选型,并知道在哪停。
  5. 会用 response.usage 读 input / output token,知道账单按什么算。
  6. 能在同一个接口内按任务路由到不同模型。

📖 一、视频导读

官方原句: You're shipping an app with the AI. Which model do you pick? If you default to the smartest one, your API bill will surprise you. Pick the cheapest one, and the output might not hold up. Each model has different trade-offs, and picking the right one affects both quality and cost.

精译:你正在交付一个带 AI 的应用。你选哪个模型?如果你默认选最聪明的那个,你的 API 账单会给你一个惊喜;选最便宜的那个,产出又可能撑不住。 每个模型都有不同的取舍,选对了同时影响质量与成本。

⭐⭐ 这是一个标准的「两头都不是正解」型题干结构(CCAR-P 最爱): | ❌ 陷阱 A | ❌ 陷阱 B | ✅ 官方正解 | |---|---|---| | default to the smartest one(默认最强) | pick the cheapest one(一律最省) | 按任务做权衡,用评估来决定 |

记忆锚:默认最强 = 账单惊喜;一律最省 = 产出撑不住。选型是评估出来的,不是猜出来的。


🏷️ 二、⭐ 模型档位(The model tiers)

官方原句:the AI provider currently offers four model tiers, and you choose between them with the model parameter in your API call.

⚠️ 官方口径冲突(必记): * 本段正文:四档(含新增的 the AI Fable)。 * 本课 Recap 仍写「三档」:"the AI provider offers three model tiers"。 * 原因:官方自己注明 Fable 在本课程录制时「尚未正式可用(not generally available)」,因此未出现在视频中。 * 考试口径:按正文的四档理解;若题干只给 Opus / Sonnet / Haiku 三选一,那是在考「三个 core model families」。

四档总表(按能力从高到低)

档位 官方定位 速度 / 成本 ⭐ 官方指定用途
the AI Fable our most capable model yet — a new tier that sits above Opus** 比 Opus 显著更贵 built for your toughest challenges;⭐ reserve it for work where that extra capability is worth paying for**
the AI Opus the most capable of the three core model families** slowest* and highest cost* of the three deep reasoning, complex analysis, multi-step coding, nuanced writing
the AI Sonnet ⭐ sits in the sweet spot** a balanced combination of intelligence, speed, and cost works well for most production work
the AI Haiku fastest* and lowest cost;optimized for speed and cost efficiency rather than maximum intelligence*** 最快、最省 high-volume, low-complexity work:classification, extraction, routing

⭐⭐ 两张必须分清的对照表

① 能力 / 速度 / 成本的相对位置

Fable Opus Sonnet Haiku
能力 🥇 最高 🥈 🥉 第 4
速度 最慢 慢(slowest of the three) 中 ⭐ 最快
成本 ⭐ 最高(significantly higher than Opus) 高(highest of the three) 中 ⭐ 最低

⚠️ 易错点:官方说 Opus 是「三家中最慢最贵」(of the three)—— 加了 Fable 之后,Opus 就不再是最慢最贵的了。看到 slowest / highest cost 要看限定语是不是 of the three。

② ⭐ 用途关键词(选择题的题眼)

关键词 选哪个
toughest challenges / worth paying for Fable
deep reasoning / complex analysis / multi-step coding / nuanced writing Opus
sweet spot / balanced / most production work Sonnet
high-volume / low-complexity / classification / extraction / routing / speed Haiku

⭐ 「分类 / 抽取 / 路由」这三个词几乎是 Haiku 的专属信号 —— 呼应第 1 课(起草客服回复用 Haiku)与第 2 课(官方对简单任务的判据)。

官方补充

Note that at the time of this course, the AI Fable was not generally available, and are not reflected in the video above. Learn more about the AI Fable and the AI Mythos here.

精译:请注意,在本课程制作时,the AI Fable 尚未正式可用,因此未体现在上面的视频中。了解更多 the AI Fable 与 the AI Mythos 的信息见此处。

💡 generally available(GA,正式可用)是云厂商的标准术语。考题若出现 preview / beta / not GA 的描述,通常意味着不要把它作为生产默认选项。


🧪 三、⭐⭐ 先做一个简单评估(Start with a simple evaluation)

官方原句: Before you write production code, set up a simple evaluation*: a set of example inputs that you run through each model and score against what good output means for your use case. You don't need anything fancy — 20 or 30 representative examples from your actual workload* is enough to start.

精译:在你写生产代码之前,先搭一个简单的评估:准备一组样例输入,让每个模型都跑一遍,并对照「对你的用例来说,什么算好输出」来打分。你不需要任何花哨的东西 —— 从你的真实工作负载里取 20 到 30 条有代表性的样例就足够起步了。

要素 官方口径
⭐ 时机 before you write production code(写生产代码之前**)
组成 一组样例输入 + 一个「什么叫好」的判据
⭐ 规模 20 或 30 条,来自真实工作负载(actual workload),有代表性(representative)
态度 You don't need anything fancy(不需要花哨)

⭐⭐ 这直接命中 CCAR-P 领域 4「设计评估数据集」 —— 官方给出的最小可行做法就是这四个要素: 真实负载取样 + 20~30 条 + 定义「好」+ 写码之前先做。 考点提示:题干给「团队想先上线再慢慢收集评估数据」→ 错。官方明确要求 before production code。 呼应课程 002 第 4 课的 Write acceptance tests before code(先写验收测试再写代码)—— 两门课再次互相印证。

⭐⭐ 往上试档的顺序(Work your way up the tiers)

官方原句: 1. Run your examples through Haiku first. If the quality holds, you're done — and you just saved a lot of money. 2. If it doesn't, step up to Sonnet. 3. Only reach for Opus when the task needs it.

精译: 1. 先用 Haiku 跑你的样例。如果质量撑得住,你就结束了 —— 而且你刚刚省下了一大笔钱。 2. 如果撑不住,升到 Sonnet。 3. 只有当任务确实需要时,才去够 Opus。

⭐⭐ 记忆锚:从最低档往上试,能用就停 —— 不是从上往下砍。 这个方向非常反直觉(多数人会先试最强的),是绝佳的考题: * 题干问「团队该如何开始选型」→ 正解 Haiku 起步,逐级上探。 * 陷阱:「先用 Opus 确认上限,再往下优化成本」—— 官方不推荐这条路线(理由:浪费且得不出「最低可用档」的结论)。 * ⭐ if the quality holds(如果质量撑得住) —— hold 在这里是「站得住、经得起」,呼应开头 the output might not hold up。


📊 四、并排比较(Comparing the tiers side by side)

官方原句:Let's see the difference between the tiers, not just talk about it. We'll send the same prompt through all three models and watch the latency and token counts:

官方代码(Python 风格,保持原样)

models = ["current-model-lite", "current-model-fast", "current-model"]

for model in models:
    response = client.messages.create(
        model=model,
        max_tokens=300,
        messages=[{"role": "user", "content": prompt}],
    )
    print(model, response.usage)

⚠️ 抓取件说明:"current-model-lite" / "current-model-fast" / "current-model" 为环境替换残留,实际对应 Haiku / Sonnet / Opus 三档。不要背这些字符串。

⭐ 官方点名的「两件事」(Two things are going on here)

# 官方原句 中文 考点
1 The loop swaps the model field on each request. Same prompt, same max tokens — only the model changes.** 循环在每次请求上换掉 model 字段。同样的提示词、同样的 max tokens —— 只有模型变。 ⭐ 对照实验的唯一变量原则
2 response.usage gives you the input and output tokens straight back from the API, which is what your bill is calculated on. response.usage 直接从 API 返回 input 与 output token —— 而你的账单正是按这个算的。 ⭐⭐ 账单口径

⭐⭐ response.usage = 账单依据,这是领域 4(成本优化)与领域 3(可观测性)的交叉点: * input tokens / output tokens 分开计量 —— 通常 output 更贵,长输入不等于贵,长输出才贵。 * 考点:题干问「如何衡量并控制成本」→ 正解涉及读取 usage 并按 input/output 分别核算;陷阱是「估算字符数」或「看响应长度」。

⭐ 「一次只改一个变量」是本课暗含的科学方法:同样的 prompt、同样的 max_tokens、只换 model —— 否则比较结果不可信。这对应考纲领域 4 的「设计评估」基本功。

官方给出的实测观察

Run it and you'll see three models and three sets of numbers. Opus takes the longest and reads the most polished — but for a two-sentence definition, that polish is wasted. Sonnet tightens the writing up a little. And Haiku comes back, often in under a second, with a very competent two-sentence answer. It's honestly perfect for this kind of scenario.

精译:跑起来你会看到三个模型、三组数字。Opus 耗时最长、读起来最考究 —— 但对于一句两句话的定义,那份考究是被浪费掉的。Sonnet 把文字收紧了一些。 而 Haiku 回来的往往不到一秒,给出的两句回答非常称职。说实话,它对这类场景就是完美的。

档位 官方观察 判语
Opus takes the longest + reads the most polished ⭐ polish is wasted(考究被浪费)
Sonnet tightens the writing up a little 小幅收紧
Haiku often in under a second + very competent ⭐ perfect for this kind of scenario

🎯 五、⭐⭐⭐ 本课最重的一句(全课选型原则)

官方原句: And that's the whole point: the right model is the cheapest one whose output you'd actually ship.* For a definition, Haiku is plenty. For drafting a regulatory response, you'd run the same comparison and probably end up on Opus. The eval is the same shape every single time.***

精译: 这就是全部要点:正确的模型,是那个「产出你真的敢交付」的最便宜的模型。 对于一句定义,Haiku 就足够了;对于起草一份监管回应,你会跑同样的比较,最后大概会落在 Opus。评估的形状每一次都是一样的。

⭐⭐ 三层拆法

层 内容
原则 ⭐⭐ the right model is the cheapest one whose output you'd actually ship —— 正确 = 最便宜的「你真敢交付」的那个
两个锚点 定义 → Haiku;起草监管回应 → Opus
方法不变 ⭐ The eval is the same shape every single time.(评估的形状每次都一样)

⭐⭐ 记忆锚:不是「最强」,不是「最便宜」,是「最便宜的你能交付的那个」。

⭐ 注意 you'd actually ship(你真的会交付)这个限定 —— 它把质量门槛设为交付标准,而不是「看起来不错」或「评测分数高」。 这与课程 002 的 Prototype freely, ship selectively(自由原型,审慎交付)是同一条质量标准,只是 002 讲流程、本课讲模型档位。

⭐ The eval is the same shape every single time —— 官方在强调:方法可复用,变的只是结论。这正对应考纲领域 4 的「建立可复用的评估体系」,而不是每个任务临时想办法。


🔀 六、⭐ 把不同的工作路由到不同的模型(Routing)

官方原句: In a real app, you'd route different kinds of work to different models inside the same endpoint. Take an operations dashboard with a document processing route: * Every incoming file* gets classified with Haiku. * Client updates get drafted with Sonnet. * Only RFP responses reach for Opus. One queue, three models, picked per task.***

精译:在真实应用里,你会在同一个接口内,把不同种类的工作路由到不同模型。以一个带有文档处理路由的运营仪表盘为例: * 每一份进来的文件都用 Haiku 做分类。 * 客户更新用 Sonnet 起草。 * 只有 RFP 回应才去够 Opus。 一个队列,三个模型,按任务挑。

⭐ 路由表(背下来,这是标准的三档分工范例)

任务 模型 理由(对应官方用途说明)
Every incoming file → 分类 Haiku classification、high-volume、low-complexity
Client updates → 起草 Sonnet sweet spot、most production work
Only RFP responses → 回应** Opus complex analysis、nuanced writing

⭐⭐ 三个副词是题眼:Every(每一份)→ Haiku;Client updates → Sonnet;Only(只有)→ Opus。 Only 这个词就是成本控制的关键 —— 最贵的档位只留给最需要的一小部分。

⭐⭐ 架构论断:One queue, three models, picked per task.(一个队列,三个模型,按任务挑。) * 反面做法:为整个应用选一个模型(本课 Recap 明说 instead of picking one model for everything)。 * 对应考纲领域 1(17%):按任务特性分解并差异化配置 —— 这是架构决策,不是调参。 * 呼应第 2 课的 It's the same call — just wrapped in a route handler:同一个调用形态,但里面的 model 是按任务选的。


🔑 七、核心要点(Recap)· 官方五条

  1. the AI provider offers three model tiers: Opus for hard problems, Sonnet for daily work, and Haiku for volume. 官方提供三档模型:Opus 对付难题,Sonnet 做日常活,Haiku 扛量。

    ⚠️ 口径提醒:正文已更新为四档(多了 Fable),Recap 未同步。按正文四档记。

  2. Set up a simple evaluation — 20 or 30 representative examples from your real workload — before writing production code. 搭一个简单的评估 —— 20 到 30 条来自你真实工作负载的有代表性样例 —— 在写生产代码之前。
  3. Run the eval from Haiku upward and stop at the cheapest model whose output you'd actually ship. 从 Haiku 往上跑评估,停在那个「产出你真敢交付」的最便宜的模型上。
  4. response.usage reports input and output tokens, which is what your bill is based on. response.usage 报告 input 与 output token,而你的账单就是以此为基础的。
  5. In production, route different tasks to different models inside the same endpoint instead of picking one model for everything. 在生产中,于同一个接口内把不同任务路由到不同模型,而不是给所有事情挑一个模型。

🧠 本课 → CCAR-P 考点映射

本课知识点 命中考纲条目 领域
⭐⭐ 四档模型定位与用途关键词(deep reasoning / sweet spot / classification…) 基于权衡选型模型 领域 2(13%)
⭐⭐ 20–30 条真实负载样例、写生产代码之前先做评估 设计评估数据集;定义评估指标 领域 4(16%)
⭐⭐ 从 Haiku 往上试、停在「敢交付的最便宜档」 ⭐ 权衡准确率与延迟并论证配置决策 领域 4(16%)
⭐ response.usage(input / output token = 账单依据) 成本优化;可观测性 领域 4 + 领域 3(19%)
⭐⭐ 同一接口内按任务路由(One queue, three models) 复杂问题分解;端到端架构;架构模式选择 领域 1(17%)
对照实验:只改 model,其余不变 评估方法论(控制变量) 领域 4
not generally available(GA 状态)与生产可用性判断 风险识别与配置决策 领域 5(14%)

🔤 本课新生词(已回灌 30-单词表/03,2026-10-14)

词汇 音标 释义 备注
ship(v.) /ʃɪp/ 交付、上线 本课高频(you'd actually ship)
⭐ default to — 默认选择 if you default to the smartest one
bill /bɪl/ 账单 your API bill
surprise you — 给你一个(不快的)惊喜
⭐⭐ hold up — 撑得住、站得住 ⭐ 本课两次出现,质量判据
trade-off /ˈtreɪd ɔːf/ 权衡、取舍 考纲原词
⭐ tier /tɪr/ 档位、层级 model tiers
model parameter — model 参数 选档的入口
⭐ generally available (GA) — 正式可用 ⭐ 云厂商标准术语
be reflected in — 体现在……中
most capable ... yet — 迄今最强
⭐ reserve it for — 把它留给…… ⭐ Fable 的用法限定
worth paying for — 值得为此付费
core model families — 核心模型家族 三家的说法
deep reasoning — 深度推理 Opus
complex analysis — 复杂分析 Opus
multi-step coding — 多步编码 Opus
nuanced writing — 细腻/有层次的写作 Opus
⭐ sweet spot — 甜点、最合适的平衡点 ⭐ Sonnet 专名式描述
balanced combination — 均衡组合
high-volume — 高量、大批量 Haiku
low-complexity — 低复杂度 Haiku
⭐ classification /ˌklæsɪfɪˈkeɪʃn/ 分类 ⭐ Haiku 三大用途之一
⭐ extraction /ɪkˈstrækʃn/ 抽取、提取 ⭐ Haiku 三大用途之一
⭐ routing /ˈruːtɪŋ/ 路由、分流 ⭐ Haiku 三大用途之一;本课亦指模型路由
optimized for — 针对……优化
cost efficiency — 成本效率
⭐ representative /ˌreprɪˈzentətɪv/ 有代表性的 评估样例要求
workload /ˈwɜːrkloʊd/ 工作负载
fancy /ˈfænsi/ 花哨的 nothing fancy
⭐ work your way up — 逐级往上走 ⭐ 选型顺序
step up to — 升到
reach for — 去够、动用 only reach for Opus
⭐ side by side — 并排(对照) 比较方法
⭐ latency /ˈleɪtənsi/ 延迟 领域 4 原词
swap /swɑːp/ 换掉 swaps the model field
⭐ usage /ˈjuːsɪdʒ/ 用量 response.usage
be calculated on — 按……计算 账单口径
polished /ˈpɑːlɪʃt/ 考究、润色过的
wasted /ˈweɪstɪd/ 被浪费的 ⭐ that polish is wasted
tighten up — 收紧
competent /ˈkɑːmpɪtənt/ 称职的、够用的
plenty /ˈplenti/ 足够、绰绰有余 Haiku is plenty
⭐ regulatory /ˈreɡjələtɔːri/ 监管的 regulatory response
end up on — 最终落在
RFP — 提案邀请书(Request for Proposal) ⭐ 唯一用 Opus 的任务
incoming /ˈɪnkʌmɪŋ/ 进来的 every incoming file
⭐ per task — 按任务 picked per task
queue /kjuː/ 队列 one queue, three models

✅ 本课进度

  • [x] 全文精译与架构师级拆解(2026-10-14)
  • [x] ⭐⭐ 记录四档模型表(含 Fable)与 Recap「三档」的口径冲突说明
  • [x] ⭐⭐ 记录用途关键词对照表(题干关键词 → 档位)
  • [x] ⭐⭐ 记录最小可行评估四要素与「从 Haiku 往上试」的顺序
  • [x] ⭐⭐ 记录 response.usage = 账单依据
  • [x] ⭐⭐ 记录选型原则原句与路由表(One queue, three models)
  • [x] 英文原文已存:18-English-03-Choosing-the-right-model.md
  • [x] 生词回灌 30-单词表/03-考试核心生词与术语表.md(2026-10-14 建表,301 条入速查区,⭐⭐ 28 条精讲)
  • [ ] 官方未提供 What you'll learn 区块 —— 若后续页面补全,需回填

🔗 关联

⚠️ 语料说明:英文原文中的模型字符串 "current-model-lite" / "current-model-fast" / "current-model" 为抓取/环境替换残留,实际对应 Haiku / Sonnet / Opus 三档,已在代码段下方说明;其余英文引句均为官方原句,未作改动。

输入至少 2 个字符,检索全部课程与单词表