Who it is forA team with separate fine-tunes for support replies, summaries and tagging who cannot host three full models.
The problemKeeping a full copy of a model for every task wastes storage and GPU memory.
The outcomeOne base model in memory with small adapters you load and switch per request.
What you need first
- Python with PyTorch and Transformers
- A GPU with enough memory for the base model (the README shows a 3B model on far less memory with LoRA)
- A dataset for your task
Steps
- Load a trained adapter for inference with
PeftModel.from_pretrainedon top of the base model - With a Transformers model, add adapters with
add_adapterand load trained ones withload_adapter - Switch between them with
set_adapter, for example to lora_2 - Keep each adapter as its own small checkpoint per task or dataset
Prompt for your agent
Using huggingface/peft, load base model <model> once and attach adapters <adapter A> and <adapter B> with load_adapter. Write a function that switches adapters with set_adapter per request and test each on <prompt>.
Caveat. The Transformers integration does not include every PEFT feature, such as merging the adapter into the base model.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for huggingface/peft and "Serve several task adapters from one base model"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer