Adapters

Cache one base model once, then hot-swap small flavors on top of it, megabytes, not gigabytes. One base, many skills.

The idea

A tune is a small set of learned weights layered on a base model. Instead of shipping a whole fine-tuned checkpoint for every task, you keep the base cached once and load each specialization as an adapter, a flavor. The base is the heavy part (gigabytes); a flavor is the small delta that turns it into a support agent, a refunds classifier, or a code reviewer. Because the flavor rides on weights you already have, it's measured in megabytes.

Load a flavor

Load the base once, then snap a flavor onto it with loadAdapter. The base is already cached, so only the small flavor is fetched:

flavor.ts
import { Gerbil } from "@tryhamster/gerbil";
const g = new Gerbil();
await g.loadModel("qwen3.5-0.8b"); // heavy base — cached once
await g.loadAdapter("hf:eyal/support-flavor"); // MB-size flavor on top
const { text } = await g.generate("Ticket: my card was charged twice");

Prefer one line? Pass the flavor straight to loadModel:

one-shot.ts
await g.loadModel("qwen3.5-0.8b", { adapter: "hf:eyal/support-flavor" });

Hot-swap without re-downloading the base

Switching skills doesn't touch the base. Load a different flavor and the same cached model takes on a new specialization, no multi-gigabyte download, no second model in memory:

swap.ts
// Same base, different skill — only the small flavor is fetched.
await g.loadAdapter("hf:eyal/refunds-flavor");
const { text } = await g.generate("Was I refunded for order #4821?");

Why this matters on the edge

The engine runs on-device, in the browser on WebGPU, in Node, or on a phone. Small flavors turn that into a real advantage:

  • Tiny updates ship over-the-air. Improve a skill and push a few megabytes, not a fresh multi-gigabyte model. The base already lives on the device.
  • It runs offline. Once the base and a flavor are cached, inference needs no network at all.
  • It stays private. The prompt, the flavor, and the output all stay on-device, nothing is sent to a server.
  • One base, many skills. Ship a single cached base and a library of flavors, and swap between them instantly instead of paying for a model per task.
Coming

An adapter marketplace, share and install flavors, the next “skill.” Publish a flavor once and let anyone snap it onto the same cached base.

Multi-flavor hosting, serve many flavors per GPU off a single loaded base, so a fleet of specialists costs about as much as one model.

What's next

Flavors are how a finished tune travels light. To make one, head to Tune; to run a finished model (as merged weights or as a flavor on a cached base), see Using your model.