Free Colab Notebooks: ModernBERT, Gemma QLoRA, GLiNER & Guardrails
Melvin Vivas · X post · 2026-09-20 · Open on X
Topics: Fine-tuning & Model Customization, AI Safety, Security & Guardrails, LLMOps, Deployment & Monitoring · Level: intermediate
Summary
Melvin Vivas shares a set of free Google Colab notebooks on his website, mostly about fine-tuning. They cover fine-tuning a ModernBERT binary classifier to route tasks, QLoRA fine-tuning Gemma 4 E2B Instruct to write tweets in your own style, local prompt and response moderation with GliGuard LLMGuardrails-300M, and zero-shot extraction with GLiNER2.5.
Key points
- Notebook 1: fine-tune a ModernBERT binary classifier that routes tasks between two targets (Luna vs Astra), a small-model approach to model routing.
- Notebook 2: QLoRA fine-tune Gemma 4 E2B Instruct on popular tweets so it writes posts in your style.
- Notebook 3 (AIBackends): run local prompt and response moderation with GliGuard LLMGuardrails-300M.
- Notebook 4 (AIBackends): use GLiNER2.5 for zero-shot entity, attribute and constrained-classification extraction, plus knowledge-graph extraction.
- All notebooks are on donvitocodes.com/notebooks and run in Google Colab.
- Small specialized models (classifiers, guardrails, extractors) can run locally instead of calling a large LLM.
Resources mentioned
- Colab Notebooks | DonvitoCodes · website · donvitocodes.com · free
The creator's collection of Colab notebooks for running local models, starting with chat and tool calling on LFM2.5-2.6B.
Also in: Free Colab Notebooks: LFM2.5 2.6B Tool Calling and Benchmarks (Melvin Vivas on X · notes), DonvitoCodes Colab notebooks for running local models (LFM2.5-2.6B) (Melvin Vivas on X · notes) - Google Colab · tool · colab.research.google.com · free · recommended by both Bashiri Smith & Melvin Vivas
Free GPU notebooks.
Also in: Run Notebooks on a Free GPU with Google Colab (T4, 15GB VRAM) (Melvin Vivas on X · notes), Run Local Models on a Free GPU with Google Colab (T4) (Melvin Vivas on X · notes), Free Colab Notebooks for Local Model Fine-Tuning and Inference (Melvin Vivas on X · notes), Intent classification for support using GLiNER2.5-Decide notebook (Melvin Vivas on X · notes) and 12 more - ModernBERT-base · tool · huggingface.co · free
An open-source modernized BERT encoder model. The quoted post uses it as the speed baseline for LFM2.5-Encoder.
Also in: Train Your Own LLM Model Router by Fine-Tuning ModernBERT as a Classifier (Melvin Vivas on X · notes), Fine-Tune ModernBERT-base as a Task-Routing Classifier (Melvin Vivas on X · notes), Train ModernBERT as a Prompt Router Between Two Models (Colab Notebook) (Melvin Vivas on X · notes), Fine-tuning ModernBERT-base as a task router (quote post) (Melvin Vivas on X · notes) and 2 more - Gemma 4 E2B Instruct · tool · huggingface.co · free
Small open-weight instruction-tuned Gemma model, used here as the base for a QLoRA fine-tune.
Also in: Base vs fine-tuned Gemma 4 E2B as a model router (Melvin Vivas on X · notes), QLoRA fine-tune Gemma 4 E2B with Unsloth as a model router (Melvin Vivas on X · notes) - GliGuard 300M · tool · huggingface.co · free
Fastino Labs' small guardrail model that runs on CPU and classifies prompts and responses for safety, toxicity, jailbreaks and refusals.
Also in: Screening LLM Prompts and Responses on CPU with AIBackends + GliGuard (Melvin Vivas on X · notes) - GLiNER2.5 · tool · fastino.ai · free
Fastino Labs' models for extraction and classification that run on CPU, with long context and joint information extraction.
Also in: Colab Notebook: Entity Extraction with GLiNER2.5 in aibackends (Melvin Vivas on X · notes), AIBackends v0.6.0: Run GLiNER2.5 Extraction on CPU (Melvin Vivas on X · notes)
Try this
- Open the notebooks at donvitocodes.com/notebooks and run them in Colab.
- Send the creator your own fine-tuning ideas.
- Fine-tune a ModernBERT classifier to route tasks between two models or agents.
- QLoRA fine-tune Gemma 4 E2B on your own posts so it writes in your style.
- Add local prompt and response guardrails with a small moderation model.
- Build a knowledge graph from text with zero-shot GLiNER extraction.
More in Fine-tuning & Model Customization
- Model Routing: Fine-Tune Your Own Router on Your Prompts
- Base vs fine-tuned Gemma 4 E2B as a model router
- QLoRA fine-tune Gemma 4 E2B with Unsloth as a model router
- Fine-tuning Gemma4-E2B on your own tweet style with Unsloth
- Not every problem needs an LLM: small fine-tuned models (Jev by TypeSafe AI)
- Hugging Face AutoTrain: a no-code fine-tuning tool