Black Friday Deals For Authors Are On Now!

Leanpub Header

Skip to main content

Running Local LLMs on Your Own Hardware

A Practical Guide to Private, Offline, and Self-Hosted Large Language Models

Running Local LLMs on Your Own Hardware

A hands-on guide to downloading, running, serving, and maintaining open-weight LLMs on your own machine (477 manuscript pages).

Minimum price

$19.99

$29.99

You pay

Author earns

$

Also available for 1 book credit with a Reader Membership

PDF
About

About

About the Book

Open-weight models now run well on hardware you already own, whether that is a gaming laptop, a workstation with a single consumer GPU, an Apple Silicon Mac, or a capable CPU with enough memory. Running them yourself buys privacy, a cost that does not grow with usage, offline availability, and control over exactly what you depend on.

Running Local LLMs on Your Own Hardware is a practical, hands-on guide to downloading, running, serving, and maintaining those models. It is built around a durable mental model of local inference: how a model uses memory and compute, why memory capacity and bandwidth matter more than raw processor speed, and how that lets you predict what will fit and how fast it will run.

From there the book reads your hardware, chooses a model and quantization, sets up the environment, compares the major inference engines, and runs and diagnoses a first model. It then covers quantization, prompting and sampling, serving an OpenAI-compatible API, retrieval over your own documents, and fine-tuning with LoRA and QLoRA, before closing with benchmarking, scaling beyond one GPU, and security, privacy, maintenance, and troubleshooting.

Examples target Linux first (Debian and Ubuntu with NVIDIA GPUs), with call-outs for Apple Silicon, AMD, Windows through WSL2, and CPU-only setups. Because tools change quickly, the book teaches the principles behind the commands and treats specific flags and model names as snapshots to adapt.

Bundles

Bundles that include this book

Author

About the Author

Yohan J. Rodríguez

Yohan is a Senior Full-Stack Software Engineer with extensive experience delivering scalable, end-to-end software solutions across web, enterprise, and cloud-based environments. He specializes in architecting robust platforms, modernizing legacy systems, driving cloud transformation efforts, and building integration-heavy applications that support critical business workflows. He is recognized for translating complex requirements into reliable, maintainable, and high-value solutions across industries such as insurance, cybersecurity, and professional services.

Known for combining strong technical execution with a practical business mindset, he has contributed to projects from concept and design through production delivery and long-term support. His experience includes collaborating with cross-functional teams, improving development workflows, solving complex technical challenges, and helping organizations deliver dependable software products that adapt to changing business needs. He brings a balanced approach to engineering that values quality, efficiency, and continuous improvement.

Website: https://www.imabit.com

Contents

