本页面尚未完全翻译为您的语言——正在显示英文版本。
"AI" is the word that gets funded, so people reach for an LLM on problems a plain function would solve faster, cheaper, and more reliably. The honest default is the other way around: use code until the task genuinely needs language understanding or judgment you can't script — and even then, prefer a hybrid where deterministic code does the load-bearing work and the model only handles the fuzzy edge. A model you don't need is just a slow, expensive, non-deterministic function with a bigger bill.
所有选项一览
Plain code — no model needed
A function, a rule, a query — written once, runs the same forever. It's free, instant, testable, and never hallucinates. If a clear rule on clean input produces the answer, an LLM here is a liability dressed as a feature.
在以下情况选择它
- A rule or calculation determines the right answer
- The input is already structured and predictable
- You want it fast, cheap, deterministic, and easy to test
权衡
- Can't handle inputs you didn't anticipate or messy human language
- You have to actually write and maintain the logic
- Add an LLM later only if a real fuzzy edge shows up
Hybrid — code core, model at the edges
The sophisticated middle, and more often the right answer than either extreme. Deterministic code does the load-bearing work and owns the source of truth; the model handles only the fuzzy part — reading messy input, drafting, proposing — while your rules ground and verify it. You get the model's flexibility without betting correctness on it.
在以下情况选择它
- The logic is scriptable, but the input arrives as messy language
- It needs judgment, yet there's a structured spine or a checkable answer
- You want the model's reach but refuse to trust it unchecked
权衡
- More moving parts than either pure approach — two layers to design
- You have to draw the line: what the code owns vs. what the model is allowed to decide
- The model step still needs grounding and verification, not blind trust
An LLM — this is genuinely its job
Messy free-form language in, open-ended judgment out, with no single right answer to compute. Summarizing, drafting, classifying fuzzy intent, answering in natural language — this is what only a model does well, and pretending otherwise means rebuilding a worse one by hand.
在以下情况选择它
- The task is open-ended language or judgment, not a rule
- The input is messy, varied human text you can't fully anticipate
- There's no single correct output to check against
权衡
- Costs money and latency on every call — watch it at scale
- Non-deterministic and hard to verify — wrap it in evals and guardrails
- Ground it in a real source of truth; never let an unchecked answer touch anything that matters