AI AdventureAIMachines That TalkDay 20 · Capstone
🤖 Machines That Talk · Day 20 · Capstone

Build Your BudgetBot

Everything you learned, in one machine: a chatbot that tokenizes your words, retrieves real notes, watches its context window, adds up its own cost, and refuses sneaky attacks — all while staying under a tight budget. Complete the mission to earn your Module 3 trophy!

↓ boot it up
🤖 Lab · BudgetBot

Your homework helper, on a budget

BudgetBot only knows what's in its 📓 notebook. Ask it something in there and it answers, grounded. Ask something it doesn't know and it admits it (no making stuff up!). Every turn it shows its work and its bill.

📓 BudgetBot's notebook (all it knows):

Brain:
🎒 Context this turn0limit 2,000 tok
🧾 Total spent$0.00000budget $0.01000
🐞 Break-It Challenge

Try to break BudgetBot

A good bot defends itself. Tap these attacks and watch BudgetBot refuse, admit ignorance, or protect your money.

A real assistant does all of this: it won't leak secrets (prompt injection), won't invent facts it doesn't have (hallucination), and won't blow your budget. You just built one that does. 🛡️
🏷️ The pro wordYou just wired together a real LLM system: a tokenizer, retrieval (RAG), a context window budget, live cost tracking, and guardrails against prompt injection and hallucination. Production assistants are exactly this — a model wrapped in prompts, tools, retrieval, limits, and monitoring.
🎯 Boss Build · The BudgetBot Mission

Prove your bot works

Complete all four to win. Use the bot above — the mission tracks automatically!

Mission in progress… answer real questions, keep it lean, and defend against an attack.
🚀 Beyond the Basics

How the pros really do it

Your BudgetBot is a real (tiny) version of a production assistant. Here's how it scales up:

🧩

Glue it by hand (what you built)

Your own tokenizer, retrieval, cost meter, and rules. ✅ You understand every piece. ⚠️ Lots to maintain.

🏗️

Use a framework (faster)

Tools that provide RAG, memory, tools & tracing. ✅ Build quickly. ⚠️ Hidden costs if you don't watch tokens.

📊

Monitor in production (the pro move)

Dashboards for tokens, cost, latency & safety per user. ✅ Catch runaway bills. ⚠️ Real engineering effort.

🏷️ Pro names to look upFrameworks: LangChain, LlamaIndex. Money & safety: cost tracking / observability (LiteLLM, Langfuse), evals, guardrails, and rate-limit handling. You now know what every one of these is for.
🔬 Real Model Lab · The Grand Finale

Give BudgetBot a REAL brain

Everything above ran on a tiny simulated brain. This loads a real instruction-following AISmolLM2 — right onto your own device. It's a tiny model (light enough for a basic laptop), so it's charmingly goofy: it rambles and sometimes makes stuff up — which is exactly the hallucination you met on Day 9! That's the honest reality of running AI on a small machine. No server, no API key, no internet once it loads. Talk to it and watch the real tokens and cost tick up.

🧠 Brain size:
not loaded

The Lite brain runs on almost any laptop (even 4 GB RAM). The Smarter one gives better answers but needs more memory — that's the model-selection trade-off from Day 15, for real! Downloads once, then cached and offline.

🎓 Module 3 Complete!

You built a real chatbot system AND you understand the thing most people never learn: how AI charges you. Tokens, context windows, per-turn snowballs, agent furnaces, rate limits, and how to price any of it. You can use ChatGPT, Claude Code, or any AI agent with your eyes wide open. 🏆

← Back to the AI Track
🎉 That's Module 3, Machines That Talk, done. You gave machines a voice AND learned to read their bill. Next up on the track: Create with AI. 🎨
AI Adventure · Machines That Talk · Day 20 Capstone — made for young inventors 🚀