Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 1.10 — Playbook: Model Behaviour Cheat Sheet
LLM Engineering · Example 1 of 2

Recipe: input budget and cost projection

Prices are example numbers. Keep them in configuration and check your provider's price page.

Four recipes to keep next to every LLM feature: an input-budget helper, a daily-cost projection, starting temperatures per task, and a hallucination-risk checklist. Copy them, then replace the guesses with your own measurements.

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 5 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 max_calls_per_day(budget_dollars, tokens_in, tokens_out, price_in, price_out) returning the whole number of calls a daily dollar budget pays for (prices per million tokens). Test: budget 60, 1500 in, 300 out, prices 0.50 and 1.50.

02

Write risk_level(score) returning low for 0 to 1, medium for 2 to 4 and high for 5 and above. Print the levels for scores 0, 3 and 7.

Explain it without notes

01

How do you compute how many input tokens you can send?

02

How do you estimate the monthly cost of a feature before building it?

03

How would you choose a starting temperature for a new feature?

04

How do you decide how much hallucination protection a feature needs?

Recipe: input budget and cost projection
Sign in to run this example in your browser.

Expected output

input budget, 8000 window, 1000 reply: 6600
input budget, 128000 window, 4000 reply: 117600
chatty answers: 60.00 dollars a day, 1800.00 a month
short answers: 48.75 dollars a day, 1462.50 a month