Unsloth is a Python library for fine-tuning a base language model on your own examples. Its optimized workflow aims to reduce training time and GPU memory use, though gains depend on the model, hardware, and settings. It handles training and export; Ollama handles local serving. section 16.6.4
To turn domain-specific examples into a local custom model:
- Choose a supported base model and prepare examples, such as conversations, documents, or input/output pairs. Check support for its architecture, training method, and GGUF export. section 16.6.4 section 17.7.1
- Run an Unsloth notebook cell by cell to fine-tune the model. Google Colab can provide a hosted GPU, but free access and completion time are not guaranteed. section 16.6.4
- Export the trained result as a quantized GGUF file. Copy it and a Modelfile to your local machine, make the Modelfile’s FROM path match the file, and preserve the training chat template. section 16.6.4
- Use ollama create to register the model, then ollama run to try it locally. section 16.6.4 section 17.7.1
model.save_pretrained_gguf("my_model", tokenizer, quantization_method="q4_k_m")
This notebook call exports the fine-tuned model to GGUF using q4_k_m quantization; the exported file is the handoff to Ollama. section 16.6.4
