Using your model

Your tune finished. What you have now is a native model artifact in its own repo. The Gerbil engine loads it directly, no conversion step, and runs it the same way everywhere: in the browser, in Node, or hosted.

What you get

Training merges the fine-tuned weights into a 16-bit safetensors checkpoint and pushes it to your model's repo (shown as Output repo on the model's detail page). That repo is the artifact. There is no separate export format to manage, it is just the weights, and they are yours to keep.

The engine quantizes on the fly: INT4 is applied at load when you ask for it, so the same 16-bit repo runs light on a laptop GPU and full-precision on a server. One artifact, tuned by the device it lands on.

Download your weights, own them, run local

Your repo is private (it holds weights you paid for). The cleanest way to own the model is to pull the files down. On the model's detail page, Download weights hands you a one-line command:

terminal
curl -fsSL "https://gerbilsdk.com/api/tune/jobs/<id>/install?token=..." | bash

It pulls the weights straight from Hugging Face into a local folder (nothing streams through us). Then load them with no network at all:

run-local.ts
import { Gerbil } from "@tryhamster/gerbil";
const g = new Gerbil();
await g.loadModel("file:./your-model"); // fully local, no HF at runtime
const { text } = await g.generate("Ticket: my card was charged twice");

Prefer serving from your own infrastructure? Set GERBIL_MODEL_BASE to a mirror host (an R2 bucket, your CDN) laid out like Hugging Face, and the engine pulls the whole model from there instead.

Run it with the engine

Point loadModel at a local folder (file:), your own mirror, or a Hugging Face repo id you have access to. Everything else is a normal Gerbil call:

run.ts
const g = new Gerbil();
await g.loadModel("file:./your-model"); // local files
// or a repo you can access:
// await g.loadModel("hf:your-user/your-model");
const { text } = await g.generate("Ticket: my card was charged twice");

Ask for INT4 at load when you want the smaller, faster footprint:

run-int4.ts
await g.loadModel("file:./your-model", { dtype: "q4" });

Or load it as a flavor on a cached base

A tune produces a small delta on a base model, a flavor (a LoRA adapter). Instead of a full checkpoint, keep the base cached once and snap this tune on with loadAdapter, then hot-swap skills without re-downloading the base. See Adapters for one base, many skills, and why it pays off on-device.

Browser, Node, or hosted

The same repo, the same two lines, runs wherever the engine runs:

  • Browser on WebGPU, so inference happens on the visitor's device and nothing is sent to a server.
  • Node on Dawn (the native WebGPU backend), fast on a GPU server and still working on CPU without one.
  • Hosted, one-click, when you want a URL to call instead of running it yourself.

Once you have the weights (above), the same folder runs everywhere with no network. Hosting is the built-in way to serve the model to an app or teammates without handing anyone the files.

Structured output

If you tuned a classifier or extractor, pin the shape of the answer with a schema so it always comes back clean. generateObject validates the result against your schema and retries extraction under the hood:

classify.ts
import { Gerbil } from "@tryhamster/gerbil";
const g = new Gerbil();
await g.loadModel("file:./your-model");
// Validates the JSON output and retries extraction on a miss.
const { object } = await g.generateObject("My card was charged twice", {
schema: {
properties: { label: { enum: ["billing", "bug", "feature-request", "other"] } },
required: ["label"],
},
});
// object.label → "billing"

This pairs naturally with a labeler: see Label your logs to build the model, then enforce the same label set at inference time.

Tip

Retries are free, so crank them up until the schema passes. Your model runs on-device, so bumping maxRetries costs nothing but a moment, there's no per-call bill or rate limit. Let it re-roll until the JSON validates and extraction comes back clean every time. See Structured Output for the full retry loop.

What's next

From the model's detail page you can try it in the playground, one-click host it, or turn on auto-tune so it keeps improving from new data. To go deeper on training itself, head back to Tune.