🚀 Unsloth to NVIDIA Brev Adapter

Automatically sync and convert Unsloth Colab notebooks to NVIDIA Brev-compatible launchables. This repository provides a production-ready pipeline that:
- ⚡ Syncs daily with the unslothai/notebooks repository
- 🔄 Automatically converts Colab-specific code to Brev-compatible format
- 🐳 Generates companion files (requirements.txt, setup.sh, docker-compose.yml, README)
- 🧪 Tests all conversions with comprehensive pytest suite
- 📦 Creates launchables ready to deploy on NVIDIA Brev
This adapter transforms Unsloth Colab notebooks for seamless use on NVIDIA Brev by:
- Installation Conversion - Replaces unsloth[colab-new] with unsloth[conda]
- Magic Commands - Converts ! and % commands to subprocess calls
- Storage Adaptation - Removes Google Drive mounting, updates paths to /workspace/
- GPU Configuration - Adds device_map="auto" for multi-GPU support
- Batch Size Optimization - Adjusts batch sizes for NVIDIA GPUs
- Companion Files - Generates setup scripts, Docker configs, and documentation
Below are 181 Unsloth notebooks organized into 129 launchables for NVIDIA Brev, categorized by model type. Each notebook is fully adapted for Brev environments with GPU-optimized configurations, companion files, and ready-to-run setups.
Quick Start: Browse the notebooks below, clone this repo, and deploy on Brev Console or run locally with Docker. View the original Unsloth notebooks here.
Text-to-Speech (TTS) Notebooks
Vision (Multimodal) Notebooks
| Model |
GPU Requirements |
Notebook Link |
| bert_classification |
L4 (16GB) |
View Notebook |
Specific use-case Notebooks
| Usecase |
Model |
GPU Requirements |
Notebook Link |
| Fine-tuning |
Mistral_(7B)-Text_Completion |
L4 (16GB) |
View Notebook |
| Tool Calling |
Qwen2.5_Coder_(1.5B)-Tool_Calling |
L4 (16GB) |
View Notebook |
| Model |
Type |
GPU Requirements |
Notebook Link |
| GPT_OSS_BNB_(20B)-Inference |
Inference |
L4 (16GB) |
View Notebook |
| GPT_OSS_MXFP4_(20B)-Inference |
Inference |
L4 (16GB) |
View Notebook |
| OpenEnv_gpt_oss_(20B)_Reinforcement_Learning_2048_Game |
|
A100-40GB (24GB) |
View Notebook |
| OpenEnv_gpt_oss_(20B)_Reinforcement_Learning_2048_Game_BF16 |
|
A100-40GB (24GB) |
View Notebook |
| gpt-oss-(120B)_A100-Fine-tuning |
|
A100-80GB (80GB) |
View Notebook |
| gpt-oss-(20B)-Fine-tuning |
|
A100-40GB (24GB) |
View Notebook |
| gpt_oss_(20B)_Reinforcement_Learning_2048_Game |
|
A100-40GB (24GB) |
View Notebook |
| gpt_oss_(20B)_Reinforcement_Learning_2048_Game_BF16 |
|
A100-40GB (24GB) |
View Notebook |
| gpt_oss_(20B)_Reinforcement_Learning_2048_Game_DGX_Spark |
|
A100-40GB (24GB) |
View Notebook |
Linear Attention Notebooks
| Model |
Type |
GPU Requirements |
Notebook Link |
| Falcon_H1-Alpaca |
Alpaca |
L4 (16GB) |
View Notebook |
| Falcon_H1_(0.5B)-Alpaca |
Alpaca |
L4 (16GB) |
View Notebook |
| Liquid_LFM2-Conversational |
Conversational |
L4 (16GB) |
View Notebook |
| Liquid_LFM2_(1.2B)-Conversational |
Conversational |
L4 (16GB) |
View Notebook |
| Model |
Type |
GPU Requirements |
Notebook Link |
| Orpheus_(3B)-TTS |
TTS |
L4 (16GB) |
View Notebook |
| Model |
Type |
GPU Requirements |
Notebook Link |
| Oute_TTS_(1B) |
TTS |
L4 (16GB) |
View Notebook |
| Model |
Type |
GPU Requirements |
Notebook Link |
| Phi_3.5_Mini-Conversational |
Conversational |
L4 (16GB) |
View Notebook |
| Phi_3_Medium-Conversational |
Conversational |
L4 (16GB) |
View Notebook |
| phi2-finetune-own-data |
|
L4 (16GB) |
View Notebook |
| phi2-finetune |
|
L4 (16GB) |
View Notebook |
| Model |
Type |
GPU Requirements |
Notebook Link |
| Spark_TTS_(0_5B) |
TTS |
L4 (16GB) |
View Notebook |
| Model |
Type |
GPU Requirements |
Notebook Link |
| Whisper |
STT |
L4 (16GB) |
View Notebook |
Note: Deploy buttons will be added by the Brev team as Launchables are created on the platform.
Manual Deploy Instructions
To deploy any converted notebook to Brev:
- Go to Brev Console: brev.nvidia.com
- Create New Launchable: Navigate to Launchables → Create New
- Configure Settings:
- Repository: https://github.com/brevdev/unsloth-notebook-adaptor
- Path: converted/{model-name} (see table above for exact model names)
- GPU Tier: Use recommended tier from table above
- Port: 8888 (for Jupyter Lab)
- Deploy: Click Deploy and access Jupyter at the provided URL
All converted notebooks include:
- Original notebook file (.ipynb) - Main training notebook
- requirements.txt - Python dependencies
- setup.sh - Environment setup script
- docker-compose.yml - Local Docker configuration
- README.md - Model-specific documentation
- .brevconfig.json - Brev metadata
# Browse available launchables
ls converted/
# Launch a specific model (example)
cd converted/llama-3.1-8b-fine-tuning
cat README.md # View instructions
# Or use with Docker
docker-compose up
All converted notebooks are in the converted/ directory, organized by model name.
🛠️ Quick Start for Contributors
Important: Use a virtual environment to avoid system package conflicts (especially on macOS).
# Clone the repository
git clone git@github.com:brevdev/unsloth-notebook-adaptor.git
cd unsloth-notebook-adaptor
# Create and activate virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Run tests
pytest tests/ -v
# Clone Unsloth notebooks
git clone https://github.com/unslothai/notebooks.git unsloth-notebooks
# Convert all notebooks
python scripts/convert_notebook.py \
--source unsloth-notebooks/nb \
--output converted
# Or convert specific notebooks
python scripts/convert_notebook.py \
--source unsloth-notebooks/nb \
--output converted \
--notebooks "Llama_3.1_(8B).ipynb" "Gemma_3_(4B).ipynb"
unsloth-notebook-adaptor/
├── .github/workflows/ # GitHub Actions automation
│ ├── sync-and-convert.yml # Daily sync workflow
│ └── test-conversions.yml # Test suite on PR
├── adapters/ # Conversion logic
│ ├── base_adapter.py # Base adapter class
│ ├── colab_to_brev.py # Colab→Brev conversions
│ └── model_configs.py # Model-specific configs
├── templates/ # Jinja2 templates
│ ├── requirements.txt.jinja2
│ ├── setup.sh.jinja2
│ ├── docker-compose.yml.jinja2
│ └── README.md.jinja2
├── converted/ # Output: converted notebooks
│ └── [launchable-name]/
│ ├── notebook.ipynb
│ ├── requirements.txt
│ ├── setup.sh
│ ├── docker-compose.yml
│ ├── README.md
│ └── .brevconfig.json
├── metadata/ # Tracking and registry
│ ├── launchables.json # Registry of all launchables
│ └── last_sync.txt # Last synced commit hash
├── scripts/ # CLI tools
│ ├── convert_notebook.py # Main conversion script
│ ├── compare_notebooks.py # Detect upstream changes
│ ├── generate_metadata.py # Build registry
│ └── create_summary.py # GitHub Actions summary
└── tests/ # Test suite
├── test_conversions.py
└── test_notebooks.py
1. Daily Sync (Automated)
GitHub Actions runs daily at 6 AM UTC:
- Checks out the latest Unsloth notebooks
- Compares against last synced commit
- Converts any changed notebooks
- Generates metadata registry
- Commits and pushes changes
For each notebook:
- Load source notebook and model configuration
- Apply conversion functions (installation, magic commands, storage, etc.)
- Add Brev header cell with model information
- Generate companion files from Jinja2 templates
- Save adapted notebook and files to converted/[launchable-name]/
- Comprehensive pytest suite tests all conversion functions
- Integration tests verify end-to-end notebook adaptation
- GitHub Actions runs tests on all PRs and commits
# Installation
!pip install "unsloth[colab-new] @ git+https://github.com/unslothai/unsloth.git"
# GPU Check
!nvidia-smi
# Storage
from google.colab import drive
drive.mount('/content/drive')
model_path = '/content/drive/MyDrive/models'
# Model Loading
model = FastLanguageModel.from_pretrained(
"unsloth/llama-3-8b",
max_seq_length=2048,
load_in_4bit=True
)
# Installation
import subprocess
import sys
subprocess.check_call([
sys.executable, "-m", "pip", "install",
"unsloth[conda] @ git+https://github.com/unslothai/unsloth.git"
])
# GPU Check
subprocess.run(['nvidia-smi'], check=False)
# Storage
model_path = '/workspace/models'
# Model Loading
model = FastLanguageModel.from_pretrained(
"unsloth/llama-3-8b",
max_seq_length=2048,
load_in_4bit=True,
device_map="auto" # Added for multi-GPU support
)
- gpt-oss (20B, 120B) - Reasoning models
- Llama 3.1 (8B), Llama 3.2 (1B, 3B) - Text generation
- Gemma 3 (1B, 4B, 27B), Gemma 3n (E4B) - Multimodal
- Qwen3 (4B, 14B, 32B) - Text generation
- Phi-4 (14B) - Reasoning
- Llama 3.2 Vision (11B)
- Qwen3-VL (8B)
- Gemma 3 Vision (4B)
- Whisper Large V3 - Speech-to-Text (STT)
- Orpheus-TTS (3B) - Text-to-Speech
- Sesame-CSM (1B) - Text-to-Speech
Reinforcement Learning (GRPO)
- gpt-oss-20b GRPO
- Qwen3-VL GRPO - Vision RL
- Gemma 3 GRPO
- Llama 3.2 GRPO
- Phi-4 GRPO
See adapters/model_configs.py for complete list with GPU requirements.
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=adapters --cov-report=term --cov-report=html
# Run specific test file
pytest tests/test_conversions.py -v
# Run specific test
pytest tests/test_conversions.py::test_convert_installation -v
We welcome contributions! Here's how to help:
- Add New Models - Update adapters/model_configs.py
- Improve Conversions - Enhance conversion functions in adapters/colab_to_brev.py
- Fix Bugs - Submit PRs with test coverage
- Report Issues - Use GitHub Issues
# Create a feature branch
git checkout -b feature/my-improvement
# Make changes and test
pytest tests/ -v
# Commit with conventional commits
git commit -m "feat: add support for new model"
# Push and create PR
git push origin feature/my-improvement
The metadata/launchables.json file contains a complete registry of all converted launchables:
{
"version": "1.0.0",
"generated_at": "2025-10-20T12:00:00Z",
"total_launchables": 25,
"launchables": [
{
"id": "llama-3.1-8b-fine-tuning",
"name": "Llama 3.1 (8B)",
"description": "Fine-tune Llama 3.1 (8B) with Unsloth on NVIDIA GPUs",
"notebook": "notebook.ipynb",
"path": "llama-3.1-8b-fine-tuning",
"gpu": {
"tier": "L4",
"min_vram_gb": 16,
"multi_gpu": false
},
"tags": ["unsloth", "fine-tuning", "text-generation"],
"upstream": {
"source": "unslothai/notebooks",
"notebook_url": "https://colab.research.google.com/...",
"last_synced": "2025-10-20T12:00:00Z"
},
"files": [...]
}
]
}
This project is licensed under the LGPL-3.0 License - see the LICENSE file for details.
The converted notebooks maintain their original licenses from the Unsloth project.
- Unsloth AI for the amazing fine-tuning framework and notebooks
- NVIDIA Brev for providing the GPU infrastructure platform
- All contributors to the Unsloth and Brev communities
Built with ❤️ by the Brev team | Brev | Unsloth