A comprehensive, commercial-grade platform for mastering Generative AI, Large Language Models, and Multimodal Systems
What This Offers • Installation • Notebooks • Quick Start • Documentation
This Generative AI Course is your complete, production-ready toolkit for mastering modern AI. Whether you're a beginner or an experienced practitioner, this platform provides everything you need:
- 177+ Hands-On Jupyter Notebooks: Interactive tutorials covering every aspect of Generative AI
- Step-by-Step Guides: From basic NLP to advanced multimodal models
- Real-World Examples: Practical implementations you can use immediately
- Progressive Learning Path: Organized curriculum from fundamentals to advanced topics
- Production-Ready Code: Deploy LLMs with our FastAPI inference server
- Fine-Tuning Recipes: Train Llama, Mistral, Gemma, and more with LoRA/QLoRA
- Optimization Techniques: Quantization (4-bit/8-bit), model compression, efficient inference
- Enterprise Tools: Automated build system, testing, CI/CD integration
- Commercial License: Apache 2.0 - free for commercial use
- Deployment Solutions: Production servers with streaming, health checks, monitoring
- Scalable Architecture: Multi-worker deployment, load balancing, Docker-ready
- Professional Standards: PEP 8 compliant, type-hinted, fully documented
- Fine-tune Large Language Models for your specific use case
- Deploy production LLM inference servers with streaming responses
- Create multimodal AI applications combining vision and language
- Build RAG (Retrieval Augmented Generation) systems
- Optimize models for consumer hardware with quantization
- Implement diffusion models for image generation
The Generative AI Course is a production-ready educational platform designed for Data Scientists, ML Engineers, and AI enthusiasts to master the complete spectrum of Generative AI technologies. This repository combines theoretical foundations with hands-on implementation, offering 177+ Jupyter notebooks, production-ready Python modules, and deployment solutions for real-world applications.
- Production-Ready Code: All modules follow industry best practices with comprehensive type hints, docstrings, and error handling
- Modern Development Stack: Built with
uvpackage manager, automated testing, and CI/CD-ready infrastructure - Comprehensive Coverage: From fundamentals to advanced topics including LLMs, diffusion models, multimodal systems, and deployment
- Hands-On Learning: 177+ interactive notebooks covering every aspect of Generative AI
- Enterprise Deployment: Production FastAPI servers, quantization, and optimization techniques
- Open Source: Apache 2.0 licensed for commercial and educational use
# 1. Clone the repository
git clone https://github.com/ruslanmv/Generative-AI-Course.git
cd Generative-AI-Course
# 2. Install Jupyter and core dependencies
pip install jupyter notebook ipykernel
# 3. Start exploring!
jupyter notebookIf you want to use the production FastAPI server and development tools:
# Install uv package manager (faster than pip)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install all dependencies
make install-all
# Or manually with pip
pip install -e ".[all]"Each notebook may require specific dependencies based on the model or technique it demonstrates:
- Most notebooks are self-contained and will install their required packages in the first cell
- Some notebooks require GPU with CUDA support (check the notebook introduction)
- Cloud notebooks (marked with Colab badges) can run for free on Google Colab
- Large models may need 16GB+ RAM or cloud resources
Before running a notebook:
- Open the notebook and check the first few cells for dependency installation
- Run the pip install commands provided in the notebook
- Some notebooks include
!pip install package_name- these will auto-install
Common notebook-specific dependencies:
- Fine-tuning notebooks:
transformers,peft,trl,bitsandbytes - Quantization notebooks:
auto-gptq,llama-cpp-python,exllamav2 - Multimodal notebooks:
weaviate-client,opencv-python,scikit-image - Diffusion notebooks:
diffusers,controlnet_aux
💡 Tip: Start with the notebooks in order - early notebooks often explain dependency installation for the entire section.
All notebooks are directly accessible by clicking the links below. Each notebook is self-contained with installation instructions.
Create custom datasets for fine-tuning LLMs from documents, topics, or existing data.
| Notebook | Description | Link |
|---|---|---|
| Documents → Dataset | Generate instruction/QA datasets from your documents | Open Notebook |
| Topic → Dataset | Create datasets from a topic or domain | Open Notebook |
| Alpaca Dataset Generator | Original Alpaca-style instruction dataset creation | Open Notebook |
| News Classification Dataset | Create classification datasets with GPT-3.5 | Open Notebook |
| Translation Dataset (Bilingual) | Prepare bilingual translation datasets | Open Notebook |
| Translation Dataset (Multi-lang) | Translation between multiple languages | Open Notebook |
| Romanized Indic Languages | Translation to romanized Indic languages | Open Notebook |
| DPO Dataset Formatting | Format datasets for Direct Preference Optimization | Open Notebook |
| DPO Translation Dataset | Create DPO datasets for translation tasks | Open Notebook |
| Instruction Dataset Prep | Prepare instruction-following datasets | Open Notebook |
| Create Custom Dataset | General dataset creation utilities | Open Notebook |
| Translation Dataset Creator | Build translation training datasets | Open Notebook |
| Translation Inference | Test translation models on single examples | Open Notebook |
| Combine Translations | Merge and combine translation datasets | Open Notebook |
| Kannada Dataset Merger | Merge Kannada language datasets | Open Notebook |
| LLaVA Image Prep | Prepare image datasets for LLaVA training | Open Notebook |
| Aarogya Formatting | Format Aarogya medical datasets | Open Notebook |
Master parameter-efficient fine-tuning with LoRA, QLoRA, SFT, DPO, and ORPO.
| Notebook | Model | Technique | Framework | Link |
|---|---|---|---|---|
| Llama 2 SFT (Google Colab) | Llama 2 7B | SFT | Transformers | Open Notebook |
| Llama 2 QLora | Llama 2 7B | QLora | PEFT | Open Notebook |
| Llama 3 ORPO | Llama 3 8B | ORPO | TRL | Open Notebook |
| Llama 3 Alpaca (Unsloth) | Llama 3 8B | SFT | Unsloth | Open Notebook |
| Mistral 7B SFT | Mistral 7B | SFT | TRL | Open Notebook |
| Mistral 7B DPO | Mistral 7B | DPO | TRL | Open Notebook |
| Mistral 7B (Unsloth) | Mistral 7B | SFT | Unsloth | Open Notebook |
| Mistral Fine-tuning | Mistral 7B | SFT | Transformers | Open Notebook |
| Gemma SFT | Gemma 7B | SFT | Transformers | Open Notebook |
| Gemma (Unsloth) | Gemma 7B | SFT | Unsloth | Open Notebook |
| Gemma Fine-tuning | Gemma 2B/7B | SFT | Transformers | Open Notebook |
| Mixtral Fine-tuning | Mixtral 8x7B | SFT | Transformers | Open Notebook |
| Phi-3 (Unsloth) | Phi-3 3.8B | SFT | Unsloth | Open Notebook |
| TinyLlama + RoPE | TinyLlama | SFT + RoPE | Unsloth | Open Notebook |
| DPO Zephyr | Zephyr | DPO | Unsloth | Open Notebook |
| ORPO (Unsloth) | Various | ORPO | Unsloth | Open Notebook |
| Axolotl Framework | CodeLlama | SFT | Axolotl | Open Notebook |
Performance Gains: Unsloth notebooks achieve up to 3.9x faster training and 74% less memory usage compared to standard implementations.
Compress models to run on consumer hardware without significant quality loss.
| Notebook | Format | Description | Link |
|---|---|---|---|
| Introduction to Quantization | 8-bit | Foundation of weight quantization | Open Notebook |
| GPTQ Quantization | GPTQ | 4-bit quantization with GPTQ | Open Notebook |
| GGUF & llama.cpp | GGUF | Quantize for llama.cpp inference | Open Notebook |
| GGUF Quantization | GGUF | General GGUF quantization guide | Open Notebook |
| AWQ Quantization | AWQ | Activation-aware weight quantization | Open Notebook |
| ExLlamaV2 | EXL2 | Fastest inference with ExLlamaV2 | Open Notebook |
Production-ready deployment strategies and performance benchmarking.
| Notebook | Technology | Description | Link |
|---|---|---|---|
| Llama.cpp Python | llama.cpp | Inference with llama.cpp Python bindings | Open Notebook |
| vLLM Benchmark | vLLM | Benchmark vLLM performance | Open Notebook |
| TGI vs vLLM | TGI, vLLM | Compare Text Generation Inference vs vLLM | Open Notebook |
| Streaming Inference | Hugging Face | Implement streaming text generation | Open Notebook |
| FastAPI Server | FastAPI | Production server (see /Deployment/server.py) |
View Code |
Generate and manipulate images with state-of-the-art diffusion techniques.
| Notebook | Technique | Description | Link |
|---|---|---|---|
| Negative Prompts | Stable Diffusion | Control generation with negative prompts | Open Notebook |
| Image-to-Image | img2img | Transform images with diffusion | Open Notebook |
| Image Interpolation | Interpolation | Smooth transitions between images | Open Notebook |
| DiffEdit v1 | DiffEdit | Semantic image editing | Open Notebook |
| DiffEdit v2 | DiffEdit | Enhanced image editing | Open Notebook |
| DiffEdit v3 | DiffEdit | Advanced editing techniques | Open Notebook |
| DiffEdit v4 | DiffEdit | Latest DiffEdit improvements | Open Notebook |
Combine vision, language, and other modalities for advanced AI applications.
| Notebook | Topic | Description | Link |
|---|---|---|---|
| Overview of Multimodality | Introduction | Fundamentals of multimodal AI | Open Notebook |
| Multimodal Search | Search | Cross-modal search and retrieval | Open Notebook |
| Large Multimodal Models | LMMs | Understanding LMMs like GPT-4V | Open Notebook |
| Multimodal RAG | RAG | Retrieval with images and text | Open Notebook |
| Industry Applications | Applications | Real-world multimodal use cases | Open Notebook |
| Multimodal Recommender | Recommendation | Build multimodal recommendation systems | Open Notebook |
Automate common tasks with one-click tools.
| Notebook | Tool | Description | Link |
|---|---|---|---|
| AutoQuant | Quantization | Quantize to GPTQ, GGUF, AWQ, EXL2, HQQ in one click | Open Notebook |
| LazyMergekit | Model Merging | Merge models using MergeKit easily | Open Notebook |
| LazyAxolotl | Fine-tuning | Fine-tune in the cloud with Axolotl | Open Notebook |
| LLM AutoEval | Evaluation | Automatically evaluate LLMs with RunPod | Open Notebook |
| Model Family Tree | Visualization | Visualize merged model genealogy | Open Notebook |
| ZeroChat | Deployment | Create Gradio chat UI with ZeroGPU | Open Notebook |
Comprehensive collection covering every aspect of transformer-based models.
| Notebook | Task | Link |
|---|---|---|
| Text Classification | Classification | Open Notebook |
| Text Classification (TF) | Classification | Open Notebook |
| Token Classification | NER, POS tagging | Open Notebook |
| Question Answering | QA | Open Notebook |
| Summarization | Summarization | Open Notebook |
| Translation | Machine Translation | Open Notebook |
| Language Modeling | LM | Open Notebook |
| Language Modeling from Scratch | LM | Open Notebook |
| Notebook | Task | Link |
|---|---|---|
| Image Classification | Classification | Open Notebook |
| Image Similarity | Similarity | Open Notebook |
| Image Captioning (BLIP) | Captioning | Open Notebook |
| Image Captioning (Pix2Struct) | Captioning | Open Notebook |
| Semantic Segmentation | Segmentation | Open Notebook |
| Segment Anything | Segmentation | Open Notebook |
| Zero-Shot Object Detection | Detection | Open Notebook |
| Video Classification | Video | Open Notebook |
| Notebook | Task | Link |
|---|---|---|
| Audio Classification | Classification | Open Notebook |
| Speech Recognition | ASR | Open Notebook |
| Multi-Lingual Speech Recognition | ASR | Open Notebook |
| Notebook | Domain | Link |
|---|---|---|
| Time Series Transformers | Forecasting | Open Notebook |
| Multivariate Informer | Forecasting | Open Notebook |
| Protein Folding | Biology | Open Notebook |
| Protein Language Modeling | Biology | Open Notebook |
| DNA Sequence Modeling | Biology | Open Notebook |
| Annotated Diffusion | Diffusion | Open Notebook |
| Notebook | Topic | Link |
|---|---|---|
| ONNX Export | Deployment | Open Notebook |
| Benchmark | Performance | Open Notebook |
| TPU Training (TF) | Training | Open Notebook |
View all 118+ Transformer notebooks →
Foundation tutorials for getting started with transformers.
| Notebook | Topic | Link |
|---|---|---|
| How to Train a Model | Basics | Open Notebook |
| How to Generate Text | Generation | Open Notebook |
| Reformer Architecture | Architecture | Open Notebook |
| Encoder-Decoder Basics | Architecture | Open Notebook |
| Warm Starting Encoder-Decoder | Training | Open Notebook |
| Training Decision Transformers | RL | Open Notebook |
| Fine-Tuning Whisper | Audio | Open Notebook |
| Getting Started with Embeddings | Embeddings | Open Notebook |
| Sentiment Analysis on Twitter | NLP | Open Notebook |
| Notebook | Topic | Link |
|---|---|---|
| Knowledge Graphs + ChatGPT | RAG | Open Notebook |
| Decoding Strategies in LLMs | Generation | [Open Notebook](Decoding/Decoding_Strategies_in_Large_Language Models.ipynb) |
| MergeKit | Model Merging | Open Notebook |
# Simple way
jupyter notebook
# Or with the Makefile (if installed production dependencies)
make notebooksNavigate to any notebook above and start learning!
# Start the FastAPI server with streaming inference
python Deployment/server.py \
--model_id mistralai/Mistral-7B-Instruct-v0.2 \
--quantization \
--port 8000 \
--max_new_tokens 512# Using the client
python Deployment/client.py \
--endpoint http://localhost:8000/query-stream \
--query "Explain quantum computing in simple terms"
# Or with curl
curl "http://localhost:8000/query-stream/?query=What%20is%20AI?"Open any fine-tuning notebook, for example:
- Llama 2 Fine-Tuning - Works on Google Colab free tier
- Mistral 7B SFT - Fast and efficient
- Gemma Fine-tuning - Latest Google model
The course is organized into 7 comprehensive modules:
- Fundamentals of Generative AI
- VAEs, GANs, and Transformer architectures
- Responsible AI, ethics, and governance
- Real-world applications
- Text preprocessing and tokenization
- Word embeddings (Word2Vec, GloVe, FastText)
- RNNs, LSTMs, and GRUs
- Feature extraction techniques
- Transformer architecture deep dive
- Attention mechanisms and text generation
- Pre-training and fine-tuning strategies
- LoRA, QLoRA, and parameter-efficient methods
- DPO and RLHF
- Model evaluation and benchmarking
- Quantization techniques
- Vector databases and embeddings
- Document ingestion and chunking
- RAG pipelines and orchestration
- Evaluation frameworks
- LLM APIs and inference optimization
- Prompt engineering
- Production serving (FastAPI, vLLM, TGI)
- Monitoring and scaling
- Introduction to diffusion processes
- Stable Diffusion and ControlNet
- Fine-tuning and guidance techniques
- Vision-Language models
- Image-text alignment
- Creating custom multimodal models
- Multimodal retrieval systems
-
Large Language Models (LLMs)
- Fine-tuning with LoRA, QLoRA, and full parameter training
- Supervised Fine-Tuning (SFT), Direct Preference Optimization (DPO), and ORPO
- Support for Llama 2/3, Mistral, Gemma, Phi-3, and custom architectures
- Pre-training pipelines with DeepSpeed integration
-
Model Optimization & Quantization
- 4-bit/8-bit quantization using BitsAndBytes
- GPTQ, GGUF, AWQ, and ExLlamaV2 support
- Memory-efficient inference for consumer hardware
-
Deployment Solutions
- Production FastAPI server with streaming inference
- Multi-worker deployment with load balancing
- Health monitoring and error handling
- Docker-ready containerization
-
Multimodal AI
- Vision-Language models (IDEFICS, BLIP, LLaVA)
- Image captioning and visual question answering
- Cross-modal retrieval and search
-
Transformers Ecosystem
- 118+ examples covering NLP, vision, audio, and time-series
- Semantic segmentation, object detection, and classification
- Protein folding and DNA sequence modeling
- Modern Python Packaging:
pyproject.tomlwithuvfor fast, reliable dependency management - Automated Build System: Comprehensive Makefile with self-documenting targets
- Testing Framework: Pytest integration with coverage reporting
- Code Quality: Black, Ruff, and MyPy for formatting, linting, and type checking
- Documentation: MkDocs-ready structure for professional documentation
- CI/CD Ready: Pre-commit hooks and automated quality checks
# Format code
make format
# Run linting
make lint
# Type checking
make type-check
# All pre-commit checks
make pre-commit# Run tests
make test
# Run tests with coverage
make test-cov
# Run all quality checks
make check# Clean build artifacts
make clean
# Lock dependencies
make lock-deps
# Update dependencies
make update-depsGenerative-AI-Course/
├── src/ # Main package source
├── Deployment/ # Production FastAPI server
│ ├── server.py # Streaming inference server
│ ├── client.py # Client implementation
│ └── requirements.txt # Deployment dependencies
├── trainer/ # Training modules
│ ├── sft.py # Supervised fine-tuning
│ ├── pretraining.py # Pre-training pipeline
│ └── requirements.txt # Training dependencies
├── Data-Preparation/ # 17 dataset creation notebooks
├── Finetuning/ # 17 fine-tuning notebooks
├── Quantization/ # 6 quantization notebooks
├── Multimodal/ # 6 multimodal notebooks
├── Transformers/ # 118+ transformer notebooks
├── Tools/ # 6 utility notebooks
├── Docs/ # Course documentation
├── tests/ # Test suite
├── pyproject.toml # Package configuration
├── Makefile # Build automation
└── LICENSE # Apache 2.0 License
Create a .env file for API keys (optional):
# Hugging Face (for private models)
HF_TOKEN=your_huggingface_token
# Weights & Biases (for experiment tracking)
WANDB_API_KEY=your_wandb_key
# OpenAI (for some data preparation notebooks)
OPENAI_API_KEY=your_openai_keyMost notebooks auto-detect GPU. For manual configuration:
import torch
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"CUDA devices: {torch.cuda.device_count()}")We welcome contributions! Whether it's:
- 🐛 Bug fixes
- ✨ New features or notebooks
- 📚 Documentation improvements
- 🧪 Test coverage
- 💡 Example applications
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run quality checks (
make pre-commit) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
You can use this commercially - it's free for commercial and educational use!
Ruslan Magana Vsevolodovna
- Website: ruslanmv.com
- GitHub: @ruslanmv
- Email: contact@ruslanmv.com
Professional Data Scientist specializing in Generative AI, Large Language Models, and Production ML Systems.
This project builds upon the excellent work of:
- Hugging Face for the Transformers library
- The TRL team for training utilities
- DeepSpeed and Accelerate teams
- The open-source AI community
- 177+ Jupyter Notebooks: Comprehensive hands-on examples
- 18 Python Modules: Production-ready implementations
- 7 Course Modules: Complete curriculum
- 1.2GB+ Resources: Models, datasets, and examples
- Apache 2.0 Licensed: Free for commercial use
Upon completing this course, you will master:
- ✅ Large Language Model architecture and fine-tuning
- ✅ Production deployment and optimization
- ✅ Quantization and memory efficiency
- ✅ Multimodal AI systems
- ✅ RAG and vector databases
- ✅ Modern ML engineering practices
- ✅ Enterprise-grade code quality
For a detailed breakdown, see Essential Skills.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Browse the
/Docsdirectory
- Docker containerization
- Kubernetes deployment examples
- Additional model architectures (Claude, GPT-4, etc.)
- More quantization formats
- Extended multimodal examples
- Production monitoring dashboards
- Automated benchmarking suite
⭐ Star this repository if you find it helpful!
Made with ❤️ by Ruslan Magana
Ready to master Generative AI? Get Started →