Practical Machine Learning and Agentic Workflows with Python and PyTorch
Martin Hander

#AI
#Agentic
#Python
#PyTorch
#Machine_Learning
#LoRA/QLoRA
#LLMs
#GenAI
#RPA2.0
#RAG
This book is a practical, end-to-end guide for engineers and practitioners who want to move beyond prototypes and confidently deploy machine learning and large language model solutions in real-world environments.
This book guides through the entire modern machine learning lifecycle. You’ll start with foundations using NumPy, Pandas, and PyArrow for data pipelines, then build solid baselines with scikit-learn. From there, you advance into deep learning with PyTorch, transformers, and LLM adaptation techniques such as LoRA and QLoRA. You’ll explore diffusion and multimodal models, and learn to build retrieval-augmented generation systems with FAISS and pgvector. Practical chapters cover agents, tool use, evaluation frameworks, observability, and responsible AI practices including privacy, safety, and governance. Finally, you’ll master deployment techniques using FastAPI, Ray Serve, TorchServe, and cutting-edge LLM serving engines like vLLM and TGI. Each concept is paired with clear code examples, testing patterns, and operational checklists. Instead of one-off tricks, you’ll adopt repeatable workflows: schema-first tooling, reproducible training pipelines, evaluation with golden datasets, and secure production rollouts with monitoring and compliance checkpoints.
In the end, this book helps you build systems that are robust, auditable, and optimized—whether you're deploying your first model or managing complex enterprise workloads. For engineers who want to ship AI confidently and responsibly, this is your practical playbook for the GenAI era.
What you will learn:
Implement modern AI models including transformers, diffusion, multimodal, recommenders, and RL using practical PyTorch examples.
Fine tune and serve LLMs with LoRA/QLoRA, quantization, RAG, tool calling, structured prompts, and robust evaluation techniques.
Design agentic AI systems with memory, planning, safe tool execution, multi agent patterns, and autonomy evaluation frameworks.
Deploy and run production grade AI with MLOps/LLMOps covering serving, performance tuning, monitoring, cost control, compliance, and edge deployments.
Who this book is for:
This book is designed for practicing machine learning and AI engineers, software engineers moving into applied AI, data scientists building production systems, MLOps/LLMOps practitioners, and technical builders who want to go beyond demos and deploy real-world GenAI, LLM, and PyTorch-based systems at scale.
Table of Contents
Part I: Foundations That Ship (with Python)
Chapter 1: ML for Builders
Chapter 2: Data Engineering for ML
Chapter 3: Evaluation, Testing, and Measurement
Chapter 4: ML Software Engineering
Chapter 5: Optimization 101 in PyTorch
Part II: Modern Architectures (Py Torch-First)
Chapter 6: Transformers in Py Torch
Chapter 7: Diffusion and Generative Media
Chapter 8: Multimodal Learning
Chapter 9: Classical Models That Still Deliver
Chapter 10: Reinforcement Learning in Practice
Part Ill: LLMs and GenAI in Practice
Chapter 11: LLM Fundamentals
Chapter 12: Adapting Models Efficiently
Chapter 13: Prompt Engineering That Lasts
Chapter 14: Retrieval-Augmented Generation
Chapter 15: Tool Using LLMs
Chapter 16: LLM Evaluation and Observability
Chapter 17: Responsible Al Foundations
Part IV: Agentic Al and Al Agents (Python Ecosystem)
Chapter 18: Agent Architectures
Chapter 19: Memory and State
Chapter 20: Tools and Environments for Agents
Chapter 21: Multi-agent Systems
Chapter 22: Reliability and Determinism
Chapter 23: Agent Evals and Benchmarks
Part V: MLOps and LLMOps (Py Torch in Production)
Chapter 24: From Experiment to Production
Chapter 25: Serving and Inference (Rewrite with Code)
Chapter 26: Performance Engineering
Chapter 27: Monitoring, Drift, and Feedback Loops
Chapter 28: Cost Management
Chapter 29: Compliance and Auditability
Part VI: Edge, On-Device, and Enterprise Integration {Python-Centric)
Chapter 30: On-Device and Edge Al
Chapter 31: Enterprise Systems and Knowledge
Chapter 32: Security for GenAI Systems
Part VII: Patterns and Playbooks (End-to-End, with Code)
Chapter 33: Conversational and Helpdesk Bots
Chapter 34: Code and DevOps Assistants
Chapter 35: Analytics Copilots
Chapter 36: Ecommerce and Marketing
Chapter 37: Autonomous Ops and RPA 2.0
Chapter 38: Enterprise Search and RAG
About the Author
Martin Hander, Ph.D. (LIGS University, USA), is a technology expert, author, and researcher specializing in artificial intelligence, cloud computing, web services, and modern data platforms. With more than 15 years of experience in enterprise software engineering, distributed systems, and cloud-native architectures, he has worked across both academic and industry settings, helping organizations build scalable, secure, and future-ready applications. When not writing or researching, Martin enjoys mentoring developers, exploring emerging artificial intelligence innovations, and contributing to the global tech community.









