Agent skill
unsloth-vision
Install this agent skill to your Project
npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/unsloth-vision
SKILL.md
Overview
Unsloth-vision provides optimized support for fine-tuning multimodal models like Llama 3.2 Vision and Qwen2.5 VL. It allows granular control over which layers (vision, language, or both) are updated and includes specialized data collators to handle image padding.
When to Use
- When adapting models for specialized visual tasks like medical imaging or OCR-to-code.
- When fine-tuning Llama 3.2 Vision models on consumer hardware.
- When needing to train specifically on assistant responses in a multimodal context.
Decision Tree
- Do you need to update visual feature extraction?
- Yes: Set
finetune_vision_layers = Trueinget_peft_model.
- Yes: Set
- Are your images varying in size?
- Yes: Standardize to 300-1000px and use
UnslothVisionDataCollator.
- Yes: Standardize to 300-1000px and use
- Should the model ignore system/user prompts during loss calculation?
- Yes: Use
train_on_responses_only = Truein the collator.
- Yes: Use
Workflows
- Vision Model Setup: Load models via
FastVisionModel.from_pretrainedand enable PEFT targetingall-linearmodules. - Multimodal Dataset Preparation: Format data as 'user'/'assistant' conversations with
{'type': 'image'}content and standardized dimensions (300-1000px). - Training for Response Accuracy: Initialize
UnslothVisionDataCollatorwithtrain_on_responses_only = Trueand specified chat template headers.
Non-Obvious Insights
- Unsloth allows selective fine-tuning of just the vision layers, just the language layers, or specific components like attention/MLP layers.
- The
UnslothVisionDataCollatorautomatically masks out padding vision tokens, which is essential for stabilizing loss during training. - Standardizing image resolution to the 300-1000px range is the optimal balance between detail preservation and VRAM efficiency.
Evidence
- "To finetune vision models, we now allow you to select which parts of the mode to finetune... You can select to only finetune the vision layers, or the language layers..." Source
- "It is best to ensure your dataset has images of all the same size/dimensions. Use dimensions of 300-1000px..." Source
Scripts
scripts/unsloth-vision_tool.py: Loading and configuring FastVisionModel.scripts/unsloth-vision_tool.js: Dataset formatter for multimodal conversations.
Dependencies
unslothpillow(for image processing)torch
References
- references/README.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
prompt-engineering
Comprehensive prompt engineering techniques for Claude models. Use this skill when crafting, optimizing, or debugging prompts for Claude API, Claude Code, or any Claude-powered application. Covers system prompts, role prompting, multishot examples, chain of thought, XML structuring, long context handling, extended thinking, prompt chaining, Claude 4.x-specific best practices, and agentic orchestration including subagents, agent loops, skills, MCP integration, and multi-agent workflows.
adk-rag-agent
Build RAG (Retrieval-Augmented Generation) agents with Google ADK and Vertex AI RAG Engine. Use when implementing document Q&A, knowledge base search, or citation-backed responses. Covers VertexAiRagRetrieval tool, corpus setup, and citation formatting.
headless-cli-agents
Build agentic systems using Claude CLI in headless mode or the Claude Agent SDK. Use when building automation pipelines, CI/CD integrations, multi-agent orchestration, or programmatic Claude interactions. Covers CLI flags (-p, --output-format), session management (--resume, --continue), Python SDK (claude-agent-sdk), custom tools, and agent loop patterns.
notion-knowledge-capture
Capture conversations and decisions into structured Notion pages; use when turning chats/notes into wiki entries, how-tos, decisions, or FAQs with proper linking.
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
gh-fix-ci
Inspect GitHub PR checks with gh, pull failing GitHub Actions logs, summarize failure context, then create a fix plan and implement after user approval. Use when a user asks to debug or fix failing PR CI/CD checks on GitHub Actions and wants a plan + code changes; for external checks (e.g., Buildkite), only report the details URL and mark them out of scope.
Didn't find tool you were looking for?