Bert Gollnick
Generative AI with Python
The Developer's Guide to Pretrained LLMs, Vector Databases, Retrieval-Augmented Generation, and Agentic Systems
Bert Gollnick
Generative AI with Python
The Developer's Guide to Pretrained LLMs, Vector Databases, Retrieval-Augmented Generation, and Agentic Systems
- Broschiertes Buch
- Merkliste
- Auf die Merkliste
- Bewerten Bewerten
- Teilen
- Produkt teilen
- Produkterinnerung
- Produkterinnerung
Your guide to generative AI with Python is here! Start with an introduction to generative AI, NLP models, LLMs, and LMMs-and then dive into pretrained models with Hugging Face. Work with LLMs using Python with the help of tools like OpenAI and LangChain. Get step-by-step instructions for working with vector databases and using retrieval-augmented generation. With information on agentic systems and AI application deployment, this guide gives you all you need to become an AI master!
Highlights:
1) Natural language processing (NLP) models 2) Large language models (LLMs) 3) Pretrained models…mehr
Andere Kunden interessierten sich auch für
- Joachim SteinwendnerProgramming Neural Networks with Python45,99 €
- Michael KoflerAI-Assisted Coding38,99 €
- Thomas TheisGetting Started with JavaScript30,99 €
- Christian WenzPHP and MySQL46,99 €
- Kerem KoseogluSQL39,99 €
- Sandip DholakiaModern Cryptography45,99 €
- Torsten T. WillC++54,99 €
-
-
-
Your guide to generative AI with Python is here! Start with an introduction to generative AI, NLP models, LLMs, and LMMs-and then dive into pretrained models with Hugging Face. Work with LLMs using Python with the help of tools like OpenAI and LangChain. Get step-by-step instructions for working with vector databases and using retrieval-augmented generation. With information on agentic systems and AI application deployment, this guide gives you all you need to become an AI master!
Highlights:
1) Natural language processing (NLP) models
2) Large language models (LLMs)
3) Pretrained models
4) Prompt engineering
5) Vector databases
6) Retrieval-augmented generation (RAG)
7) Agentic systems
8) OpenAI
9) LangChain
10) Hugging Face
11) crewAI
12) AG2
Highlights:
1) Natural language processing (NLP) models
2) Large language models (LLMs)
3) Pretrained models
4) Prompt engineering
5) Vector databases
6) Retrieval-augmented generation (RAG)
7) Agentic systems
8) OpenAI
9) LangChain
10) Hugging Face
11) crewAI
12) AG2
Produktdetails
- Produktdetails
- Verlag: Rheinwerk Computing / Rheinwerk Verlag
- Artikelnr. des Verlages: 459/22690
- Seitenzahl: 392
- Erscheinungstermin: 4. Oktober 2025
- Englisch
- Abmessung: 252mm x 177mm x 22mm
- Gewicht: 690g
- ISBN-13: 9781493226900
- ISBN-10: 1493226908
- Artikelnr.: 73280541
- Herstellerkennzeichnung
- Rheinwerk Verlag GmbH
- Rheinwerkallee 4
- 53227 Bonn
- Info@rheinwerk-verlag.de
- Verlag: Rheinwerk Computing / Rheinwerk Verlag
- Artikelnr. des Verlages: 459/22690
- Seitenzahl: 392
- Erscheinungstermin: 4. Oktober 2025
- Englisch
- Abmessung: 252mm x 177mm x 22mm
- Gewicht: 690g
- ISBN-13: 9781493226900
- ISBN-10: 1493226908
- Artikelnr.: 73280541
- Herstellerkennzeichnung
- Rheinwerk Verlag GmbH
- Rheinwerkallee 4
- 53227 Bonn
- Info@rheinwerk-verlag.de
Bert Gollnick is a senior data scientist, specializing in renewable energies. For many years, he has taught courses about data science and machine learning, and more recently, about generative AI and natural language processing. Bert studied aeronautics at the Technical University of Berlin and economics at the University of Hagen. His main areas of interest are machine learning and data science.
... Preface ... 15
... Objective of This Book ... 15
... Target Audience ... 16
... Prerequisites: What You Should Already Know ... 16
... Structure of This Book ... 17
... How to Use This Book Effectively ... 20
... Downloadable Code and Additional Materials ... 21
... System Setup ... 21
... Acknowledgments ... 27
... Conventions Used in This Book ... 28
1 ... Introduction to Generative AI ... 29
1.1 ... Introduction to Artificial Intelligence ... 30
1.2 ... Pillars of Generative AI Advancement ... 35
1.3 ... Deep Learning ... 38
1.4 ... Narrow AI and General AI ... 40
1.5 ... Natural Language Processing Models ... 42
1.6 ... Large Language Models ... 47
1.7 ... Large Multimodal Models ... 51
1.8 ... Generative AI Applications ... 52
1.9 ... Summary ... 54
2 ... Pretrained Models ... 57
2.1 ... Hugging Face ... 58
2.2 ... Coding: Text Summarization ... 60
2.3 ... Exercise: Translation ... 62
2.4 ... Coding: Zero-Shot Classification ... 64
2.5 ... Coding: Fill-Mask ... 67
2.6 ... Coding: Question Answering ... 68
2.7 ... Coding: Named Entity Recognition ... 70
2.8 ... Coding: Text-to-Image ... 71
2.9 ... Exercise: Text-to-Audio ... 72
2.10 ... Capstone Project: Customer Feedback Analysis ... 74
2.11 ... Summary ... 77
3 ... Large Language Models ... 79
3.1 ... Brief History of Language Models ... 80
3.2 ... Simple Use of LLMs via Python ... 81
3.3 ... Model Parameters ... 93
3.4 ... Model Selection ... 96
3.5 ... Messages ... 99
3.6 ... Prompt Templates ... 101
3.7 ... Chains ... 104
3.8 ... Safety and Security ... 117
3.9 ... Model Improvements ... 124
3.10 ... New Trends ... 125
3.11 ... Summary ... 130
4 ... Prompt Engineering ... 133
4.1 ... Prompt Basics ... 134
4.2 ... Coding: Few-Shot Prompting ... 142
4.3 ... Coding: Chain-of-Thought ... 144
4.4 ... Coding: Self-Consistency Chain-of-Thought ... 145
4.5 ... Coding: Prompt Chaining ... 149
4.6 ... Coding: Self-Feedback ... 151
4.7 ... Summary ... 155
5 ... Vector Databases ... 157
5.1 ... Introduction ... 157
5.2 ... Data Ingestion Process ... 159
5.3 ... Loading Documents ... 160
5.4 ... Splitting Documents ... 167
5.5 ... Embeddings ... 182
5.6 ... Storing Data ... 195
5.7 ... Retrieving Data ... 202
5.8 ... Capstone Project ... 207
5.9 ... Summary ... 218
6 ... Retrieval-Augmented Generation ... 221
6.1 ... Introduction ... 222
6.2 ... Coding: Simple Retrieval-Augmented Generation ... 225
6.3 ... Advanced Techniques ... 232
6.4 ... Coding: Prompt Caching ... 250
6.5 ... Evaluation ... 256
6.6 ... Summary ... 261
7 ... Agentic Systems ... 263
7.1 ... Introduction to AI Agents ... 264
7.2 ... Available Frameworks ... 265
7.3 ... Simple Agent ... 267
7.4 ... Agentic Framework: LangGraph ... 275
7.5 ... Agentic Framework: AG2 ... 289
7.6 ... Agentic Framework: CrewAI ... 303
7.7 ... Agentic Framework: OpenAI Agents ... 328
7.8 ... Agentic Framework: Pydantic AI ... 333
7.9 ... Monitoring Agentic Systems ... 336
7.10 ... Summary ... 342
8 ... Deployment ... 345
8.1 ... Deployment Architecture ... 345
8.2 ... Deployment Strategy ... 347
8.3 ... Self-Contained App Development ... 355
8.4 ... Deployment to Heroku ... 361
8.5 ... Deployment to Streamlit ... 369
8.6 ... Deployment with Render ... 372
8.7 ... Summary ... 374
9 ... Outlook ... 375
9.1 ... Advances in Model Architecture ... 375
9.2 ... Limitations and Issues of LLMs ... 376
9.3 ... Regulatory Developments ... 381
9.4 ... Artificial General Intelligence and Artificial Superintelligence ... 381
9.5 ... AI Systems in the Near Term ... 382
9.6 ... Useful Resources ... 384
9.7 ... Summary ... 384
... The Author ... 387
... Index ... 389
... Objective of This Book ... 15
... Target Audience ... 16
... Prerequisites: What You Should Already Know ... 16
... Structure of This Book ... 17
... How to Use This Book Effectively ... 20
... Downloadable Code and Additional Materials ... 21
... System Setup ... 21
... Acknowledgments ... 27
... Conventions Used in This Book ... 28
1 ... Introduction to Generative AI ... 29
1.1 ... Introduction to Artificial Intelligence ... 30
1.2 ... Pillars of Generative AI Advancement ... 35
1.3 ... Deep Learning ... 38
1.4 ... Narrow AI and General AI ... 40
1.5 ... Natural Language Processing Models ... 42
1.6 ... Large Language Models ... 47
1.7 ... Large Multimodal Models ... 51
1.8 ... Generative AI Applications ... 52
1.9 ... Summary ... 54
2 ... Pretrained Models ... 57
2.1 ... Hugging Face ... 58
2.2 ... Coding: Text Summarization ... 60
2.3 ... Exercise: Translation ... 62
2.4 ... Coding: Zero-Shot Classification ... 64
2.5 ... Coding: Fill-Mask ... 67
2.6 ... Coding: Question Answering ... 68
2.7 ... Coding: Named Entity Recognition ... 70
2.8 ... Coding: Text-to-Image ... 71
2.9 ... Exercise: Text-to-Audio ... 72
2.10 ... Capstone Project: Customer Feedback Analysis ... 74
2.11 ... Summary ... 77
3 ... Large Language Models ... 79
3.1 ... Brief History of Language Models ... 80
3.2 ... Simple Use of LLMs via Python ... 81
3.3 ... Model Parameters ... 93
3.4 ... Model Selection ... 96
3.5 ... Messages ... 99
3.6 ... Prompt Templates ... 101
3.7 ... Chains ... 104
3.8 ... Safety and Security ... 117
3.9 ... Model Improvements ... 124
3.10 ... New Trends ... 125
3.11 ... Summary ... 130
4 ... Prompt Engineering ... 133
4.1 ... Prompt Basics ... 134
4.2 ... Coding: Few-Shot Prompting ... 142
4.3 ... Coding: Chain-of-Thought ... 144
4.4 ... Coding: Self-Consistency Chain-of-Thought ... 145
4.5 ... Coding: Prompt Chaining ... 149
4.6 ... Coding: Self-Feedback ... 151
4.7 ... Summary ... 155
5 ... Vector Databases ... 157
5.1 ... Introduction ... 157
5.2 ... Data Ingestion Process ... 159
5.3 ... Loading Documents ... 160
5.4 ... Splitting Documents ... 167
5.5 ... Embeddings ... 182
5.6 ... Storing Data ... 195
5.7 ... Retrieving Data ... 202
5.8 ... Capstone Project ... 207
5.9 ... Summary ... 218
6 ... Retrieval-Augmented Generation ... 221
6.1 ... Introduction ... 222
6.2 ... Coding: Simple Retrieval-Augmented Generation ... 225
6.3 ... Advanced Techniques ... 232
6.4 ... Coding: Prompt Caching ... 250
6.5 ... Evaluation ... 256
6.6 ... Summary ... 261
7 ... Agentic Systems ... 263
7.1 ... Introduction to AI Agents ... 264
7.2 ... Available Frameworks ... 265
7.3 ... Simple Agent ... 267
7.4 ... Agentic Framework: LangGraph ... 275
7.5 ... Agentic Framework: AG2 ... 289
7.6 ... Agentic Framework: CrewAI ... 303
7.7 ... Agentic Framework: OpenAI Agents ... 328
7.8 ... Agentic Framework: Pydantic AI ... 333
7.9 ... Monitoring Agentic Systems ... 336
7.10 ... Summary ... 342
8 ... Deployment ... 345
8.1 ... Deployment Architecture ... 345
8.2 ... Deployment Strategy ... 347
8.3 ... Self-Contained App Development ... 355
8.4 ... Deployment to Heroku ... 361
8.5 ... Deployment to Streamlit ... 369
8.6 ... Deployment with Render ... 372
8.7 ... Summary ... 374
9 ... Outlook ... 375
9.1 ... Advances in Model Architecture ... 375
9.2 ... Limitations and Issues of LLMs ... 376
9.3 ... Regulatory Developments ... 381
9.4 ... Artificial General Intelligence and Artificial Superintelligence ... 381
9.5 ... AI Systems in the Near Term ... 382
9.6 ... Useful Resources ... 384
9.7 ... Summary ... 384
... The Author ... 387
... Index ... 389
... Preface ... 15
... Objective of This Book ... 15
... Target Audience ... 16
... Prerequisites: What You Should Already Know ... 16
... Structure of This Book ... 17
... How to Use This Book Effectively ... 20
... Downloadable Code and Additional Materials ... 21
... System Setup ... 21
... Acknowledgments ... 27
... Conventions Used in This Book ... 28
1 ... Introduction to Generative AI ... 29
1.1 ... Introduction to Artificial Intelligence ... 30
1.2 ... Pillars of Generative AI Advancement ... 35
1.3 ... Deep Learning ... 38
1.4 ... Narrow AI and General AI ... 40
1.5 ... Natural Language Processing Models ... 42
1.6 ... Large Language Models ... 47
1.7 ... Large Multimodal Models ... 51
1.8 ... Generative AI Applications ... 52
1.9 ... Summary ... 54
2 ... Pretrained Models ... 57
2.1 ... Hugging Face ... 58
2.2 ... Coding: Text Summarization ... 60
2.3 ... Exercise: Translation ... 62
2.4 ... Coding: Zero-Shot Classification ... 64
2.5 ... Coding: Fill-Mask ... 67
2.6 ... Coding: Question Answering ... 68
2.7 ... Coding: Named Entity Recognition ... 70
2.8 ... Coding: Text-to-Image ... 71
2.9 ... Exercise: Text-to-Audio ... 72
2.10 ... Capstone Project: Customer Feedback Analysis ... 74
2.11 ... Summary ... 77
3 ... Large Language Models ... 79
3.1 ... Brief History of Language Models ... 80
3.2 ... Simple Use of LLMs via Python ... 81
3.3 ... Model Parameters ... 93
3.4 ... Model Selection ... 96
3.5 ... Messages ... 99
3.6 ... Prompt Templates ... 101
3.7 ... Chains ... 104
3.8 ... Safety and Security ... 117
3.9 ... Model Improvements ... 124
3.10 ... New Trends ... 125
3.11 ... Summary ... 130
4 ... Prompt Engineering ... 133
4.1 ... Prompt Basics ... 134
4.2 ... Coding: Few-Shot Prompting ... 142
4.3 ... Coding: Chain-of-Thought ... 144
4.4 ... Coding: Self-Consistency Chain-of-Thought ... 145
4.5 ... Coding: Prompt Chaining ... 149
4.6 ... Coding: Self-Feedback ... 151
4.7 ... Summary ... 155
5 ... Vector Databases ... 157
5.1 ... Introduction ... 157
5.2 ... Data Ingestion Process ... 159
5.3 ... Loading Documents ... 160
5.4 ... Splitting Documents ... 167
5.5 ... Embeddings ... 182
5.6 ... Storing Data ... 195
5.7 ... Retrieving Data ... 202
5.8 ... Capstone Project ... 207
5.9 ... Summary ... 218
6 ... Retrieval-Augmented Generation ... 221
6.1 ... Introduction ... 222
6.2 ... Coding: Simple Retrieval-Augmented Generation ... 225
6.3 ... Advanced Techniques ... 232
6.4 ... Coding: Prompt Caching ... 250
6.5 ... Evaluation ... 256
6.6 ... Summary ... 261
7 ... Agentic Systems ... 263
7.1 ... Introduction to AI Agents ... 264
7.2 ... Available Frameworks ... 265
7.3 ... Simple Agent ... 267
7.4 ... Agentic Framework: LangGraph ... 275
7.5 ... Agentic Framework: AG2 ... 289
7.6 ... Agentic Framework: CrewAI ... 303
7.7 ... Agentic Framework: OpenAI Agents ... 328
7.8 ... Agentic Framework: Pydantic AI ... 333
7.9 ... Monitoring Agentic Systems ... 336
7.10 ... Summary ... 342
8 ... Deployment ... 345
8.1 ... Deployment Architecture ... 345
8.2 ... Deployment Strategy ... 347
8.3 ... Self-Contained App Development ... 355
8.4 ... Deployment to Heroku ... 361
8.5 ... Deployment to Streamlit ... 369
8.6 ... Deployment with Render ... 372
8.7 ... Summary ... 374
9 ... Outlook ... 375
9.1 ... Advances in Model Architecture ... 375
9.2 ... Limitations and Issues of LLMs ... 376
9.3 ... Regulatory Developments ... 381
9.4 ... Artificial General Intelligence and Artificial Superintelligence ... 381
9.5 ... AI Systems in the Near Term ... 382
9.6 ... Useful Resources ... 384
9.7 ... Summary ... 384
... The Author ... 387
... Index ... 389
... Objective of This Book ... 15
... Target Audience ... 16
... Prerequisites: What You Should Already Know ... 16
... Structure of This Book ... 17
... How to Use This Book Effectively ... 20
... Downloadable Code and Additional Materials ... 21
... System Setup ... 21
... Acknowledgments ... 27
... Conventions Used in This Book ... 28
1 ... Introduction to Generative AI ... 29
1.1 ... Introduction to Artificial Intelligence ... 30
1.2 ... Pillars of Generative AI Advancement ... 35
1.3 ... Deep Learning ... 38
1.4 ... Narrow AI and General AI ... 40
1.5 ... Natural Language Processing Models ... 42
1.6 ... Large Language Models ... 47
1.7 ... Large Multimodal Models ... 51
1.8 ... Generative AI Applications ... 52
1.9 ... Summary ... 54
2 ... Pretrained Models ... 57
2.1 ... Hugging Face ... 58
2.2 ... Coding: Text Summarization ... 60
2.3 ... Exercise: Translation ... 62
2.4 ... Coding: Zero-Shot Classification ... 64
2.5 ... Coding: Fill-Mask ... 67
2.6 ... Coding: Question Answering ... 68
2.7 ... Coding: Named Entity Recognition ... 70
2.8 ... Coding: Text-to-Image ... 71
2.9 ... Exercise: Text-to-Audio ... 72
2.10 ... Capstone Project: Customer Feedback Analysis ... 74
2.11 ... Summary ... 77
3 ... Large Language Models ... 79
3.1 ... Brief History of Language Models ... 80
3.2 ... Simple Use of LLMs via Python ... 81
3.3 ... Model Parameters ... 93
3.4 ... Model Selection ... 96
3.5 ... Messages ... 99
3.6 ... Prompt Templates ... 101
3.7 ... Chains ... 104
3.8 ... Safety and Security ... 117
3.9 ... Model Improvements ... 124
3.10 ... New Trends ... 125
3.11 ... Summary ... 130
4 ... Prompt Engineering ... 133
4.1 ... Prompt Basics ... 134
4.2 ... Coding: Few-Shot Prompting ... 142
4.3 ... Coding: Chain-of-Thought ... 144
4.4 ... Coding: Self-Consistency Chain-of-Thought ... 145
4.5 ... Coding: Prompt Chaining ... 149
4.6 ... Coding: Self-Feedback ... 151
4.7 ... Summary ... 155
5 ... Vector Databases ... 157
5.1 ... Introduction ... 157
5.2 ... Data Ingestion Process ... 159
5.3 ... Loading Documents ... 160
5.4 ... Splitting Documents ... 167
5.5 ... Embeddings ... 182
5.6 ... Storing Data ... 195
5.7 ... Retrieving Data ... 202
5.8 ... Capstone Project ... 207
5.9 ... Summary ... 218
6 ... Retrieval-Augmented Generation ... 221
6.1 ... Introduction ... 222
6.2 ... Coding: Simple Retrieval-Augmented Generation ... 225
6.3 ... Advanced Techniques ... 232
6.4 ... Coding: Prompt Caching ... 250
6.5 ... Evaluation ... 256
6.6 ... Summary ... 261
7 ... Agentic Systems ... 263
7.1 ... Introduction to AI Agents ... 264
7.2 ... Available Frameworks ... 265
7.3 ... Simple Agent ... 267
7.4 ... Agentic Framework: LangGraph ... 275
7.5 ... Agentic Framework: AG2 ... 289
7.6 ... Agentic Framework: CrewAI ... 303
7.7 ... Agentic Framework: OpenAI Agents ... 328
7.8 ... Agentic Framework: Pydantic AI ... 333
7.9 ... Monitoring Agentic Systems ... 336
7.10 ... Summary ... 342
8 ... Deployment ... 345
8.1 ... Deployment Architecture ... 345
8.2 ... Deployment Strategy ... 347
8.3 ... Self-Contained App Development ... 355
8.4 ... Deployment to Heroku ... 361
8.5 ... Deployment to Streamlit ... 369
8.6 ... Deployment with Render ... 372
8.7 ... Summary ... 374
9 ... Outlook ... 375
9.1 ... Advances in Model Architecture ... 375
9.2 ... Limitations and Issues of LLMs ... 376
9.3 ... Regulatory Developments ... 381
9.4 ... Artificial General Intelligence and Artificial Superintelligence ... 381
9.5 ... AI Systems in the Near Term ... 382
9.6 ... Useful Resources ... 384
9.7 ... Summary ... 384
... The Author ... 387
... Index ... 389