Skip to content
AI360Xpert
Cheat Sheets
Cheat sheet

Generative AI

A practical reference for LLMs, prompting, RAG, agents, fine-tuning, evaluation, and production systems

Generative AI
A practical reference for LLMs, prompting, RAG, agents, fine-tuning, evaluation, and production systems
GENERATIVE AI FUNDAMENTALS
A high-density reference guide for engineers and technical practitioners working with Generative AI.
Key concepts
  • Generative AI & Large Language Models
  • Tokens & Context window
  • Parameters & Embeddings
  • Attention & Transformers
  • Pretraining & Instruction tuning
  • Alignment & Inference

Mental model
Input → tokenization → model inference → generated tokens → post-processing
PROMPT ENGINEERING
Core techniques
  • Zero-shot & Few-shot prompting
  • Role & Structured prompting
  • Delimiters & Output constraints
  • Chain-of-thought-aware task design
  • Self-consistency & Prompt decomposition
  • Critique and refinement
  • Retrieval-augmented prompting
Prompt template
Role:
You are a [ROLE].

Task:
Complete [TASK].

Context:
[RELEVANT CONTEXT]

Constraints:
- [CONSTRAINT 1]
- [CONSTRAINT 2]

Output format:
[EXPECTED FORMAT]

Quality requirements:
[QUALITY CRITERIA]
MODEL SELECTION
  • Reasoning ability & Context length
  • Latency & Cost
  • Multimodal & Tool calling support
  • Structured output & Privacy
  • Hosting & Fine-tuning support
Decision pattern
Use the smallest model that reliably satisfies the task.
EMBEDDINGS & VECTOR DATABASES
Embeddings Use Cases
  • Semantic search
  • Retrieval & Clustering
  • Recommendations
  • Similarity matching
  • Duplicate detection
Vector Databases
  • Collections/indexes & Vectors
  • Metadata & Similarity search
  • Filtering & ANN search
  • Hybrid search

DecisionConsideration
Chunk size/overlapContext vs precision
Distance metricCosine vs L2
ScaleCloud vs on-prem
FUNCTION CALLING & TOOL USE
User request → model decides tool → tool invocation → tool result → model response
Good tool definition
  • Clear name & explicit inputs
  • Strict schema
  • Useful descriptions
  • Error handling
  • Authorization checks
AI AGENTS
Observe → reason/decide → act → observe result → continue/finish
  • <b>Use when:</b> multi-step workflow, dynamic tool usage, needs state/iteration
  • <b>Avoid when:</b> deterministic logic or simple API call suffices
FINE-TUNING
Consider when:
  • Behavior must be highly consistent
  • Specialized style is required
  • Repeated examples exist
  • Prompting alone is insufficient
Do not use primarily to inject frequently changing knowledge. Prefer retrieval.
EVALUATION
Evaluation dimensions
  • Correctness
  • Relevance
  • Faithfulness
  • Groundedness
  • Helpfulness
  • Latency
  • Cost
  • Safety
RAG evaluation
  • Retrieval recall &amp; Precision
  • Context relevance
  • Answer correctness
  • Citation accuracy
GUARDRAILS & OBSERVABILITY
  • Input/Output validation
  • Prompt injection detection &amp; PII filtering
  • Access control &amp; Tool authorization
  • Content moderation &amp; Rate limiting
Track: Request ID, Model, Tokens, Latency, Retrieval results, Errors, Cost.
PRODUCTION & MISTAKES
Production Checklist
  • Define evaluation dataset
  • Establish quality thresholds
  • Add logging, monitoring, guardrails
  • Secure secrets &amp; test failures
Common Mistakes
  • Using LLM instead of deterministic logic
  • Sending excessive context
  • Ignoring retrieval quality
  • Evaluating only final answers
  • Skipping security testing
  • Ignoring latency and cost
QUICK DECISION GUIDE
Need...Use...
Current external knowledge?RAG
Consistent specialized behavior?Fine-tuning
Dynamic API/tool interaction?Tool calling / Agent
Semantic search?Embeddings
Predictable output?Structured output
High reliability?Eval &amp; Guardrails