Tune

Fine-tune a small model on your data and get back native weights that run anywhere: in the browser, in Node, or hosted. One artifact, no conversion step, and the weights are yours to keep.

The idea

You bring a dataset (or just describe the task), pick a base model, and Gerbil trains a specialized version of it. The result is a single native checkpoint the Gerbil engine loads directly, the same engine that runs Qwen 3.5, LFM2.5, and Gemma 4 today. Because the artifact is just weights, you can run it on-device, on your own server, or one-click host it. Nothing about your model is locked to us.

Quick start

Two verbs: capture collects training data from your own calls (locally, nothing sent), and tune trains from it with your API key. Everything runs from your code.

tune.ts
import { capture, tune } from "@tryhamster/gerbil/tune";
// Collect from your own calls — local, nothing leaves your machine:
await capture("support-triage", { input: ticket, output: label });
// Train from what you collected — priced by size, charged to your account.
// Only the compiled set for this one task is sent, when you call tune():
const model = await tune({ task: "support-triage", base: "qwen3.5-0.8b" });
await model.until("completed");
console.log(model.outputRepo); // your tuned model

The result is a native model you load with the engine, in the browser, in Node, or hosted:

run.ts
import { Gerbil } from "@tryhamster/gerbil";
const g = new Gerbil();
await g.loadModel(model.outputRepo); // run anywhere
const { text } = await g.generate("Ticket: my card was charged twice");

No data yet? Have the Tune surface generate a dataset from a task description, or see Label your logs to build one on your own machine.

No dataset? Describe the task

If you know what you want but have no data, the Tune surface generates one for you: describe the task and a frontier teacher writes a quality-filtered dataset, then trains on it. You keep both the model and the dataset. To keep everything in code and on your own machine, train a labeler and label your own data, then tune from it.

CLI

The same flow from the terminal:

Terminal
gerbil-tune create --base qwen3.5-0.8b --data ./data.jsonl --wait
gerbil-tune status <jobId>
gerbil-tune generate <jobId> "your prompt"

Capture from production

Already calling a frontier model in production? Those calls are labeled examples you paid for. With Capture you tag each call-site by task, and each tag becomes a clean dataset you can train a specialist from, no firehose to sift through later.

Data format

A .jsonl file, one example per line. Three shapes are accepted so you can bring chat transcripts or plain pairs without reformatting (minimum 100 examples):

data.jsonl
{"messages": [{"role": "user", "content": "…"}, {"role": "assistant", "content": "…"}]}
{"prompt": "Classify: …", "completion": "billing"}
{"input": "…", "output": "…"}

Base models

Pick by the shape of the task. All train to the same native artifact, so everything downstream (playground, download, hosting) is identical.

BaseBest for
qwen3.5-0.8bSmallest & fastest, classification, extraction, routing. Runs on almost any device.
qwen3.5-2bHigher quality and multimodal (text + images), tasks that need more reasoning.
gemma-4-e2bGoogle's Gemma 4 E2B, strong general reasoning with a long 32k context. Trained text-only for now.
lfm2.5-230mLiquid's tiny LFM 2.5 230M, the fastest on-device base for classification, extraction, and routing.
lfm2.5-350mLiquid's LFM 2.5 350M, a touch more capable than the 230M while still tiny enough to run almost anywhere.
lfm2.5-1.2bLiquid's LFM 2.5, a compact, efficient hybrid, a middle ground between the small and large bases.

Every base trains to the same native artifact and runs on the engine with no conversion.

Accounts, API keys & billing

Tuning from code runs against your account. Create an API key in the dashboard; tune() reads GERBIL_API_KEY from the environment (or pass apiKey). The key is stored hashed, you see the secret once. Training is priced by dataset size and charged to the payment method on your account.

auth.ts
import { tune } from "@tryhamster/gerbil/tune";
// Reads GERBIL_API_KEY from the environment by default.
const model = await tune({ task: "support-triage", apiKey: process.env.GERBIL_API_KEY });

What each action costs, so nothing is a surprise:

  • The in-browser demo is free. Run the whole flow and try the result before paying anything.
  • Train & own starts at $99 , the minimum, covering up to 1,000 training examples (real + synthetic combined). Above that the training price scales per-example with your dataset size, so it's simply the price of the data you train on, not a base plus surcharge. Synthetic data adds a small per-example generation fee. Includes the native weights download, no separate export fee, the model is yours.
  • Hosting is $49/mo per model (1M requests included, then metered), and host & auto-tune (autotrain retraining) is from $499/mo, the same size-based economics as a one-off, at a lower per-retrain rate.

The dashboard is where you manage models, API keys, usage, and receipts. Keys are scoped and revocable; hosted endpoints authenticate with the same key. (Accounts and billing are rolling out; the demo needs none of it.)

Run it anywhere

The tuned model is a normal Gerbil model. Load it by repo with the engine, in the browser or Node:

run.ts
import { Gerbil } from "@tryhamster/gerbil";
const g = new Gerbil();
await g.loadModel("gerbil-tuned/your-model");
const { text } = await g.generate("…");

Once a tune finishes, Using your model walks through the artifact you get and how to run it in the browser, in Node, or hosted.

A tune also produces a flavor, a small LoRA adapter you can snap onto a cached base and hot-swap without re-downloading it. See Adapters for one base, many skills.

Try it live

The Tune surface runs the whole flow in your browser, pick a base, add data (or a sample), train, and try the result on-device in a playground.