{ "cells": [ { "cell_type": "markdown", "id": "cell-0", "metadata": {}, "source": [ "# GRPO Fine-tuning with Unsloth\n", "\n", "Fine-tuning requires a GPU. If you don't have one locally, you can run this notebook for free on [Google Colab](https://colab.research.google.com/github/Liquid4All/cookbook/blob/main/finetuning/notebooks/grpo_with_unsloth.ipynb) using a free NVIDIA T4 GPU instance.\n", "\n", "[](https://colab.research.google.com/github/Liquid4All/cookbook/blob/main/finetuning/notebooks/grpo_with_unsloth.ipynb)\n", "\n", "### What's in this notebook?\n", "\n", "In this notebook you will learn how to use Group Relative Policy Optimization (GRPO) for reinforcement learning-based fine-tuning with Unsloth.\n", "We will use the [LFM2.5-1.2B-Instruct](https://docs.liquid.ai/docs/models/lfm25-1.2b-instruct) model and train it on mathematical reasoning tasks using the Open R1 Math dataset. GRPO is ideal for verifiable tasks where you can programmatically evaluate the correctness of model outputs, such as math problems, code generation, and structured data tasks.\n", "\n", "We will cover\n", "- Environment setup\n", "- Data preparation for GRPO\n", "- Reward function design\n", "- Model training with GRPO\n", "- Local inference with your new model\n", "- Model saving and exporting it into the format you need for **deployment**.\n", "\n", "### Deployment options\n", "\n", "LFM2.5 models are small and efficient, enabling deployment across a wide range of platforms:\n", "\n", "
| Deployment Target | \n", "Use Case | \n", "
|---|---|
| 📱 Android | \n", "Mobile apps on Android devices | \n", "
| 📱 iOS | \n", "Mobile apps on iPhone/iPad | \n", "
| 🍎 Apple Silicon Mac | \n", "Local inference on Mac with MLX | \n", "
| 🦙 llama.cpp | \n", "Local deployments on any hardware | \n", "
| 🦙 Ollama | \n", "Local inference with easy setup | \n", "
| 🖥️ LM Studio | \n", "Desktop app for local inference | \n", "
| ⚡ vLLM | \n", "Cloud deployments with high throughput | \n", "
| ☁️ Modal | \n", "Serverless cloud deployment | \n", "
| 🏗️ Baseten | \n", "Production ML infrastructure | \n", "
| 🚀 Fal | \n", "Fast inference API | \n", "