Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 13.1 — Choosing a Model
LLM Engineering · Example 1 of 2

Gates: who is out, and why

Candidates are made-up labels. The gates are context, data policy and licence.

There is no best model, only the best model for your task, budget, speed, rules and data. Filter by hard requirements first, then test the shortlist on your own evals and compare with a weighted scorecard.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 6 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Write reasons_out(candidate, need_context) that returns a list of reasons a candidate is out (an empty list means keep). Reasons: "context too small" when its context is below need_context, and "licence" when licence_ok is false.

02

Write lower_is_better_scores(values) that returns each value's score as 100 * min(values) / value, rounded to one decimal.

Explain it without notes

01

How do you choose a model for a new feature?

02

What is a gate, and why apply gates before running evals?

03

Why decide the scorecard weights before seeing the results?

04

Why is a leaderboard score not enough to choose a model?

Gates: who is out, and why
Sign in to run this example in your browser.

Expected output

tiny-open: out (context too small)
small-open: keep
mid-hosted: keep
large-hosted: out (data leaves our control)
odd-licence: out (licence does not allow our use)
shortlist: small-open, mid-hosted