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
🤖 این کتاب یک راهنمای عملی و جامع از ابتدا تا انتها برای مهندسان و متخصصانی است که میخواهند از مرحله نمونههای اولیه فراتر بروند و راهکارهای یادگیری ماشین و مدلهای زبانی بزرگ را با اطمینان در محیطهای واقعی پیادهسازی کنند.
🧩 کتاب شما را در تمام چرخه مدرن توسعه و استقرار یادگیری ماشین همراهی میکند. ابتدا با استفاده از NumPy، Pandas و PyArrow با مبانی ساخت پایپلاینهای داده آشنا میشوید و سپس با scikit-learn مدلهای پایه قابلاعتمادی ایجاد میکنید. در ادامه وارد یادگیری عمیق با PyTorch، ترنسفورمرها و تکنیکهای سازگارکردن LLMها مانند LoRA و QLoRA میشوید.
🧠 سپس مدلهای Diffusion و چندوجهی را بررسی میکنید و یاد میگیرید سیستمهای Retrieval-Augmented Generation (RAG) را با FAISS و pgvector بسازید. فصلهای عملی کتاب موضوعهایی مانند ایجنتها، استفاده از ابزارها، فریمورکهای ارزیابی، مشاهدهپذیری و شیوههای هوش مصنوعی مسئولانه شامل حریم خصوصی، ایمنی و حاکمیت را پوشش میدهند.
🚀 در بخشهای پایانی، تکنیکهای استقرار با استفاده از FastAPI، Ray Serve، TorchServe و موتورهای پیشرفته سروینگ LLM مانند vLLM و TGI را یاد میگیرید. هر مفهوم با مثالهای کدنویسی روشن، الگوهای تست و چکلیستهای عملیاتی همراه شده است.
⚙️ بهجای ترفندهای موردی و یکبارمصرف، در این کتاب با ورکفلوهای تکرارپذیر آشنا میشوید؛ از توسعه ابزارها با رویکرد Schema-First و پایپلاینهای آموزش قابلبازتولید گرفته تا ارزیابی با مجموعهدادههای مرجع و استقرار امن در محیط Production همراه با مانیتورینگ و کنترلهای مربوط به انطباق.
🎯 در نهایت، این کتاب به شما کمک میکند سیستمهایی مقاوم، قابلممیزی و بهینه بسازید؛ چه در حال استقرار اولین مدل خود باشید و چه ورکلودهای پیچیده سازمانی را مدیریت کنید. برای مهندسانی که میخواهند راهکارهای AI را با اطمینان و مسئولانه عرضه کنند، این کتاب یک راهنمای عملی برای عصر GenAI است.
✨ آنچه یاد خواهید گرفت
• پیادهسازی مدلهای مدرن هوش مصنوعی شامل ترنسفورمرها، مدلهای Diffusion، مدلهای چندوجهی، سیستمهای پیشنهاددهنده و یادگیری تقویتی با مثالهای عملی PyTorch
• Fine-Tune و سرو کردن LLMها با LoRA/QLoRA، کوانتیزهسازی، RAG، Tool Calling، پرامپتهای ساختاریافته و تکنیکهای قدرتمند ارزیابی
• طراحی سیستمهای Agentic AI با حافظه، برنامهریزی، اجرای امن ابزارها، الگوهای چندایجنتی و فریمورکهای ارزیابی خودمختاری
• استقرار و اجرای سیستمهای AI در سطح Production با استفاده از MLOps/LLMOps، شامل سروینگ، بهینهسازی پرفورمنس، مانیتورینگ، کنترل هزینه، انطباق و استقرار روی Edge
👥 این کتاب برای چه کسانی مناسب است؟
💻 این کتاب برای مهندسان فعال یادگیری ماشین و هوش مصنوعی، مهندسان نرمافزاری که وارد حوزه AI کاربردی میشوند، دانشمندان دادهای که سیستمهای Production میسازند، متخصصان MLOps/LLMOps و توسعهدهندگان فنیای طراحی شده است که میخواهند از دموها فراتر بروند و سیستمهای واقعی GenAI، LLM و مبتنی بر PyTorch را در مقیاس بالا پیادهسازی کنند.
📖 فهرست مطالب
پارت I. مبانی قابل استقرار با Python
فصل ۱. یادگیری ماشین برای سازندگان
فصل ۲. مهندسی داده برای یادگیری ماشین
فصل ۳. ارزیابی، تست و اندازهگیری
فصل ۴. مهندسی نرمافزار یادگیری ماشین
فصل ۵. مبانی بهینهسازی در PyTorch
پارت II. معماریهای مدرن با تمرکز بر PyTorch
فصل ۶. ترنسفورمرها در PyTorch
فصل ۷. Diffusion و رسانههای مولد
فصل ۸. یادگیری چندوجهی
فصل ۹. مدلهای کلاسیکی که هنوز کارایی دارند
فصل ۱۰. یادگیری تقویتی در عمل
پارت III. LLMها و GenAI در عمل
فصل ۱۱. مبانی LLM
فصل ۱۲. سازگارکردن کارآمد مدلها
فصل ۱۳. مهندسی پرامپت ماندگار
فصل ۱۴. تولید تقویتشده با بازیابی
فصل ۱۵. LLMهای مجهز به ابزار
فصل ۱۶. ارزیابی و مشاهدهپذیری LLM
فصل ۱۷. مبانی هوش مصنوعی مسئولانه
پارت IV. Agentic AI و ایجنتهای هوش مصنوعی در اکوسیستم Python
فصل ۱۸. معماری ایجنتها
فصل ۱۹. حافظه و وضعیت
فصل ۲۰. ابزارها و محیطها برای ایجنتها
فصل ۲۱. سیستمهای چندایجنتی
فصل ۲۲. قابلیت اطمینان و قطعیت
فصل ۲۳. ارزیابیها و بنچمارکهای ایجنتها
پارت V. MLOps و LLMOps با PyTorch در Production
فصل ۲۴. از آزمایش تا Production
فصل ۲۵. سروینگ و استنتاج؛ بازنویسی همراه با کد
فصل ۲۶. مهندسی پرفورمنس
فصل ۲۷. مانیتورینگ، Drift و حلقههای بازخورد
فصل ۲۸. مدیریت هزینه
فصل ۲۹. انطباق و قابلیت ممیزی
پارت VI. Edge، اجرای روی دستگاه و یکپارچهسازی سازمانی با تمرکز بر Python
فصل ۳۰. هوش مصنوعی روی دستگاه و Edge
فصل ۳۱. سیستمها و دانش سازمانی
فصل ۳۲. امنیت سیستمهای GenAI
پارت VII. الگوها و راهنماهای عملی End-to-End همراه با کد
فصل ۳۳. باتهای مکالمهای و Helpdesk
فصل ۳۴. دستیارهای کدنویسی و DevOps
فصل ۳۵. Copilotهای تحلیل داده
فصل ۳۶. تجارت الکترونیک و بازاریابی
فصل ۳۷. عملیات خودمختار و RPA 2.0
فصل ۳۸. جستوجوی سازمانی و RAG
👤 درباره نویسنده
🎓 مارتین هندر دارای مدرک دکتری از LIGS University در ایالات متحده است و بهعنوان متخصص فناوری، نویسنده و پژوهشگر در حوزههای هوش مصنوعی، رایانش ابری، وبسرویسها و پلتفرمهای مدرن داده فعالیت میکند.
💼 او بیش از پانزده سال تجربه در مهندسی نرمافزار سازمانی، سیستمهای توزیعشده و معماریهای Cloud-Native دارد و در محیطهای دانشگاهی و صنعتی فعالیت کرده است. او به سازمانها کمک کرده تا اپلیکیشنهایی مقیاسپذیر، امن و آماده آینده توسعه دهند.
🌐 مارتین در کنار نویسندگی و پژوهش، به منتورینگ توسعهدهندگان، بررسی نوآوریهای نوظهور هوش مصنوعی و مشارکت در کامیونیتی جهانی فناوری علاقه دارد.
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.









