← Back to list

unsloth-core
by cuba6112
⭐ 0🍴 0📅 Dec 26, 2025
SKILL.md
name: unsloth-core description: Core fundamentals of Unsloth for fast LLM fine-tuning, covering FastLanguageModel setup, optimized gradient checkpointing, and native inference acceleration (triggers: unsloth, FastLanguageModel, from_pretrained, get_peft_model, for_inference, gradient checkpointing).
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
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon