Agent skill

unsloth-core

Stars 0
Forks 0

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

  1. Are you starting a new fine-tuning run?
    • Yes: Use FastLanguageModel.from_pretrained().
    • No (Inference only): Load with for_inference=True.
  2. Is your VRAM usage too high?
    • Yes: Set use_gradient_checkpointing = 'unsloth'.
  3. Are you ready for generation?
    • Yes: Call FastLanguageModel.for_inference(model) to enable 2x speed.

Workflows

  1. Basic Model Initialization: Import FastLanguageModel, load a model with specific max_seq_length and load_in_4bit, and configure PEFT adapters via get_peft_model().
  2. Optimized Training Configuration: Configure SFTTrainer with use_gradient_checkpointing = 'unsloth' and monitor loss values (ideally between 0.5 and 1.0).
  3. Saving and Post-Training Inference: Save LoRA adapters using save_pretrained(), then enable optimized inference via for_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

  • unsloth
  • torch
  • transformers
  • peft
  • trl

References

  • references/README.md

Expand your agent's capabilities with these related and highly-rated skills.

cuba6112/skillfactory

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.

0 0
Explore
cuba6112/skillfactory

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.

0 0
Explore
cuba6112/skillfactory

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.

0 0
Explore
cuba6112/skillfactory

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.

0 0
Explore
cuba6112/skillfactory

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).

0 0
Explore
cuba6112/skillfactory

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.

0 0
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results