# AISim: AI System Design Simulator > A free, interactive simulator for learning AI system design. Build RAG pipelines, agents and LLM apps from parts, push realistic traffic through them, and learn to fix rate limits, hallucinations, latency, cost and more. 33 scenarios, 34 lessons and a 129-term glossary in plain English. AISim teaches AI engineering through hands-on scenarios. Each scenario starts with a broken AI system and a goal (accuracy, latency, cost, error rate...). The simulator shows the "binding pressure", the one limit hurting the system right now, and the learner adds or tunes components until every goal holds. It's free, runs in the browser, calls no real models, and is open source. ## Key pages - [Simulator](https://ai-system-simulator.vercel.app/): the interactive app (scenarios, Learn section, glossary) - [Full content for LLMs](https://ai-system-simulator.vercel.app/llms-full.txt): every scenario, lesson and glossary term as Markdown - [Source code](https://github.com/cybernerdie/ai-system-simulator) - [Author: Joshua Paul](https://joshuapaul.me) Built by [Joshua Paul](https://joshuapaul.me) ([cybernerdie](https://github.com/cybernerdie) on GitHub). ## Frequently asked questions ### What is AISim? AISim is a free, browser-based simulator for learning how to design AI systems. You build an AI app from parts (models, vector databases, rerankers, guardrails, caches, agents), send realistic traffic through it, and see which part breaks first. No real models are called, and nothing to install. ### What is binding pressure in AI system design? Binding pressure is the single limit hurting your system right now: a rate limit, retrieval misses, prompt injection, latency, cost, a full context window, or GPU capacity. Fixing anything else doesn't help until that limit is relieved. AISim shows the binding pressure live and explains it in plain language. ### Who is AISim for? Software engineers moving into AI engineering, product managers and founders who want to understand how LLM apps behave in production, and anyone preparing for AI system design interviews. The lessons start from zero and build up to inference, agents and production reliability. ### What topics does AISim cover? Retrieval-augmented generation (RAG), chunking and hybrid search, reranking, conversation memory, rate limits and scaling, streaming and latency, caching, model routing, prompt injection (direct and indirect) and guardrails, agent permissions, temperature and sampling, evals and LLM-as-judge, self-hosted inference on GPUs, provider outages and failover, multi-agent systems, reasoning budgets, structured outputs, fine-tuning versus RAG, model version drift, privacy and PII, voice pipelines and per-user abuse limits. ### When should I fine-tune a model instead of using RAG? Use RAG for knowledge: facts and documents that change. Use fine-tuning for behaviour: your labels, output format, tone, or a narrow task repeated many times. A fine-tuned small model often beats a large general model on a narrow task at a fraction of the cost, but it should still get its facts from retrieval. ### Why does my RAG chatbot give confidently wrong answers? Usually retrieval is returning the wrong chunks: chunks that are too large or small, too few results (top-K), or pure vector search missing exact identifiers like product codes. Hybrid search (vector plus keyword/BM25), a reranker and better chunking fix most of it. AISim scenario 2, "Confidently wrong RAG", lets you try each fix. ### How does the game work? There are 33 levels in six chapters, and each chapter ends with a boss level that mixes everything it taught. Every level hands you a broken AI system; clear it to unlock the next and earn up to three stars for staying within budget and building lean. There is also a daily challenge (the same remixed level for everyone, every day), an endless incident mode where outages, traffic spikes and attacks hit your system, a sandbox where you can build anything and turn it into a level to share, and achievements with a certificate for clearing every level. ### Is AISim free and open source? Yes. AISim is free to use in the browser and open source on GitHub. It was built by Joshua Paul (cybernerdie), a Senior Fullstack and Applied AI Engineer. Your progress is saved in your browser, and you can share any design you build as a link. ## Scenarios - **1 · The store chatbot** (Intro): It sounds confident. It's making things up. Teaches RAG, Grounding. - **2 · The wrong error code** (Core): Retrieval is on. Answers are still wrong. Teaches Hybrid search, Chunking, Reranking. - **3 · The holiday rush** (Core): It works. Now 40× more people want it. Teaches Semantic cache, Model routing, Rate limits. - **4 · Where's my order?** (Core): Users want things done, not explained. Teaches Agents, Step budgets, Cost. - **5 · The refund trick** (Core): "Ignore previous instructions and…" Teaches Prompt injection, Guardrails. - **6 · The contract reviewer** (Advanced): Every answer is buried in a 90-page PDF. Teaches Context windows, Reranking, Cost. - **7 · "It feels slow"** (Advanced): Users stare at a spinner for eight seconds. Teaches Streaming, Time to first token. - **8 · The chat that never ends** (Advanced): Memory optimization: it either forgets what you said, or costs a fortune. Teaches Memory optimization, Stateless models, Cost. - **9 · Flying blind** (Core): Costs are down 95%. Is anything else down? Teaches Evals, LLM-as-judge, Observability. - **10 · Bring it in-house** (Advanced): We moved off the API to save money. Now everything times out. Teaches Self-hosting, Batching, Quantization, GPU capacity. - **11 · The provider is down** (Core): 503, 503, 503. Your status page is getting traffic. Teaches Outages, Retries, Failover. - **12 · The research assistant** (Advanced): One agent, twenty tabs open, forty seconds per answer. Teaches Multi-agent, Orchestration, Hand-offs. - **13 · Think harder?** (Core): The hard questions keep coming back wrong. Teaches Reasoning models, Thinking budgets, Model routing. - **14 · It broke the parser** (Intro): One in nine responses crashes your code. Teaches Structured outputs, JSON mode, Validation. - **15 · Yesterday's answers** (Core): The price changed on Monday. The bot still quotes the old one. Teaches Data ingestion, Index freshness, Document parsing. - **16 · The 20-page system prompt** (Intro): Every request re-reads the whole manual. Teaches Prompt caching, Cost, Latency. - **17 · The nightly job ate the day** (Core): A million tickets to summarise, and live users get 429s. Teaches Batch APIs, Async workloads, Rate limits. - **18 · Fine-tune it?** (Core): Your labels, your format, your 40 categories. Teaches Fine-tuning, RAG vs fine-tuning, Cost. - **19 · Nothing changed. Everything broke.** (Core): No deploy, no code change, and quality fell off a cliff. Teaches Model versions, Regressions, Evals. - **20 · Compliance is calling** (Intro): Half your prompts contain someone's medical history. Teaches Privacy, PII redaction, Compliance. - **21 · The walkie-talkie** (Core): Talk. Wait seven seconds. Hear a reply. Teaches Voice, Speech-to-text, Streaming. - **22 · One user, half your bill** (Intro): A few scripted accounts are eating everyone's capacity. Teaches Abuse, Per-user limits, Cost control. - **23 · Same question, different answers** (Intro): Upload the same invoice twice, get two different totals. Teaches Temperature, Sampling, Determinism. - **24 · The evals say it's fine** (Advanced): The dashboard says 98%. Support says otherwise. Teaches Evals, LLM-as-judge, Test sets. - **25 · The email that hijacked the agent** (Advanced): Nobody attacked the chat. They emailed the agent. Teaches Indirect prompt injection, Least privilege, Human approval. - **26 · Right answer, wrong question** (Core): Fast and cheap, and sometimes answering something else. Teaches Debugging, Semantic cache, Similarity threshold. - **27 · The goldfish** (Core): "As I said two minutes ago..." Teaches Debugging, Conversation memory. - **28 · Safe and useless** (Intro): No jailbreak has got through. Neither have many customers. Teaches Debugging, Guardrails, False positives. - **29 · It found it, then threw it away** (Core): Recall looks fine. The answers don't. Teaches Debugging, Reranking, Context. - **30 · Overthinking "hello"** (Core): The bill went up sevenfold after someone made it smarter. Teaches Debugging, Reasoning budget, Cost. - **31 · The key was in the app** (Core): Per-user limits are on. The bill doubled anyway. Teaches Authentication, API keys, Cost control. - **32 · Why did it say that?** (Core): A customer has a screenshot. You have nothing. Teaches Tracing, Observability, Sampling. - **33 · The average looks fine** (Advanced): Fine on average. Not for everyone. Teaches Fairness, Cohort evals, Multilingual. ## Learning modules - **Module 1: Foundations** (Beginner): What a model is, what it sees, and why it makes things up. Lessons: What an AI app really is; How models are made; Prompts: the only thing a model sees; Tokens, context windows and cost; Temperature and sampling; Why models make things up. - **Module 2: Giving models knowledge** (Beginner): Let the model look things up, and make sure it finds the right page. Lessons: RAG: letting the model look things up; Getting retrieval right; Ingestion: what goes into the index. - **Module 3: Memory and conversations** (Intermediate): Why chatbots forget, and how to remember without going broke. Lessons: Why chatbots forget, and why remembering gets expensive; Memory that scales. - **Module 4: Getting reliable answers** (Intermediate): Make models think harder when it matters, return output your code can trust, and know when to fine-tune. Lessons: Reasoning models: paying to think; Structured outputs: answers your code can trust; Prompting, RAG or fine-tuning?. - **Module 5: Running in production** (Intermediate): Rate limits, cost and speed once real users arrive. Lessons: Scaling: rate limits, caching and routing; Latency and streaming; Protecting your capacity from abuse. - **Module 6: Beyond text: voice and images** (Intermediate): Multimodal input, and building voice assistants that feel like a conversation. Lessons: Voice, images and audio. - **Module 7: Inference: how models actually run** (Intermediate): Prefill and decode, prompt caching, GPUs and batching, self-hosting, batch APIs, and staying up when providers fail. Lessons: What happens when you call a model; Prompt caching: stop paying to re-read; Serving models on GPUs; API or your own GPUs?; Batch and async: not everything is urgent; When the provider goes down. - **Module 8: Agents and multi-agent systems** (Advanced): Letting models take actions, splitting work across agent teams, and keeping them on a leash. Lessons: Agents and tools; When one agent isn't enough; Making agent teams work. - **Module 9: Safety** (Advanced): Attacks on your prompt, including ones hidden in what your system reads, the layers that stop them, and keeping personal data safe. Lessons: Prompt injection and guardrails; Indirect prompt injection; Privacy and personal data. - **Module 10: Thinking like an AI engineer** (Advanced): Measuring quality, and the debugging loop that ties it all together. Lessons: Evals: you can't fix what you can't see; Building evals you can trust; When the model changes under you; Binding pressure: how to debug any AI system.