Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Pere Martra

Rating No ratings yet

This book offers you a hands-on experience using models from OpenAI and the Hugging Face library. You will use various tools and work on small projects, gradually applying the new knowledge you gain. The book is divided into three parts. Part one covers techniques and libraries. Here, you'll explore different techniques through small examples, preparing to build projects in the next section. You'll learn to use common libraries in the world of Large Language Models. Topics and technologies covered include chatbots, code generation, OpenAI API, Hugging Face, vector databases, LangChain, fine tuning, PEFT fine tuning, soft prompt tuning, LoRA, QLoRA, evaluating models, and Direct Preference Optimization. Part two focuses on projects. You'll create projects, understanding design decisions. Each project may have more than one possible implementation, as there is often not just one good solution. You'll also explore LLMOps-related topics. Part three delves into enterprise solutions. Large Language Models are not a standalone solution; in large corporate environments, they are one piece of the puzzle. You'll explore how to structure solutions capable of transforming organizations with thousands of employees, highlighting the main role that Large Language Models play in these new solutions. This book equips you to confidently navigate and implement Large Language Models, empowering you to tackle diverse challenges in the evolving landscape of language processing. What You Will Learn • Gain practical experience by working with models from OpenAI and the Hugging Face library • Use essential libraries relevant to Large Language Models, covering topics such as Chatbots, Code Generation, OpenAI API, Hugging Face, and Vector databases • Create and implement projects using LLM while understanding the design decisions involved • Understand the role of Large Language Models in larger corporate settings

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide that takes you from calling LLMs through APIs to designing enterprise-grade solutions, using OpenAI and Hugging Face as the primary toolkits. Best suited for developers and technical architects who learn by building and want a practical, project-driven path into applied LLM engineering. 【Book Arc】 - **Opening (~0%–10%)**: Sets the stage with the post-ChatGPT landscape and the book's three-part structure, then introduces the OpenAI API through small examples like natural-language-to-SQL generation, establishing prompt roles and the temperature parameter as foundational controls. - **Early (~10%–30%)**: Moves into the core toolkit — in-context learning and few-shot prompting, vector databases and embeddings, and the Hugging Face ecosystem (Transformers pipelines, tokenizers, and the PEFT library). This stage solves the "how do I actually work with these models" problem. - **Middle (~30%–50%)**: Introduces LangChain and agents, building retrieval-augmented chains that connect vector stores, prompt templates, and models into composable pipelines. The focus shifts from individual techniques to orchestrating them. - **Late (~50%–80%)**: Covers fine-tuning in depth — LoRA, QLoRA quantization, prompt tuning, and Direct Preference Optimization — alongside model evaluation. This is where you learn to adapt models rather than just prompt them. - **Ending (~80%–100%)**: Shifts to enterprise solutions and LLMOps, framing LLMs as one component in larger organizational architectures rather than standalone tools. The excerpts do not cover the specific enterprise case studies in detail. 【Key Takeaways】 - **Temperature is your primary creativity dial** (Early): A value from 0 to 2 controls randomness; 0 gives consistent output, higher values increase diversity but also hallucinations. Practical for deciding when to use deterministic vs. creative generation. - **In-context learning is the fastest path to adaptation** (Early): Few-shot examples let you control output format and data volume without fine-tuning, making it ideal for proofs of concept and early project stages. - **Embeddings are the language LLMs actually understand** (Early): Text is tokenized, converted to vectors, processed, and converted back. Semantic search works by comparing vector distances, not keyword matching — which is why results can be relevant without containing the exact search term. - **Hugging Face offers two working modes with different trade-offs** (Early): Pipelines handle tokenization and inference automatically, while loading tokenizer and model separately gives more control. The book uses both and explains when each is preferable. - **LangChain chains compose like shell pipelines** (Middle): Retrievers, prompt templates, models, and output parsers connect via a pipe syntax, making RAG architectures readable and modular. - **Fine-tuning has a spectrum of efficiency** (Late): LoRA, QLoRA (4-bit quantized), and prompt tuning each trade off resource requirements against customization depth. QLoRA makes fine-tuning large models feasible on limited hardware. - **LLMs are a piece of the enterprise puzzle, not the whole solution** (Ending): In large organizations, these models must be integrated into broader architectures. The book emphasizes structuring solutions that can transform organizations with thousands of employees. 【Reading Tips】 - **Deep-read Part One (techniques and libraries)**: The foundational concepts — embeddings, temperature, in-context learning, vector databases — recur throughout every project. Skimming here will make later chapters harder. - **Work through the notebooks alongside the text**: The book ships with 20+ notebooks. The author explicitly asks readers to focus on techniques and their purpose rather than the specific models used, since models change rapidly. - **Treat Part Two (projects) as design-decision practice**: Each project may have multiple valid implementations. Compare your approach to the book's and understand why certain choices were made. - **Skim Part Three (enterprise) if you're an individual developer**: The organizational framing is valuable for architects and tech leads, but less immediately actionable for solo practitioners. - **Don't get stuck on embedding math**: The book acknowledges the conceptual density early on and reassures that code simplifies everything. Push through the theory; the practical implementation is straightforward. 【Coverage Limits】 This guide is based on stratified excerpts covering the book's introduction, table of contents, and selected passages from the early and middle chapters. Specific project implementations, evaluation metrics, and enterprise case studies are referenced but not detailed in the available excerpts.
Excerpt 1
using LLM while understanding the design decisions involved • Understand the role of Large Language Models in larger corporate settings Large Language Models...
View in text
Excerpt 2
mpanies: the generation of SQL code from natural language. The supporting code, which can be executed and modified, is available on Github via the book’s pro...
View in text
Excerpt 3
capturing the meaning of sentences and that they allow you to perform simple vector operations, such as calculating the distance between them. Key Takeaways...
View in text
Excerpt 4
the prompt template is constructed and sent to the model. Finally, the model’s response goes through StrOutputParser and is then received by the user. Now we...
View in text
Excerpt 5
to perform data analysis actions on any csv file provided. This Agent, despite being one of the most powerful and spectacular, is also one of the simplest to...
View in text
Excerpt 6
translations, but nothing could be further from the truth. A value between 0.3 and 0.4, though not perfect, cannot be considered bad; it retains the meaning...
View in text
Excerpt 7
offered by LangSmith. I assure you that we have seen only a very small portion, and many more things can be done, such as constructing your own evaluators. B...
View in text
Excerpt 8
hic forgetting, or catastrophic interference. LoRA reduces this possibility by keeping the majority of weights unchanged. One method used to reduce the numbe...
View in text
Tags
AI categories
Artificial IntelligenceProgrammingData
Publisher: Apress
Publish Year: 2024
Language: English
Pages: 366
File Format: PDF
File Size: 10.1 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…