LLM Development Cheat Sheet: Key Terms, Settings, Patterns, Formulas and Checklists in One Page
Key Terms
| Term | Meaning |
|---|---|
| Token | Small piece of text the model reads |
| Context window | Token limit for one request |
| Embedding | Vector that represents meaning |
| RAG | Retrieve text, then generate a grounded answer |
| Agent | Loop of think, act and observe using tools |
| LoRA | Train small adapters, freeze the base |
| MCP | Open standard for connecting AI apps to tools and data |
| Hallucination | Confident but unsupported output |
Settings
| Setting | Rule of thumb |
|---|---|
| temperature | Low for facts and code, higher for ideas |
| top-p / top-k | Limit unlikely tokens |
| max tokens | Cap reply length and cost |
| stop sequences | End output at a marker |
Prompt Checklist
- Task, context, rules, format, examples
- Say what to do, not only what to avoid
- Ask for JSON and validate it
- Version prompts and keep tests
API Pattern
- Send messages with history
- Stream long replies
- Retry only temporary errors with backoff
- Set timeouts and limits
- Keep keys in environment variables
RAG Steps
- Ingest and clean
- Chunk with overlap and metadata
- Embed and store
- Retrieve (hybrid, filter, rerank)
- Build a grounded prompt with citations
- Answer or say I do not know
- Evaluate retrieval and answers
Useful Formulas
| Formula | Use |
|---|---|
| tokens ~ characters / 4 | Rough English token estimate |
| cost = in x price_in + out x price_out | Per request cost |
| weights GB = params (billions) x bits / 8 | Weight memory |
| LoRA params = r x (d + k) | Adapter size per matrix |
| KV cache = 2 x layers x kv_heads x head_dim x tokens x bytes | Cache memory per sequence |
| hit@k = questions with right chunk in top k / total | Retrieval quality |
Agent and Security Rules
- Allow list and argument validation
- Step and cost budgets
- Human approval for risky actions
- Treat tool and document text as untrusted
- Least privilege for keys and tools
- No secrets in prompts
Launch Checklist
- Evaluation set passes
- Injection and leak tests done
- Budget alerts set
- Timeouts, retries and fallback tested
- Logs redacted and owner on call
- Rollback plan ready
Conclusion
Keep this page open while you build. Everything here is explained in the lessons.
Quick Summary: Terms; settings; patterns; formulas; checklists.

