Generative AI with local LLM (1 copy)
Generative AI with local LLM
A comprehensive roadmap for building AI-Driven applications with local LLMs
About the Book
This book is a practical guide for anyone interested in diving into the world of Generative AI development, regardless of their prior programming experience.
How This Book Stands Out
When writing this book, we focused on two main goals: creating a clear, practical roadmap and striking a good balance between theory and hands-on practice. Unlike other books that can get lost in theory or assume you need advanced technical skills, this book is tailored for both beginners and advanced users. We place a special emphasis on using local LLM inference and developing AI-driven applications—something that’s now more affordable thanks to the newly released LLMs for edge computing. Our key takeaway: You don’t need to be a machine learning expert to learn Generative AI.
Here's what you can expect:
- Clear and concise explanations: Complex AI concepts are broken down into simple, digestible steps, making this book accessible to anyone, regardless of technical background.
- Hands-On Projects: Each chapter guides you through building specific AI applications, from setting up your environment to deploying your final product.
- Real-World Applications: Learn through practical examples that solve real problems, giving you valuable experience in applying AI techniques.
- Essential Tools & Libraries: Master popular tools like Langchain, Vanna, TensorFlow, and PyTorch, giving you in-demand skills to thrive in the AI space.
- Project-Based Learning: Work on engaging projects ranging from image recognition to advanced LLM fine-tuning, reinforcing your knowledge with hands-on practice.
By the end of this book, you'll be able to:
- Grasp the fundamentals of Generative AI and Large Language Models (LLMs).
- Efficiently set up and use local LLM inference for AI development.
- Enrich RAG (Retrieval Augmented Generation) models with your own data, like PDFs and documents.
- Integrate LLM models with SQL databases for more dynamic AI solutions.
- Build and train your own AI models from scratch.
- Use AI agents to perform tasks autonomously.
- Deploy your AI applications in real-world environments confidently.
This book offers a comprehensive roadmap for anyone, whether you're a student, a professional, or simply curious about AI—providing the tools and confidence to create innovative AI solutions. Start your AI journey today and turn your ideas into reality!
The book was first published on October 4, 2024, and has been continuously updated with new content based on the growing interest in Generative AI. Once you purchase the book, you will receive notifications whenever updates are made. Happy reading!
The source code for the examples in the book is available on GitHub.
Team Discounts
Get a team discount on this book!
Bundles that include this book
Reader Testimonials
Victor Shilo
Author of the book "AI Driven"
In contrast to my book AI Driven, which targets CxOs, Timur’s book offers practical insights for architects and developers. I had the privilege of reading a pre-release version, and as an engineer at heart, I found it easy to follow from chapter to chapter. Highly recommended!
Lucy Tai
Data Scientist
I really appreciated the effort to explain key concepts and break down the symbolism behind them. Including a code base was a huge plus—it made everything feel solid and practical. The examples were clear and easy to follow, making the learning experience enjoyable and effective.
Table of Contents
- Preface
- What this book covers
- Code Samples
- Readership
- Conventions
- Reader feedback
- About the authors
- Acknowledgments
- Chapter 1: Getting started with Local LLM
- Tools and frameworks used in this book
- Installing and setting up the local LLM inference
- Useful commands and interfaces
- Additional setup
- Uninstall LLM inference
- Installing a graphical user interface (GUI) client to work with local LLM
- Configure a Python virtual environment for AI development
- Install Python 3
- Install Python package manager pip3
- Installing and configuring Miniconda
- Install IDE: Jupyter lab and notebook
- Install and configure SQLLite database
- Additional setups
- Develop your first application with local LLM
- Troubleshooting
- Hardware acceleration
- Using a Workstation with GPU
- Enabling AVX/AVX2 for CPU acceleration
- Using 3rd party ASIC platform or VPS with GPU support
- Using Google Colab or Kaggle service
- Conclusion
- Chapter 2: Deep dive into the theories of Generative AI
- Artificial Intelligence (AI)
- Machine Learning (ML)
- Deep Learning (DL)
- Natural Language Processing (NLP)
- Transformer
- Self-Attention mechanism
- Encoder-Decoder architecture
- Generative AI
- What is Generative AI and what is not?
- Categories of Generative AI
- Large Language Model
- How LLM works internally?
- Tokenization
- Vector
- Embedding
- Transformers
- Training LLM
- Pre-training
- Fine-tuning
- How LLM works internally?
- RAG
- AI Agents
- Prompt engineering
- Resources
- Conclusion
- Chapter 3: RAG, enrich LLM models with private datasets
- RAG vs fine-tuning LLMs
- Key concepts of RAG
- Embeddings
- Vector database
- Semantic Search
- How semantic search is different from full text search?
- Real world use cases of using RAG
- Implementing RAG in a private company
- Step-by-Step Example: Loading, retrieving, and processing custom documents with LLM
- Conclusion
- Chapter 4: Text-to-SQL, enhance your LLM responses by integrating data from the Database
- What is Text-to-SQL?
- Challenges of Text-to-SQL
- LLM for Text-to-SQL
- System design patterns of using Text-to-SQL with examples
- Design pattern 1. Generating and executing SQL queries
- Design pattern 2. Using Agent’s for error handling and ensure correctness
- Design pattern 3. Text-To-SQL with RAG
- Conclusion
- Chapter 5: Fine-tuning LLMs
- Steps for Fine-tuning a pre-trained model
- Fine-tuning technics
- Full Fine-Tuning
- Parameter-Efficient Fine-Tuning (PEFT)
- LoRA (Low-Rank Adaptation)
- Quantized LoRA (QLoRA)
- Knowledge Distillation (KD)
- Popular frameworks used for fine-tuning LLMs
- Step-by-step example of fine-tuning an LLM
- Prerequisites
- Part 1. Analyze business requirements, choosing a base model and environment setup
- Part 2. Exploring the training dataset
- Part 3. Dataset pre-processing and adapter configuration
- Part 4. Train the model
- Part 5. Evaluate the model
- Part 6. Save & deploy the final model
- Conclusion
- Chapter 6: Image processing & generating with LLM
- Image visioning
- Possibilities and Functionalities of LLaVA-v1.6
- LLaVa architecture
- Step-by-Step Example: Utilizing LLaVA-v1.6 for Image Visioning
- Incorporating LLaVA into your application for image processing
- Image processing
- Tips for Better Results
- References
- Conclusion
- Image visioning
- Chapter 7: Developing and utilizing AI agents
- The future of AI agents
- Difference between AI Agents and AI Tools
- Use cases of AI agents in Generative AI
- Use cases from a developer’s perspective
- Use cases from a product manager’s perspective
- Classification of AI Agents in Generative AI
- AI agents architecture
- Frameworks for developing AI Agents
- Developing a practical AI Agents: a step-by-step Guide
- Conclusion
- Final words
- Preface
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them