Patterns
Patterns are reusable architectures for building systems with typed-lm. Each one keeps the control in your code and gives the model a narrow, structured decision.
- Confidence-gated routing — use confidence as a second axis to decide whether to act.
- Composite scoring — break a complex judgment into atomic scores and combine them with weights you control.
- Intent routing — classify an incoming request and route it to the right handler.
- Speculative fan-out — ask many questions in one call and let your code decide what matters.
Shared principles
- One decision per question. Atomic questions are more reliable than compound ones.
- Closed answer sets. Declare the candidates in
criteria. - Combine in code. Weights, thresholds and rules are yours to test and change.
- Read confidence. For choice and score, confidence tells you whether to act.
Next steps
- Cookbooks — end-to-end examples.
- Designing with typed decisions — the design guide.