Questions
Short answers about fine-tuning and training language models with Ferrotensor. Each one links to the full docs.
What is Ferrotensor?
Ferrotensor trains, fine-tunes and runs language models on your own GPU. It is an open-source Rust framework with its own WGSL kernels, which run through wgpu on Vulkan, Metal and DX12, on NVIDIA GPUs and Apple silicon. The ferrotensor command plans a run to fit the memory of your GPU, fine-tunes with LoRA, evaluates, chats, merges adapters, exports GGUF files for llama.cpp and Ollama, and trains a model from scratch. The current release is 0.7.3.
How to fine-tune a language model in Rust
Install the command with cargo install ferrotensor-cli (Rust 1.88 or newer). Then ask what fits your GPU, and train with that plan:
ferrotensor plan --model DIR --json
ferrotensor finetune --model DIR --data train.jsonl --jsonDIR is a Hugging Face checkpoint directory, or a model id that is already in the local Hugging Face cache. The training data is a .jsonl file with one {"prompt": ..., "response": ...} object per line. The guide walks through a full run, with output from a real one.
Which models can it fine-tune?
Llama-style decoder models such as SmolLM2, TinyLlama and Qwen2. The memory numbers on this site are for SmolLM2 at 135M, 360M and 1.7B parameters. Models larger than SmolLM2-1.7B are untested.
Which GPUs does it run on?
It runs on NVIDIA GPUs and Apple silicon, through Vulkan on NVIDIA cards and Metal on a Mac. The kernels are built for the GPUs that wgpu reaches through Vulkan, Metal or DX12, and CI also runs the GPU tests on software Vulkan, on Metal and on DX12 (WARP). The machines behind each number are on the home page.
Does it fine-tune language models on a Mac?
Yes, through Metal. An Apple M2 with 8 GB fine-tuned SmolLM2-135M with LoRA on a 0.4 build. There are no current memory numbers for the Mac, so start with SmolLM2-135M.
Does it run on AMD and Intel GPUs?
wgpu reaches AMD and Intel GPUs through Vulkan and DX12, so the kernels can run on them. No run on AMD or Intel hardware has been reported yet. Testing on your GPU checks the kernels on your card with one command, and the result helps other users of that card.
How much GPU memory does LoRA fine-tuning need?
Peak GPU memory on one NVIDIA A10G (24 GB), measured with nvidia-smi, with f16 base weights, batch 1 with 8-step accumulation and sequence length 256:
| Model | Default | --checkpoint-blocks |
|---|---|---|
| SmolLM2-135M | 2,306 MiB | 1,890 MiB |
| SmolLM2-360M | 3,579 MiB | 2,783 MiB |
| SmolLM2-1.7B | 8,142 MiB | 5,313 MiB |
On an NVIDIA Tesla T4 (16 GB), the planner chose batch 2 with 4-step accumulation for SmolLM2-1.7B, which peaked at 11,138 MiB over 250 steps. ferrotensor plan reads the memory of your GPU and picks a batch size, sequence length and rank that fit.
Can a fine-tuned model run in Ollama or llama.cpp?
Yes. Merge the adapter into the base model, then export a GGUF file:
ferrotensor merge --model DIR --lora outputs/run/lora_adapters.safetensors --out outputs/merged --json
ferrotensor export-gguf --model outputs/merged --out model.gguf --jsonIn 0.7.3, export-gguf takes Qwen2 models and Llama models with a byte-level BPE tokenizer, such as SmolLM2.
Does Ferrotensor work from Python?
Yes. pip install ferrotensor installs Python bindings with PyTorch-style tensors, autograd and nn on the GPU or the CPU. The Python quickstart shows training from Python.
How to run a language model in Rust?
Install the command with cargo install ferrotensor-cli (Rust 1.88 or newer), then run ferrotensor generate --model DIR --prompt "Hello". DIR is a Hugging Face checkpoint directory of a Llama-style model such as SmolLM2. ferrotensor chat --model DIR holds a conversation and keeps the KV cache across turns. Run language models in Rust has the rest.
Can Ferrotensor load Hugging Face or GGUF models?
It loads Hugging Face safetensors checkpoints, single or sharded, from a directory or from a model id that is already in the local Hugging Face cache. It never downloads a model. It writes GGUF files with export-gguf for llama.cpp and Ollama, and it does not load them.
Can it train a model from scratch?
Yes. ferrotensor pretrain --data corpus.txt --out outputs/tiny --json trains a small model from random weights with a byte-level tokenizer. Add --tokenizer bpe --vocab-size 4096 to learn a BPE tokenizer from the corpus before training. ferrotensor generate --raw samples text from the result.
How does Ferrotensor compare with Candle, Burn and PyTorch?
Candle is a minimalist Rust ML framework from Hugging Face with many reference models. It is a good choice for inference of popular models. Burn is a full Rust deep-learning framework with swappable backends. It is a good choice when you want a mature training framework in Rust. Ferrotensor suits fine-tuning and training language models on your own GPU from one command, reading and changing every layer down to the shader, and experiments on consumer GPUs. It does not match their op coverage or model support, and it has not been benchmarked against them.
Against PyTorch + PEFT on the same NVIDIA A10G with the same recipe (the code in 0.7.1, 19 November 2026), held-out loss was within 0.004 of PyTorch's. A training step was faster than in eager PyTorch and slower than in compiled PyTorch. The tables are in the LoRA walkthrough.
Can coding agents and scripts drive it?
Yes. Each main command takes --json and prints one JSON object on stdout, and the exit code says whether to retry or to change the request. AGENTS.md lists the keys of each command and the exit codes. llms.txt maps the docs for language models.
Is Ferrotensor free to use?
Yes. It is open source under MIT or Apache-2.0, at your option.