AI Engineering / Working with LLMsLocal & Open-Source Model Deployment

70 items

1

Enabling Flash Attention 2

Code Quiz
2

Why Run Models Locally

Quiz
3

Quantization Formats: GPTQ, AWQ, GGUF

Slides / Video
4

Streaming Without a Background Thread

Code Quiz
5

4-bit Loading with BitsAndBytesConfig

Code Quiz
6

AutoTokenizer and AutoModel Loading

Code Quiz
7

Generating and Decoding Output

Code Quiz
8

Deploying Open Models on Cloud GPUs

Slides / Video
9

Securing Self-Hosted Model Servers

Slides / Video
10

Loading a Model with the Pipeline

Code Quiz
11

Half-Precision Loading with torch_dtype

Code Quiz
12

Device Placement with device_map

Code Quiz
13

Applying a Chat Template

Code Quiz
14

Configuring Sampling Parameters

Code Quiz
15

Stop Sequence with stop_strings

Code Quiz
16

Where trust_remote_code Belongs

Code Quiz
17

Slicing Off the Prompt Tokens

Code Quiz
18

Local Embedding and Reranker Models

Slides / Video
19

Benchmarking Local Inference Speed

Slides / Video
20

Serving LoRA Adapters Locally

Slides / Video
21

Containerizing Local Model Deployments

Slides / Video
22

Serving Quantized Models: Speed vs Quality

Slides / Video
23

Chat Templates Per Model

Slides / Video
24

OpenAI-Compatible Local API Endpoints

Slides / Video
25

CPU Offloading and Mixed Inference

Slides / Video
26

Model Sharding and Parallelism

Slides / Video
27

Estimating VRAM for a Model

Slides / Video
28

PagedAttention and KV Cache Management

Slides / Video
29

Production Serving Engines for LLMs

Slides / Video
30

Local Inference Runtimes Compared

Slides / Video
31

Model Weight Formats Explained

Slides / Video
32

Landscape of Open Models

Slides / Video
33

Authenticating for Gated HF Models

Code Quiz
34

Batched Generation Padding Side

Code Quiz
35

Estimating VRAM from Parameter Count

Code Quiz
36

GPU Offloading with n_gpu_layers

Code Quiz
37

Loading a Model from a Local Path

Code Quiz
38

KV Cache During Generation

Code Quiz
39

Merging a LoRA Adapter

Code Quiz
40

Local Embeddings with sentence-transformers

Code Quiz
41

Missing pad token for GPT-2

Code Quiz
42

max_new_tokens vs max_length

Code Quiz
43

OpenAI client base_url path

Code Quiz
44

vLLM model name mismatch

Code Quiz
45

Default context window too small

Code Quiz
46

Reading an Ollama response

Code Quiz
47

Loading a GGUF with llama-cpp

Code Quiz
48

Open Model Licensing and Commercial Use

Slides / Video
49

Open-Source vs Open-Weight vs Proprietary

Slides / Video
50

Why Run LLMs Locally

Slides / Video
51

Chat Templates per Model

Flashcard
52

Containerizing Model Deployments

Flashcard
53

Security of Self-Hosted Inference

Flashcard
54

Edge and On-Device Constraints

Flashcard
55

Evaluating Quantization Quality Loss

Flashcard
56

Serving LoRA Adapters Locally

Flashcard
57

Cloud GPU Providers for Self-Hosting

Flashcard
58

Context Length and RoPE Scaling

Flashcard
59

GGUF Quantization Formats

Flashcard
60

OpenAI-Compatible Local API

Flashcard
61

Multi-GPU Inference

Flashcard
62

Model Weight Formats

Flashcard
63

Open-Source Model Landscape

Flashcard
64

VRAM Estimation

Flashcard
65

Hugging Face Hub Downloading

Flashcard
66

Memory Offloading

Flashcard
67

GPU vs CPU vs Apple Silicon

Flashcard
68

Open Weights vs Open Source

Flashcard
69

Local Inference Runtimes

Flashcard
70

PagedAttention and vLLM

Flashcard
Code QuizAdvanced

Enabling Flash Attention 2

Spot why requesting flash_attention_2 fails when loading a model in full precision.

Codepython
from transformers import AutoModelForCausalLM
import torch

model = AutoModelForCausalLM.from_pretrained(
    "mistralai/Mistral-7B-v0.1",
    torch_dtype=torch.float32,
    attn_implementation="flash_attention_2",
)

What is the bug that prevents this model from loading with Flash Attention 2?