Learn
Learn hubFoundationsPromptingSQL & dataVisualizationRAGChatbotsPrototypesAgents & launch FAANG prep
Weekly practice
0102030405060708091011121314

Prototypes

Chapter 7 · Phase 6 · practice in Week 11 and Week 12

What you will know after this chapter
What makes an AI prototype trustworthy vs a one-hit wonder · how to pin everything for reproducibility · how to estimate token costs before building · how to structure a demo script · how to hand off a prototype to engineering

1. The reproducibility problem

An LLM prototype that "works great in the demo" but fails during the stakeholder review, or produces different output every run, is worse than useless — it erodes trust in the technology. Reproducibility is not optional.

The demo anti-pattern
You run the prototype 20 times to find the 1 run that looks impressive, screenshot it, and present it. This is common and it destroys credibility. Stakeholders will ask to see it live and it will fail.

2. What to pin for reproducibility

Model version
Always pin the exact model version string, not an alias. gpt-4o-2024-08-06 not gpt-4o. Aliases point to whatever the provider considers "current" — and it changes without warning. A model version bump can change behavior significantly.
Temperature
For reproducible output, use temperature=0 (deterministic mode). The model will still vary slightly across provider infrastructure, but output will be far more consistent. Use temperature > 0 only for creative tasks where variation is desirable.
Seed
OpenAI's API supports a seed parameter. When specified with temperature=0, the same seed produces identical output. Set seed=42 (or any fixed value) for full reproducibility in demos and evals.
Prompt version
Every prompt change is a version. Tag your prompt as v1.0, commit to git, and include the version in your demo notes. If a demo goes wrong, you can check out the exact prompt that was used.
What to record for every prototype run
Keep a simple text file or doc alongside your prototype that captures: the exact model version string (e.g., gpt-4o-2024-08-06), the temperature setting (0 for demos), the seed value if used, the prompt version tag, and the max output token limit. Log this at the top of every output you share. When a demo goes wrong two weeks later, you will be grateful you can reproduce the exact conditions.

3. Token cost estimation before you build

Build a cost model before writing a single API call. This shapes your architecture decisions and prevents budget surprises. The math is simple — you just need to commit to doing it.

Worked example — RAG-backed support chatbot

Assume you are using GPT-4o at approximately $5 per million input tokens and $15 per million output tokens (2025 pricing). Each conversation turn has these components:

ComponentTokensNotes
System prompt~500Static instructions, sent every call
Retrieved RAG chunks~1,5003 chunks × 500 tokens each
User question~50Typical short question
Model response (output)~300A paragraph-length answer

Total input per call: 2,050 tokens. Total output: 300 tokens. Cost per call: (2,050 × $5 / 1,000,000) + (300 × $15 / 1,000,000) = $0.0153 per conversation turn. At 1,000 queries per day, that is ~$460/month. At 10,000 queries per day, ~$4,600/month. These numbers should inform your pricing, tier limits, and model selection before you write a single line of code.

PM checklist before any API call
1. How many tokens is my system prompt? (count it)
2. How many tokens of context am I injecting per call? (RAG chunks, history)
3. What is my expected output length?
4. At target query volume, what is the monthly cost?
5. Is there a cheaper model that achieves the same quality for this task?

Model cost vs quality tradeoffs (2025)

TaskTry firstUpgrade to if needed
Simple classification, routingGPT-4o mini / Claude HaikuGPT-4o
SummarizationGPT-4o miniGPT-4o
RAG question answeringGPT-4o miniGPT-4o
Complex reasoning, analysisGPT-4oo3, Claude 3 Opus
Code generationGPT-4oo3, Claude 3.7 Sonnet
Long document processingGemini 1.5 ProClaude 3.5 Sonnet (200K)

4. Demo script structure

A demo without a script becomes an improvised performance. Write the script before the demo.

1

State the problem (30 sec)

"Today, support agents take 4 minutes to find the right article for a customer question. We want to cut that to 30 seconds."

2

Show the baseline (1 min)

Show the current experience — the 4-minute manual lookup. This is the before state. Do not skip this; without it, the demo has no impact.

3

Run the prototype on your curated inputs (3–5 min)

Use 3 specific inputs you have tested and know work well. Show the best case, a medium case, and one graceful failure ("I don't have information on that").

4

Quantify what you saw (30 sec)

"On these 3 cases, we went from 4 minutes to under 30 seconds. On our eval set of 50 real tickets, we hit 87% accuracy." Use your eval data.

5

State the next step and open risks (1 min)

What is the next unknown to de-risk? "We need to test on adversarial inputs and integrate with the ticketing API." Name the risks proactively — it shows rigor.

5. Prototype to production handoff

A prototype proves feasibility. To hand off to engineering, you need to provide the right artifacts.

Handoff checklist

← Chatbots
Practice → Week 11 Next: Agents & launch →

Test your understanding

Why is pinning the exact prompt version important in a prototype demo?v
LLMs are non-deterministic and providers update models silently. Pinning the model version, temperature, and exact system prompt makes the demo reproducible — you can re-run it and get the same result.
What is a 'demo script' and why is it essential for AI prototype demos?v
A demo script is a fixed set of inputs that you know produce good outputs from your current model and prompt. Without it, live demos depend on luck with unpredictable outputs — and live demos always go wrong eventually.
How do you budget for token costs during a prototype phase?v
Estimate: (avg input tokens per query) x (queries per day) x (cost per 1K tokens) + same for output. 10 users, 50 queries/day, 1500 tokens/query at $0.01/1K = ~$225/month. If prototyping costs are already high, the production architecture will be unsustainable.
What is the difference between a prototype and an MVP for an AI feature?v
A prototype answers a question ('does this AI approach work?') — it may use hardcoded inputs and no real data pipeline. An MVP is the smallest shippable version with real users, real data, monitoring, and the ability to iterate.
How do you demonstrate uncertainty handling in a prototype?v
Include at least one input in your demo script that the model cannot reliably answer, and show how the system handles it gracefully ('I'm not sure', or explicit escalation). Demonstrating graceful failure is as important as demonstrating success.

Further reading & watching