Running Models YourselfLesson 80 of 82

Module 9 · Making it yours: adapters and training

Serving what you made, merged or not

In this lesson

  • 8 min read
  • 6 reading sections
  • Knowledge check
  • Lesson 7 of 9 in this chapter

This chapter’s goalDecide whether a stated failure calls for a better prompt, retrieval or weight training; produce a LoRA adapter on one consumer card from a dataset you built with the correct chat template and loss masking; distinguish generalisation from memorisation and from catastrophic forgetting using a held-out set and a general-capability check; serve or merge the adapter; and state which licences the resulting weights inherit.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 7Free · no account needed
Lesson steps

Two ways to deploy, with different properties

An adapter can stay separate or be folded into the weights. The choice is not about quality; it is about how many adapters you have and where they need to run.

Keep it separate. The base model sits in VRAM once, and adapters are applied at runtime. vLLM supports this directly:

Bash
vllm serve Qwen/Qwen2.5-7B-Instruct \
  --enable-lora --max-loras 4 --max-lora-rank 32 \
  --lora-modules triage=/srv/adapters/triage support=/srv/adapters/support

Callers then ask for triage or support as if they were separate models, and both are served from one copy of the base. For a team with several task adapters this is a large memory saving: one 14GB base and three 40MB adapters instead of three 14GB models.

Merge it. Fold the update into the weights and produce a single ordinary model:

Python
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.bfloat16)
merged = PeftModel.from_pretrained(base, "out/checkpoint-150").merge_and_unload()
merged.save_pretrained("merged-model"); tok.save_pretrained("merged-model")

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Open Model Ecosystem exam.

Stuck on something?Ask Tri, your AI tutor

How to cite: Addaly (2026) ‘Serving what you made, merged or not’, in Running Models Yourself. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/running-models-yourself/serving-and-merging-adapters (Accessed: 29 November 2026).