Table of Contents

  • Preface i
  • 1 Why Run LLMs Locally, and the Open-Weight Landscape 2
    • 1.1 What This Book Means by ``Local'' and ``Your Own Hardware'' 2
    • 1.2 A Short History of How Local LLMs Became Practical 4
    • 1.3 Five Reasons to Run Models Locally 5
    • 1.4 What You Give Up 9
    • 1.5 A Vocabulary for the Rest of the Book 11
    • 1.6 ``Open Weight'' Versus ``Open Source'' 12
    • 1.7 The Open-Weight Model Landscape 13
    • 1.8 Where the Models Live 15
    • 1.9 What Can You Realistically Run? 16
    • 1.10 Choosing Where to Run: Deployment Shapes 17
    • 1.11 What People Actually Build With Local Models 18
    • 1.12 What Local Models Are Good and Bad At 19
    • 1.13 The Tooling You Will Meet in This Book 19
    • 1.14 A Ten-Minute Taste: Run a Model Right Now 20
    • 1.15 Staying Current Without Getting Overwhelmed 22
    • 1.16 How to Use This Book 23
    • 1.17 Common Misconceptions to Leave Behind 24
    • 1.18 Frequently Asked First Questions 25
    • 1.19 A Note on Responsible Use 26
    • 1.20 A Readiness Checklist Before Chapter~2 27
    • 1.21 Recap and What Is Next 27
  • 2 How LLMs Work Under the Hood 30
    • 2.1 What a Language Model Actually Does 30
    • 2.2 Training Versus Inference: What You Are and Are Not Doing 32
    • 2.3 Tokens: The Unit Everything Is Measured In 32
    • 2.4 From Tokens to Vectors: Embeddings 35
    • 2.5 Inside a Transformer Block 37
    • 2.6 Attention and Why Context Is Expensive 41
    • 2.7 Autoregressive Decoding: One Token at a Time 42
    • 2.8 Prefill Versus Decode: Two Very Different Phases 43
    • 2.9 The KV Cache: Why Context Costs Memory 45
    • 2.10 Counting the Memory: Parameters, Precision, and Footprint 46
    • 2.11 Anatomy of a Model File 48
    • 2.12 Why Decode Is Memory-Bandwidth Bound 49
    • 2.13 Throughput Versus Latency 51
    • 2.14 The Context Window, in Memory Terms 52
    • 2.15 The Journey of a Prompt, End to End 53
    • 2.16 Putting It Together: A Worked Example 54
    • 2.17 A Diagnostic Table: Symptom to Mechanism 55
    • 2.18 Common Misconceptions to Leave Behind 55
    • 2.19 Pitfalls and Practical Reminders 56
    • 2.20 Recap and What Is Next 57
  • 3 Understanding Your Hardware 60
    • 3.1 The Hierarchy That Actually Matters 60
    • 3.2 Taking Inventory of Your Machine 62
    • 3.3 The GPU and VRAM: The Hard Limit 65
    • 3.4 Memory Bandwidth: The Real Speed Determinant 67
    • 3.5 The CPU Path: Running Without a GPU 69
    • 3.6 System RAM and Its Several Roles 70
    • 3.7 Apple Silicon and Unified Memory 71
    • 3.8 AMD GPUs and ROCm 72
    • 3.9 Multiple GPUs 73
    • 3.10 Cloud and Rented GPUs as a Hardware Option 74
    • 3.11 Laptops, Desktops, and Small Form Factors 75
    • 3.12 Common Machine Profiles 76
    • 3.13 What Each Class Can and Cannot Do 76
    • 3.14 Matching Hardware to Your Task 78
    • 3.15 Choosing GPUs by Budget 79
    • 3.16 The Unglamorous Constraints: PCIe, Power, Cooling, and Disk 79
    • 3.17 Putting It Together: Estimating What You Can Run 81
    • 3.18 From Inventory to a Model Shortlist 84
    • 3.19 Choosing or Upgrading Hardware 85
    • 3.20 Running Costs and Always-On Considerations 87
    • 3.21 Common Pitfalls 87
    • 3.22 A Hardware Diagnostic Table 88
    • 3.23 Planning for the Future 88
    • 3.24 A Hardware Quick Reference 89
    • 3.25 Recap and What Is Next 89
  • 4 Choosing and Sizing Models 92
    • 4.1 What Parameter Counts Mean in Practice 92
    • 4.2 The Memory Math, Made Precise 94
    • 4.3 Quantization Formats: The Landscape 96
    • 4.4 Context Length as a Sizing Factor 98
    • 4.5 Speed Targets: What Tokens per Second Feels Like 99
    • 4.6 Base, Instruct, Chat, and Specialized Variants 100
    • 4.7 Mixture-of-Experts Models in Selection 101
    • 4.8 Sizing Differs for Serving and Fine-Tuning 102
    • 4.9 Reading a Model Card Critically 102
    • 4.10 Evaluating Candidates on Your Own Tasks 104
    • 4.11 Using More Than One Model 107
    • 4.12 Reading Benchmarks Without Being Misled 107
    • 4.13 Matching the Model to Your Task 109
    • 4.14 Where to Discover Models 110
    • 4.15 A Repeatable Selection Procedure 110
    • 4.16 Finding and Downloading the Model You Chose 112
    • 4.17 Worked Selections 116
    • 4.18 Realistic Expectations by Task 117
    • 4.19 Common Pitfalls 117
    • 4.20 Documenting and Pinning Your Choice 118
    • 4.21 Selection Is Iterative, Not Final 119
    • 4.22 Frequently Asked Questions About Choosing 119
    • 4.23 Choosing Auxiliary Models: Embeddings and Rerankers 120
    • 4.24 When Local Is Not the Right Model Choice 121
    • 4.25 Recap and What Is Next 121
  • 5 Setting Up Your Environment 124
    • 5.1 The Shape of a Local-Inference Software Stack 124
    • 5.2 Two Paths: The Easy Way and the Full Way 125
    • 5.3 NVIDIA: Drivers and CUDA on Debian and Ubuntu 126
    • 5.4 AMD: Installing ROCm 129
    • 5.5 Apple Silicon: Minimal Prerequisites 130
    • 5.6 Windows: Use WSL2 130
    • 5.7 CPU-Only Environments 131
    • 5.8 Python Done Right 132
    • 5.9 Users, Permissions, and Running as a Service 133
    • 5.10 Containers: Docker and the NVIDIA Container Toolkit 134
    • 5.11 Tailoring Setup to Your Goal 136
    • 5.12 Why Setup Feels Hard --- and Why It Gets Easier 136
    • 5.13 Hugging Face Authentication 136
    • 5.14 Where Models Will Live: Storage Layout and Disk Planning 137
    • 5.15 Environment Variables That Matter 139
    • 5.16 Networks, Firewalls, and Proxies 140
    • 5.17 Offline and Air-Gapped Operation 140
    • 5.18 Multi-GPU Environment Setup 141
    • 5.19 Where Configuration Lives 141
    • 5.20 Verifying the Whole Stack 142
    • 5.21 A Worked End-to-End Setup 144
    • 5.22 Backing Up and Moving to a New Machine 145
    • 5.23 Keeping the Setup Reproducible 146
    • 5.24 Updating and Maintaining the Environment 146
    • 5.25 Troubleshooting Setup Problems 147
    • 5.26 When You Are Truly Stuck: Getting Help 148
    • 5.27 Common Pitfalls 149
    • 5.28 Recap and What Is Next 149
  • 6 Inference Engines and Runtimes 152
    • 6.1 What an Inference Engine Does 152
    • 6.2 How to Choose an Engine 153
    • 6.3 Ollama: The Easy Default 155
    • 6.4 llama.cpp: The Foundation 156
    • 6.5 vLLM: High-Throughput Serving 158
    • 6.6 Graphical Tools: LM Studio and Jan 159
    • 6.7 text-generation-webui: The Experimenter's Workbench 160
    • 6.8 Hugging Face TGI and the ExLlama Stack 160
    • 6.9 What Each Engine's API Offers 162
    • 6.10 Engines Beyond Chat: Embeddings, Vision, and More 163
    • 6.11 Managing Models Across Engines 163
    • 6.12 Engine Performance Is Not Uniform 164
    • 6.13 How Engines Load Models 165
    • 6.14 Concurrency: One Engine, Many Requests 166
    • 6.15 Other Engines Worth Knowing 166
    • 6.16 Choosing by Platform 168
    • 6.17 The Capability Matrix 168
    • 6.18 Running Engines in Containers 170
    • 6.19 A Worked Multi-Engine Setup 170
    • 6.20 Keeping Engines Updated 171
    • 6.21 Network and Security Defaults 172
    • 6.22 The OpenAI-Compatible API: The Unifying Thread 173
    • 6.23 A Decision Guide by Use Case 175
    • 6.24 Troubleshooting Engine Startup 176
    • 6.25 Stability, Maturity, and Production Use 176
    • 6.26 Running an Engine Alongside Your Other Work 177
    • 6.27 The Engine's Own Footprint and Observability 177
    • 6.28 Trust and Isolation of Engines 177
    • 6.29 Common Pitfalls 178
    • 6.30 Recap and What Is Next 179
  • 7 Running Your First Model 181
    • 7.1 The Shape of a First Run 181
    • 7.2 The Obtain Stage in Practice 182
    • 7.3 First Run with Ollama 183
    • 7.4 First Run with llama.cpp 184
    • 7.5 First Run on Other Platforms 186
    • 7.6 First Run with a Graphical Tool 186
    • 7.7 First Run in a Container 187
    • 7.8 Your First API Call 187
    • 7.9 Chat Templates in Practice 190
    • 7.10 Interactive Mode Versus Server Mode 191
    • 7.11 The Interactive Session 191
    • 7.12 Setting Expectations for First-Run Output 191
    • 7.13 Managing the Running Model 193
    • 7.14 First-Run Problem: Out of Memory 193
    • 7.15 First-Run Problem: Silent CPU Fallback 194
    • 7.16 First-Run Problem: Garbled or Endless Output 195
    • 7.17 First-Run Problem: Repetitive or Looping Output 195
    • 7.18 First-Run Problem: Refusals and Over-Caution 196
    • 7.19 First-Run Problem: Too Slow 196
    • 7.20 First-Run Problem: Will Not Load 197
    • 7.21 Engine-Specific First-Run Notes 198
    • 7.22 A First-Run Decision Tree 198
    • 7.23 A First-Run Troubleshooting Table 199
    • 7.24 A Complete Worked Session 200
    • 7.25 What a Successful First Run Looks Like 201
    • 7.26 Confirming It Truly Runs Locally 201
    • 7.27 Keeping Notes on Your First Setup 201
    • 7.28 Your First Useful Task 202
    • 7.29 What Comes After a Successful First Run 202
    • 7.30 Leaving the Model Running for Your Devices 202
    • 7.31 Trying Several Models in One Sitting 203
    • 7.32 Frequently Asked First-Run Questions 203
    • 7.33 Common Pitfalls 204
    • 7.34 Recap and What Is Next 204
  • 8 Quantization Deep Dive 208
    • 8.1 How 4-Bit Became Normal 208
    • 8.2 What Quantization Actually Does 209
    • 8.3 Integer Versus Float Quantization 211
    • 8.4 The Quality Cost and How to Measure It 213
    • 8.5 GGUF Quantization Types in Detail 214
    • 8.6 Importance-Matrix (IQ) Quants 218
    • 8.7 GPU-Native Quantization Formats 219
    • 8.8 Quantizing a Model Yourself 221
    • 8.9 Quantizing the KV Cache 224
    • 8.10 Per-Tier Recommendations 225
    • 8.11 Measuring Quality on Your Own Tasks 227
    • 8.12 A Worked Comparison: Q4 Versus Q8 228
    • 8.13 A Decision Procedure for Quantization 229
    • 8.14 The Trajectory of Quantization 230
    • 8.15 Frequently Asked Questions About Quantization 231
    • 8.16 What People Actually Use 232
    • 8.17 Quantizing the Whole Pipeline 232
    • 8.18 The Quantization Choices You Actually Make 233
    • 8.19 Common Misconceptions 233
    • 8.20 Quantization in the Full Memory Picture 234
    • 8.21 Quantization Is Not Faking It 234
    • 8.22 Common Pitfalls 235
    • 8.23 Recap and What Is Next 236
  • 9 Prompting, Sampling, and Generation Parameters 238
    • 9.1 The Pipeline and Where Each Lever Acts 239
    • 9.2 Chat Templates and Special Tokens 239
    • 9.3 The System Prompt: Your Most Powerful Lever 240
    • 9.4 Prompt Engineering Essentials 241
    • 9.5 Temperature: The Core Sampling Knob 245
    • 9.6 Top-p, Top-k, and Min-p 246
    • 9.7 Penalties: Controlling Repetition 249
    • 9.8 Controlling Length and Stopping 249
    • 9.9 Seeds and Determinism 251
    • 9.10 Structured Output: Schemas and Grammars 252
    • 9.11 Managing the Context Window 255
    • 9.12 Prompt Caching 258
    • 9.13 Putting Parameters Together: Presets by Task 258
    • 9.14 Combining the Levers: A Worked Task 261
    • 9.15 A Diagnostic Table: Symptom to Setting 261
    • 9.16 Common Misconceptions 262
    • 9.17 When a Model Ignores Your Instructions 263
    • 9.18 Prompt Injection: A Preview 263
    • 9.19 What Prompting and Parameters Cannot Fix 264
    • 9.20 Common Pitfalls 264
    • 9.21 Prompting Is a Craft, Not Incantation 265
    • 9.22 Building a Prompt-Evaluation Habit 266
    • 9.23 Treating Prompts as Part of the System 266
    • 9.24 Recap and What Is Next 267
  • 10 Serving Local LLMs as APIs 270
    • 10.1 The OpenAI-Compatible API as the Contract 270
    • 10.2 To Serve or to Embed 271
    • 10.3 Anatomy of a Request and Response 272
    • 10.4 The Endpoints 273
    • 10.5 Streaming Responses 274
    • 10.6 Client Code in Any Language 275
    • 10.7 Running the Engine as a Service 277
    • 10.8 Reverse Proxy and TLS 279
    • 10.9 Authentication and Rate Limiting 280
    • 10.10 Concurrency and When to Use a Serving Engine 282
    • 10.11 Multiple Models and Routing 283
    • 10.12 Capacity Planning for a Served Model 283
    • 10.13 Connecting Tools and Frameworks 285
    • 10.14 Health Checks and Monitoring 288
    • 10.15 Deployment Topologies 290
    • 10.16 A Reference Deployment 292
    • 10.17 Local Network Versus Internet Exposure 292
    • 10.18 Logging, Privacy, and What a Service Records 294
    • 10.19 Streaming in Real Applications 294
    • 10.20 Securing What the Model Can Do 295
    • 10.21 Common Pitfalls 295
    • 10.22 When a Hosted API Is the Better Serving Choice 296
    • 10.23 Choosing Your Serving Stack 297
    • 10.24 Frequently Asked Questions About Serving 297
    • 10.25 Operating the Service Day to Day 298
    • 10.26 The Serving Mindset 299
    • 10.27 Recap and What Is Next 299
  • 11 Retrieval-Augmented Generation and Embeddings 302
    • 11.1 Why Retrieval-Augmented Generation 302
    • 11.2 The RAG Pipeline 303
    • 11.3 Embeddings and Local Embedding Models 305
    • 11.4 Chunking 308
    • 11.5 Vector Stores 309
    • 11.6 Retrieval 312
    • 11.7 Building the Prompt and Generating 313
    • 11.8 Embeddings Beyond Retrieval 315
    • 11.9 Frameworks Versus Building It Yourself 316
    • 11.10 Reranking 317
    • 11.11 Hybrid Search 318
    • 11.12 Evaluating Retrieval 320
    • 11.13 Keeping It Offline 322
    • 11.14 Retrieved Knowledge Versus the Model's Own 323
    • 11.15 Improving RAG and Its Failure Modes 324
    • 11.16 RAG Versus Fine-Tuning Versus Long Context 324
    • 11.17 The Complete Project: A Private Knowledge Assistant 325
    • 11.18 The Cost and Latency of RAG 328
    • 11.19 Maintaining a RAG System Over Time 329
    • 11.20 RAG and Agents 329
    • 11.21 Frequently Asked Questions About RAG 330
    • 11.22 Common Pitfalls 330
    • 11.23 Why RAG Is the Quintessential Local Application 331
    • 11.24 Recap and What Is Next 332
  • 12 Fine-Tuning and Adapters 335
    • 12.1 When to Fine-Tune --- and When Not To 335
    • 12.2 Fine-Tuning as Amortized Prompting 337
    • 12.3 What Fine-Tuning Does --- and Does Not Do 338
    • 12.4 Full Fine-Tuning, LoRA, and QLoRA 341
    • 12.5 VRAM Budgeting for Training 343
    • 12.6 Datasets: Quality Over Quantity 345
    • 12.7 Tooling 347
    • 12.8 A QLoRA Run, End to End 349
    • 12.9 Hyperparameters 351
    • 12.10 Merging and Exporting to GGUF 352
    • 12.11 Using Adapters at Inference 353
    • 12.12 Evaluating a Fine-Tune 355
    • 12.13 Common Problems and How to Fix Them 357
    • 12.14 Fine-Tuning Other Model Types 358
    • 12.15 RAG, Fine-Tuning, or Both 358
    • 12.16 Realistic Expectations 360
    • 12.17 Frequently Asked Questions About Fine-Tuning 360
    • 12.18 Common Pitfalls 361
    • 12.19 The Effort and Economics of Fine-Tuning 361
    • 12.20 Recap and What Is Next 362
  • 13 Performance Optimization and Benchmarking 366
    • 13.1 Measure Before You Optimize 366
    • 13.2 The Metrics That Matter 367
    • 13.3 Benchmarking Tools 367
    • 13.4 Benchmarking Methodology 368
    • 13.5 Monitoring During Inference 369
    • 13.6 Establishing a Baseline 370
    • 13.7 The Roofline: Compute Versus Memory 371
    • 13.8 GPU Offload Tuning 372
    • 13.9 Flash Attention 373
    • 13.10 KV-Cache Quantization for Speed 373
    • 13.11 Context Length and Batch Size 374
    • 13.12 Speculative Decoding 374
    • 13.13 Prefill Optimization and Prompt Caching 375
    • 13.14 Optimizing Throughput 376
    • 13.15 Finding the Bottleneck 377
    • 13.16 Quantization as a Speed Lever 377
    • 13.17 Hardware-Level Factors 378
    • 13.18 Quantization Format and Engine Speed 378
    • 13.19 CPU and Hybrid Inference Tuning 378
    • 13.20 Keeping a Benchmark Log 379
    • 13.21 A Worked Optimization 380
    • 13.22 Model Load Time and Storage 380
    • 13.23 The Cost of Sampling and Generation Parameters 380
    • 13.24 Latency in Interactive Use 381
    • 13.25 Tokens per Watt: Efficiency 382
    • 13.26 An Optimization Decision Guide 382
    • 13.27 Memory Is Speed 383
    • 13.28 Profiling Where the Time Goes 383
    • 13.29 Realistic Expectations by Hardware Tier 384
    • 13.30 Diagnosing a Silent CPU Fallback 385
    • 13.31 Comparing Engines on Your Hardware 385
    • 13.32 Speed Versus Quality 385
    • 13.33 A Second Worked Example: Serving Throughput 386
    • 13.34 Server-Level Tuning for Serving 387
    • 13.35 Knowing When to Stop 387
    • 13.36 Automating Your Benchmarks 387
    • 13.37 Common Pitfalls 387
    • 13.38 Recap and What Is Next 388
  • 14 Multi-GPU, CPU Offload, and Scaling on a Budget 390
    • 14.1 The Central Trade: Capacity Versus Speed 390
    • 14.2 When You Need to Scale 391
    • 14.3 Multi-GPU: Adding VRAM at VRAM Speed 392
    • 14.4 Layer Split Versus Tensor Parallel 394
    • 14.5 CPU Offload: Capacity at System-Memory Speed 394
    • 14.6 Measuring the Offload Cliff 397
    • 14.7 RAM Spill and the Disk Cliff 398
    • 14.8 Mixing Mismatched GPUs 399
    • 14.9 Serving a Large Model Across GPUs 400
    • 14.10 Budget Scaling Strategy 401
    • 14.11 Memory Accounting Across Devices 403
    • 14.12 Predicting Speed Before You Commit 404
    • 14.13 The Interconnect Decides Multi-GPU Speed 404
    • 14.14 Prefill Versus Decode in Multi-Device Setups 404
    • 14.15 MoE Models and Scaling 405
    • 14.16 Operating a Multi-GPU Machine 405
    • 14.17 Renting GPUs for Occasional Big Models 406
    • 14.18 Quantization as the First Scaling Tool 406
    • 14.19 Apple Silicon and Unified Memory 407
    • 14.20 Offloading Weights Versus the KV Cache 407
    • 14.21 Speculative Decoding for Scaled Models 408
    • 14.22 Distributed Inference Across Machines 408
    • 14.23 Loading Large Models 409
    • 14.24 Realistic Speeds by Scaling Path 409
    • 14.25 Knowing When to Stop Scaling 410
    • 14.26 A Worked Scaling Decision 410
    • 14.27 Long Context as a Scaling Problem 411
    • 14.28 Running Several Models at Once 412
    • 14.29 The Long-Term View 412
    • 14.30 Multi-GPU for Fine-Tuning 412
    • 14.31 Reliability of Scaled Setups 413
    • 14.32 Containers and Scaled Deployments 413
    • 14.33 Common Pitfalls 414
    • 14.34 Recap and What Is Next 415
  • 15 Security, Privacy, Maintenance, and Troubleshooting 417
    • 15.1 The Local Security Model 417
    • 15.2 Never Expose the Raw Engine 418
    • 15.3 Authenticated, Encrypted Access 419
    • 15.4 Least Privilege for Capability 420
    • 15.5 Prompt Injection and Untrusted Content 422
    • 15.6 Agents, Tool Use, and the Model Context Protocol 424
    • 15.7 The Model Supply Chain 427
    • 15.8 Network Architecture for Access 428
    • 15.9 Multi-User Access and Abuse Control 429
    • 15.10 Resource Limits and Availability 430
    • 15.11 Privacy in Earnest 430
    • 15.12 Where Your Data Can Actually Go 432
    • 15.13 Data Retention and Conversation History 433
    • 15.14 Compliance and Regulated Data 434
    • 15.15 Maintaining the Stack 434
    • 15.16 Backups and Recovery 436
    • 15.17 Keeping Models Current 437
    • 15.18 Monitoring and Health Checks 437
    • 15.19 Systematic Troubleshooting 438
    • 15.20 Hardening the Host 440
    • 15.21 Securing the RAG and Document Pipeline 441
    • 15.22 Incident Response and Recovery 441
    • 15.23 Operating at Different Scales 442
    • 15.24 A Troubleshooting Method 442
    • 15.25 Documenting Your Deployment 443
    • 15.26 Routine Operations 444
    • 15.27 Where Local Changes the Calculus 444
    • 15.28 Two Worked Troubleshooting Cases 445
    • 15.29 A Security and Operations Checklist 445
    • 15.30 The Operator's Mindset 447
    • 15.31 Common Pitfalls 447
    • 15.32 Recap and What Is Next 448
  • Conclusion 450
  • References 452

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

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.

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.)

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

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub