Free demoJob-oriented courses at Debugshala, Old Palasia, Indore. Freshers, non-IT and year-gap welcome.Book a free demo +91-8982385539

Generative AI Tutorials

All tutorials

61 free tutorials, in the order we recommend reading them.

LLM Fundamentals · Generative AI Foundations

What is an LLM? How Large Language Models Actually Work

Learn what an LLM is: tokens, next-token prediction, training vs inference, context windows and temperature, with a runnable bigram text generator in Python.

10 min read

Tokenization Explained: How LLMs Split Text into Tokens

Learn how LLM tokenization works: subwords, byte-pair encoding, token IDs and why Hindi costs more tokens. Train a tiny BPE tokenizer in Python.

10 min read

Embeddings Explained: How AI Turns Meaning into Vectors

Embeddings explained simply: words and sentences as vectors, cosine similarity in numpy, a bag-of-words baseline and how semantic search ranks results.

8 min read

Transformers and Attention Explained: How LLMs Read Context

Understand the transformer behind every LLM: queries, keys and values, the causal mask, multi-head attention and transformer blocks, with numpy code.

10 min read

How LLMs Are Trained: Pretraining, SFT and RLHF Explained

See how LLMs are trained in stages: pretraining, supervised fine-tuning, RLHF and DPO, and reasoning RL, with the loss behind each stage in Python.

10 min read

Mixture of Experts (MoE) Explained: How Sparse LLMs Work

Mixture of experts explained: how a router picks experts, total vs active parameters, load balancing, and why MoE LLMs still need lots of memory.

10 min read

LLM Generation Parameters: Temperature, Top-p, Top-k Guide

A practical guide to LLM generation parameters: temperature, top-k, top-p, min-p, penalties, max tokens and stop sequences, with settings by task.

11 min read

LLM Decoding Strategies: Greedy, Beam Search and Sampling

Compare LLM decoding strategies: greedy decoding, beam search, sampling, constrained and speculative decoding, with runnable Python toy examples.

11 min read

How to Run LLMs Locally: Ollama, llama.cpp and LM Studio

Run LLMs locally step by step with Ollama, LM Studio or llama.cpp. Check speed and memory for your laptop and call a local model from Python.

11 min read

Prompting and Context · Prompt and Context Engineering

RAG Tutorial · Retrieval-Augmented Generation

What is RAG? Retrieval-Augmented Generation Explained Simply

What is RAG? Learn retrieval-augmented generation step by step: chunking, indexing, retrieval and prompt augmentation, with a runnable TF-IDF demo in Python.

9 min read

Vector Databases Explained: How RAG Stores and Finds Embeddings

What a vector database stores, how IVF and HNSW indexes speed up search, why metadata filters matter, and when numpy, Chroma or pgvector is enough for RAG.

12 min read

RAG Chunking Strategies: Fixed, Recursive, Semantic and More

Compare five RAG chunking strategies with runnable Python: sentence, recursive, heading-based and semantic splitting, plus a test that measures retrieval hits.

13 min read

Hybrid Search and Re-ranking for RAG: BM25, RRF, Cross-Encoders

Learn hybrid search for RAG: BM25 written by hand, Reciprocal Rank Fusion, weighted fusion and cross-encoder re-ranking, with runnable Python and a recipe.

13 min read

Advanced RAG Architectures: Rewriting, Routing, Corrective RAG

Advanced RAG architectures explained: query decomposition, routing, small-to-big retrieval, corrective RAG, GraphRAG and agentic RAG, and when to use each.

12 min read

HyDE in RAG: Hypothetical Document Embeddings Explained

HyDE explained: search with an LLM-written hypothetical answer instead of the question. See why it works, when it drifts, and how to anchor it in Python.

11 min read

RAG vs CAG: Cache-Augmented Generation vs Retrieval Explained

RAG vs CAG compared: how cache-augmented generation preloads a KV cache, when the knowledge fits, memory and token maths in Python, and hybrid designs.

11 min read

RAG Evaluation: Metrics to Test Retrieval and Answer Quality

How to evaluate a RAG system: hit rate, recall@k, MRR, faithfulness and answer relevance, a golden question set, LLM judges and a repeatable test loop.

11 min read

Hugging Face and Fine-tuning · Hugging Face and Open Models

Hugging Face Tutorial: Hub, Transformers, Pipelines and Spaces

Learn Hugging Face step by step: the Hub, model cards and licences, tokenizers, pipeline(), AutoModel, datasets, hosted inference and Gradio Spaces.

11 min read

Open-Source LLMs Explained: Sizes, Quantisation and Licences

Open-source LLMs explained: open-weight vs closed models, parameter sizes, what fits on a laptop, 4-bit quantisation maths, GGUF and ONNX, and licences.

11 min read

Fine-Tuning LLMs with LoRA: When, Why and How It Works

When to fine-tune an LLM instead of prompting or RAG, how LoRA and QLoRA work, how to prepare instruction data, and a transformers plus peft example.

12 min read

Prompting vs RAG vs Fine-tuning: How to Choose for an LLM App

Prompting vs RAG vs fine-tuning: diagnose failures first, compare cost per month, and learn when to combine them, with runnable Python decision tools.

