Lesson 2 · path 0
When to use Jev, an LLM, or plain code
Code runs the workflow. Jev makes quick judgment calls. LLMs do the writing. Keep fixed-rule work in plain code.
The big rule
Build AI-powered software, not self-running agents. Your code owns the control flow. You drop System One in wherever you need judgment calls on unstructured data that plain code cannot make. TypeSafe lays this out in How to build.
Picture a sports game. An LLM is the sportswriter who writes a long story about it afterward. Jev is the referee who snaps out fast, narrow calls all game long. Your workflow wants the referee.
Use Jev when you need
- Routing or classification into a fixed set of options, with probabilities
- A yes/no check on meaning, with a usable P(true)
- Rubric scores you can threshold or sort
- Many small, atomic judgments in parallel over the same state
- Cheap verification or guardrails around other AI
- Fast intent routing before an expensive LLM call
Keep it in code when
The work is deterministic: fixed rules, arithmetic, counting, date ordering, regex or parser extraction, combining weights, escalating.
Use a generative LLM when
You need free-form text, multi-hop generation, or open-ended writing. Generation is not Jev's job. See jaggedness.
The design loop
The docs give an eight-step loop:
- Keep deterministic work in code
- Cut state down to only what the questions need
- Prefer structured JSON state
- Ask atomic questions
- Structure instructions and criteria when a question has multiple parts
- Fan out independent questions in one request
- Combine the answers in code
- Gate on confidence: act, review, or escalate
Next
Verify TYPESAFE_API_KEY without printing it.