Agent skill
unsloth-core
Install this agent skill to your Project
npx add-skill https://github.com/cuba6112/skillfactory/tree/main/skills/unsloth-core
SKILL.md
Overview
Unsloth-core provides the foundational framework for accelerating Large Language Model (LLM) fine-tuning. It leverages specialized kernels and optimized gradient checkpointing to achieve up to 2x faster native inference and significant VRAM savings compared to standard Hugging Face implementations.
When to Use
- When fine-tuning Llama-3, Mistral, or Phi models and seeking maximum speed.
- When limited by VRAM and needing optimized gradient checkpointing.
- When deploying models for inference and requiring low-latency responses.
Decision Tree
- Are you starting a new fine-tuning run?
- Yes: Use
FastLanguageModel.from_pretrained(). - No (Inference only): Load with
for_inference=True.
- Yes: Use
- Is your VRAM usage too high?
- Yes: Set
use_gradient_checkpointing = 'unsloth'.
- Yes: Set
- Are you ready for generation?
- Yes: Call
FastLanguageModel.for_inference(model)to enable 2x speed.
- Yes: Call
Workflows
- Basic Model Initialization: Import
FastLanguageModel, load a model with specificmax_seq_lengthandload_in_4bit, and configure PEFT adapters viaget_peft_model(). - Optimized Training Configuration: Configure
SFTTrainerwithuse_gradient_checkpointing = 'unsloth'and monitor loss values (ideally between 0.5 and 1.0). - Saving and Post-Training Inference: Save LoRA adapters using
save_pretrained(), then enable optimized inference viafor_inference(model)for generation.
Non-Obvious Insights
- Unsloth's native inference is not automatic; users must explicitly call
FastLanguageModel.for_inference(model)to see the 2x performance gain. - The specialized 'unsloth' gradient checkpointing option is 30% more VRAM efficient than the default standard implementation.
- Unsloth fixes known tokenizer and chat template bugs present in official model releases to improve fine-tuning accuracy.
Evidence
- "Unsloth itself provides 2x faster inference natively as well, so always do not forget to call FastLanguageModel.for_inference(model)." Source
- "We leverage our smart Unsloth gradient checkpointing algorithm... It smartly offloads intermediate activations to system RAM asynchronously whilst being only 1% slower." Source
Scripts
scripts/unsloth-core_tool.py: Python utility for model initialization and training setup.scripts/unsloth-core_tool.js: Node.js interface for managing Unsloth training configurations.
Dependencies
unslothtorchtransformerspefttrl
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?