10 min read

Instruction Dataset Creation for LLM Fine-tuning: Practical Guide

Build an instruction fine-tuning dataset: coverage grids, synthetic data, quality filters, near-duplicate removal and group splits, with Python and TRL code.

10 min read

SFT vs RLHF vs GRPO: Choosing an LLM Post-training Method

Compare SFT, RLHF, DPO and GRPO: training signals, data, compute and when to use each, with runnable DPO loss and GRPO advantage code plus TRL examples.

11 min read

Gradio and Hugging Face Spaces: Build a Streaming LLM Demo

Build an LLM chat demo with Gradio 6 and deploy it on Hugging Face Spaces: streaming replies, chat history, secrets, ZeroGPU and calling it from Python.

11 min read

Build an LLM from Scratch · Build an LLM: Plan and Data

Build an LLM from Scratch · Build an LLM: Training

Build an LLM from Scratch · Build an LLM: Evaluate and Ship

LLMOps and MLOps · MLOps

What is MLOps? A Beginner's Guide to Machine Learning Operations

MLOps explained for beginners: why models fail quietly after launch, what an MLOps system includes, MLOps vs DevOps, and three maturity levels, with Python.

10 min read

ML Lifecycle: The 8 Stages of a Machine Learning System

The machine learning lifecycle in 8 stages, from metric and baseline to monitoring and retraining, with runnable Python showing why time-based splits matter.

10 min read

ML Reproducibility and Versioning: Data, Code, Seeds, Models

Make ML models reproducible: version code, data, config, environment and model files. Hash data in Python, fix seeds, and use DVC and the MLflow registry.

10 min read

Data Pipelines for ML: ETL, Validation and Train/Serve Skew

Build a data pipeline for machine learning: extract, validate, transform, load, idempotent backfills, Airflow scheduling, and a runnable train/serve skew demo.

10 min read

Feature Stores and Data Leakage: Point-in-Time Correct ML

What a feature store is, how data leakage inflates scores, and how point-in-time joins with pandas merge_asof and Feast keep training and serving consistent.

10 min read

ML Model Deployment: Serve a Model as a REST API with FastAPI

Deploy an ML model as an API: choose batch or online serving, serialise with joblib, validate input with FastAPI and Pydantic, and release by shadow or canary.

11 min read

Docker for Machine Learning: Package and Ship a Model API

Docker for machine learning: write a Dockerfile for a FastAPI model, use layer caching, keep images small and safe, tag by model version, and run Compose.

10 min read

Kubernetes for ML Engineers: Deploy and Scale a Model API

Kubernetes for ML: Deployments, Services, readiness probes and HPA autoscaling for a model API, with YAML, kubectl commands and Python simulations you can run.

11 min read

ML Model Monitoring and Data Drift: PSI, KS Test and Alerts

Monitor ML models in production: data drift vs concept drift, PSI and KS statistics computed by hand in Python, delayed labels, Evidently and Prometheus alerts.

11 min read

CI/CD for Machine Learning: Tests, Quality Gates and Releases

CI/CD for machine learning: unit, data and behavioural tests, a quality gate against the champion model, a GitHub Actions workflow, canary release and CT.

11 min read

LLMOps and MLOps · LLMOps

What is LLMOps? Running LLM Apps in Production, Explained

LLMOps explained: how it differs from MLOps, the lifecycle from prompt change to traced production, token-cost maths and a release gate, with runnable Python.

10 min read

LLM Evaluation Methods: Metrics, Golden Sets and a Python Harness

Evaluate LLM apps: exact match, token F1 and rubric scoring in Python, building a golden set, a bootstrap check for real gains, and a DeepEval G-Eval example.

10 min read

LLM-as-a-Judge: Rubrics, Biases and Cohen's Kappa Calibration

LLM-as-a-judge explained: single, pairwise and reference grading, JSON judge prompts, position bias, and calibration against humans with Cohen's kappa.

10 min read

Red Teaming LLM Apps: Attack Suites, Success Rates and Fixes

Red team an LLM chatbot: build a threat model, generate attacks from seeds and strategies, score attack success rate in Python, and automate with promptfoo.

10 min read

KV Cache Explained: How LLMs Reuse Attention and Use GPU Memory

What the KV cache is, why it makes LLM generation fast, prefill vs decode, a numpy speed-up demo, and the formula for KV cache memory with GQA and 8-bit caches.

10 min read

LLM Inference Optimization: Batching, Quantisation and Speed

LLM inference optimization: TTFT and TPOT, why decoding is memory-bound, continuous batching and speculative decoding simulated in Python, and a tuning order.

10 min read

vLLM Tutorial: Serve LLMs with PagedAttention and an OpenAI API

Serve LLMs with vLLM: how PagedAttention works, vllm serve flags, OpenAI client calls, capacity planning maths, Docker, vllm bench serve and Prometheus metrics.

10 min read

LLM Observability and Tracing: Spans, Latency, Cost, Feedback

LLM observability explained: traces and spans, what to log, PII masking, p95 latency, cost by prompt version, and OpenTelemetry GenAI and Langfuse tracing code.

10 min read

LLMOps and MLOps · Career Guide