Unsloth’s latest release (v0.1.925-beta, published 25 November 2026) adds full support for fine-tuning Inkling 2 Mini, Thinking Machines Lab’s 26.4B-parameter mixture-of-experts model. Unsloth reports 1.8× to 3.1× faster training and about 50% less VRAM than a plain transformers + PEFT + TRL setup, and the whole thing fits on Kaggle’s free 2× T4 GPUs. This tutorial walks through a QLoRA fine-tune from loading to exporting a GGUF, using the official guide and notebooks.
Why Inkling 2 Mini
According to Unsloth’s Inkling 2 Mini run guide, the model is a 26.4B MoE with 5.4B active parameters, released under Apache 2.0, built on a looped-transformer variant, with a 1M-token context and vision support. It’s aimed at coding, agentic and vision workloads. A permissive licence plus a small active-parameter count makes it a good candidate for teams that want their own specialised model.
What the new Unsloth release adds
From the v0.1.925-beta release notes and the fine-tuning guide:
- LoRA and QLoRA training for Inkling 2 Mini, including the vision layers
- Export to GGUF and merged 16-bit (merged 4-bit isn’t supported yet)
- FlexAttention on NVIDIA Ampere or newer for the sliding window and attention sinks, about 15% faster per step on an L4
- Routed experts quantised to 4-bit while loading, so the model takes about 14.5 GiB after load instead of 47.8 GiB
- Loop “message gates” kept in 16-bit. With plain transformers 4-bit those gates were quantised too, and first-step losses were 3.4–3.9 instead of 0.4–1.2
- Gradient checkpointing for the looped layers (layers 6–17 run three times per forward pass)
- A faster
adamw_8bitoptimiser step, up to 12% less time per step with small batches
Benchmarks (from Unsloth)
Unsloth trained with QLoRA on the same tokens (FineTome data, batch 1 × gradient accumulation 4, LoRA r=16 on attention and routed experts, adamw_8bit):
| GPU | Context | Unsloth step / peak VRAM | transformers + TRL step / peak VRAM | Speedup |
|---|---|---|---|---|
| A100 80GB | 2048 | 9.09 s / 29.4 GiB | 16.49 s / 58.3 GiB | 1.81× |
| RTX PRO 6000 Blackwell | 1024 | 2.94 s / 25.7 GiB | 9.09 s / 55.4 GiB | 3.10× |
These are Unsloth’s own numbers, so re-measure on your hardware and data before you rely on them.
Hardware you need
- One T4 is not enough. The 4-bit weights alone are about 14.4 GB.
- Two T4s (Kaggle free tier) work. The notebook splits layers across both GPUs at about 27 s per step. Don’t pass
device_map; Unsloth fills one card, then the next. - 24 GB GPUs: Unsloth reports a peak of 21.1 GB, versus over 40 GB for TRL.
- Local training works on 22 GB of VRAM, per the guide.
If you’d rather not set anything up, start from the official free Kaggle notebook or the Colab A100 notebook.
Step 1: Install and load the model
pip install --upgrade unsloth
from unsloth import FastModel
max_seq_length = 1024
model, tokenizer = FastModel.from_pretrained(
model_name = "unsloth/Inkling-2-Mini",
max_seq_length = max_seq_length,
load_in_4bit = True, # QLoRA
full_finetuning = False,
)
The guide says Unsloth picks the precision for your GPU (float16 on a T4), so don’t pass dtype or set fp16/bf16 on the trainer.
Step 2: Add LoRA adapters
model = FastModel.get_peft_model(
model,
finetune_vision_layers = False, # text-only fine-tune
finetune_language_layers = True,
finetune_attention_modules = True, # q, k, v, o and the output gate
finetune_mlp_modules = True, # the routed experts
r = 8,
lora_alpha = 8,
lora_dropout = 0,
bias = "none",
use_gradient_checkpointing = "unsloth",
random_state = 3407,
)
If you’re close to your memory limit, the guide suggests lowering max_seq_length or setting finetune_mlp_modules = False.
Step 3: Format data with Inkling’s chat template
Inkling uses its own chat template. Format conversations with apply_chat_template, then train only on the assistant’s replies:
from datasets import load_dataset
from unsloth.chat_templates import standardize_sharegpt
dataset = load_dataset("mlabonne/FineTome-100k", split="train[:3000]")
dataset = standardize_sharegpt(dataset)
def formatting_prompts_func(examples):
texts = [
tokenizer.apply_chat_template(convo, tokenize=False, add_generation_prompt=False)
for convo in examples["conversations"]
]
return {"text": texts}
dataset = dataset.map(formatting_prompts_func, batched=True)
To use your own data, shape each row as a list of {"role": ..., "content": ...} messages under a conversations key. You can also pass reasoning_effort ("none", "minimal", "low", "medium", "high", "xhigh", "max" or a value from 0 to 0.99) to apply_chat_template to control thinking. The template default is 0.9.
Step 4: Train
from trl import SFTTrainer, SFTConfig
from unsloth.chat_templates import train_on_responses_only
trainer = SFTTrainer(
model = model,
tokenizer = tokenizer,
train_dataset = dataset,
args = SFTConfig(
dataset_text_field = "text",
max_length = max_seq_length,
per_device_train_batch_size = 1,
gradient_accumulation_steps = 4,
warmup_steps = 5,
max_steps = 30, # raise for a real run
learning_rate = 2e-4,
logging_steps = 1,
optim = "adamw_8bit",
weight_decay = 0.001,
lr_scheduler_type = "linear",
seed = 3407,
output_dir = "outputs",
report_to = "none",
),
)
trainer = train_on_responses_only(
trainer,
instruction_part = "<|message_user|>",
response_part = "<|message_model|>",
)
trainer_stats = trainer.train()
Keep per_device_train_batch_size = 1 and raise gradient_accumulation_steps instead. The guide explains that the 200K vocabulary makes the logits the largest allocation in each step.
Step 5: Save and export
Save the LoRA adapters (small, quick to share):
model.save_pretrained("inkling_2_mini_lora")
tokenizer.save_pretrained("inkling_2_mini_lora")
Or produce a merged model and a GGUF for llama.cpp:
model.save_pretrained_merged("inkling_finetune_16bit", tokenizer, save_method="merged_16bit")
model.save_pretrained_gguf("inkling_finetune", tokenizer, quantization_method="q4_k_m")
Plan your disk space. A merged 16-bit model is about 53 GB, and the GGUF export writes that merge plus a 53 GB 16-bit GGUF first, so it needs about 150 GB free. Kaggle runs out of disk. On a Colab A100, Unsloth’s q4_k_m export produced a 17.48 GB GGUF in about 21 minutes.
Multi-GPU options
Besides the default layer split, the guide documents DDP with offloaded layers. offload_layers = 20 keeps 20 of the 24 layers in CPU RAM and streams them in as needed:
UNSLOTH_MOE_DEQUANT_MAX_MB=64 UNSLOTH_PARALLEL="dp=2" torchrun --nproc_per_node 2 train.py
In Unsloth’s short 2× T4 test, the layer split was faster (9.0 s versus 16.4 s per step) and used less peak memory, so start with the split unless you need data parallelism.
Known limits
- Text QLoRA is the tested path on free GPUs.
- vLLM fast inference isn’t supported for Inkling 2 training yet.
- Full fine-tuning of all 26B weights fits on a 96 GB GPU only with
optim = "lomo". - Inkling 2 Small needs about 310 GB for its 4-bit weights, so it won’t fit free tiers or a single GPU.
Takeaway
With this Unsloth release, fine-tuning a 26B Apache-licensed MoE model is realistic on free Kaggle GPUs. Load unsloth/Inkling-2-Mini in 4-bit, train LoRA adapters on your conversations with train_on_responses_only, and export to GGUF on a machine with about 150 GB of free disk.
