opencode-skills-antigravity 1.0.39 → 1.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled-skills/.antigravity-install-manifest.json +10 -1
- package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
- package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
- package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
- package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-refresh.csv +34 -0
- package/bundled-skills/docs/maintainers/security-findings-triage-2026-03-29-refresh.md +2 -0
- package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
- package/bundled-skills/docs/sources/sources.md +2 -2
- package/bundled-skills/docs/users/bundles.md +1 -1
- package/bundled-skills/docs/users/claude-code-skills.md +1 -1
- package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
- package/bundled-skills/docs/users/getting-started.md +1 -1
- package/bundled-skills/docs/users/kiro-integration.md +1 -1
- package/bundled-skills/docs/users/usage.md +4 -4
- package/bundled-skills/docs/users/visual-guide.md +4 -4
- package/bundled-skills/hugging-face-cli/SKILL.md +192 -195
- package/bundled-skills/hugging-face-community-evals/SKILL.md +213 -0
- package/bundled-skills/hugging-face-community-evals/examples/.env.example +3 -0
- package/bundled-skills/hugging-face-community-evals/examples/USAGE_EXAMPLES.md +101 -0
- package/bundled-skills/hugging-face-community-evals/scripts/inspect_eval_uv.py +104 -0
- package/bundled-skills/hugging-face-community-evals/scripts/inspect_vllm_uv.py +306 -0
- package/bundled-skills/hugging-face-community-evals/scripts/lighteval_vllm_uv.py +297 -0
- package/bundled-skills/hugging-face-dataset-viewer/SKILL.md +120 -120
- package/bundled-skills/hugging-face-gradio/SKILL.md +304 -0
- package/bundled-skills/hugging-face-gradio/examples.md +613 -0
- package/bundled-skills/hugging-face-jobs/SKILL.md +25 -18
- package/bundled-skills/hugging-face-jobs/index.html +216 -0
- package/bundled-skills/hugging-face-jobs/references/hardware_guide.md +336 -0
- package/bundled-skills/hugging-face-jobs/references/hub_saving.md +352 -0
- package/bundled-skills/hugging-face-jobs/references/token_usage.md +570 -0
- package/bundled-skills/hugging-face-jobs/references/troubleshooting.md +475 -0
- package/bundled-skills/hugging-face-jobs/scripts/cot-self-instruct.py +718 -0
- package/bundled-skills/hugging-face-jobs/scripts/finepdfs-stats.py +546 -0
- package/bundled-skills/hugging-face-jobs/scripts/generate-responses.py +587 -0
- package/bundled-skills/hugging-face-model-trainer/SKILL.md +11 -12
- package/bundled-skills/hugging-face-model-trainer/references/gguf_conversion.md +296 -0
- package/bundled-skills/hugging-face-model-trainer/references/hardware_guide.md +283 -0
- package/bundled-skills/hugging-face-model-trainer/references/hub_saving.md +364 -0
- package/bundled-skills/hugging-face-model-trainer/references/local_training_macos.md +231 -0
- package/bundled-skills/hugging-face-model-trainer/references/reliability_principles.md +371 -0
- package/bundled-skills/hugging-face-model-trainer/references/trackio_guide.md +189 -0
- package/bundled-skills/hugging-face-model-trainer/references/training_methods.md +150 -0
- package/bundled-skills/hugging-face-model-trainer/references/training_patterns.md +203 -0
- package/bundled-skills/hugging-face-model-trainer/references/troubleshooting.md +282 -0
- package/bundled-skills/hugging-face-model-trainer/references/unsloth.md +313 -0
- package/bundled-skills/hugging-face-model-trainer/scripts/convert_to_gguf.py +424 -0
- package/bundled-skills/hugging-face-model-trainer/scripts/dataset_inspector.py +417 -0
- package/bundled-skills/hugging-face-model-trainer/scripts/estimate_cost.py +150 -0
- package/bundled-skills/hugging-face-model-trainer/scripts/train_dpo_example.py +106 -0
- package/bundled-skills/hugging-face-model-trainer/scripts/train_grpo_example.py +89 -0
- package/bundled-skills/hugging-face-model-trainer/scripts/train_sft_example.py +122 -0
- package/bundled-skills/hugging-face-model-trainer/scripts/unsloth_sft_example.py +512 -0
- package/bundled-skills/hugging-face-paper-publisher/SKILL.md +11 -4
- package/bundled-skills/hugging-face-paper-publisher/examples/example_usage.md +326 -0
- package/bundled-skills/hugging-face-paper-publisher/references/quick_reference.md +216 -0
- package/bundled-skills/hugging-face-paper-publisher/scripts/paper_manager.py +606 -0
- package/bundled-skills/hugging-face-paper-publisher/templates/arxiv.md +299 -0
- package/bundled-skills/hugging-face-paper-publisher/templates/ml-report.md +358 -0
- package/bundled-skills/hugging-face-paper-publisher/templates/modern.md +319 -0
- package/bundled-skills/hugging-face-paper-publisher/templates/standard.md +201 -0
- package/bundled-skills/hugging-face-papers/SKILL.md +241 -0
- package/bundled-skills/hugging-face-trackio/.claude-plugin/plugin.json +19 -0
- package/bundled-skills/hugging-face-trackio/SKILL.md +117 -0
- package/bundled-skills/hugging-face-trackio/references/alerts.md +196 -0
- package/bundled-skills/hugging-face-trackio/references/logging_metrics.md +206 -0
- package/bundled-skills/hugging-face-trackio/references/retrieving_metrics.md +251 -0
- package/bundled-skills/hugging-face-vision-trainer/SKILL.md +595 -0
- package/bundled-skills/hugging-face-vision-trainer/references/finetune_sam2_trainer.md +254 -0
- package/bundled-skills/hugging-face-vision-trainer/references/hub_saving.md +618 -0
- package/bundled-skills/hugging-face-vision-trainer/references/image_classification_training_notebook.md +279 -0
- package/bundled-skills/hugging-face-vision-trainer/references/object_detection_training_notebook.md +700 -0
- package/bundled-skills/hugging-face-vision-trainer/references/reliability_principles.md +310 -0
- package/bundled-skills/hugging-face-vision-trainer/references/timm_trainer.md +91 -0
- package/bundled-skills/hugging-face-vision-trainer/scripts/dataset_inspector.py +814 -0
- package/bundled-skills/hugging-face-vision-trainer/scripts/estimate_cost.py +217 -0
- package/bundled-skills/hugging-face-vision-trainer/scripts/image_classification_training.py +383 -0
- package/bundled-skills/hugging-face-vision-trainer/scripts/object_detection_training.py +710 -0
- package/bundled-skills/hugging-face-vision-trainer/scripts/sam_segmentation_training.py +382 -0
- package/bundled-skills/jq/SKILL.md +273 -0
- package/bundled-skills/odoo-edi-connector/SKILL.md +32 -10
- package/bundled-skills/odoo-woocommerce-bridge/SKILL.md +9 -5
- package/bundled-skills/tmux/SKILL.md +370 -0
- package/bundled-skills/transformers-js/SKILL.md +639 -0
- package/bundled-skills/transformers-js/references/CACHE.md +339 -0
- package/bundled-skills/transformers-js/references/CONFIGURATION.md +390 -0
- package/bundled-skills/transformers-js/references/EXAMPLES.md +605 -0
- package/bundled-skills/transformers-js/references/MODEL_ARCHITECTURES.md +167 -0
- package/bundled-skills/transformers-js/references/PIPELINE_OPTIONS.md +545 -0
- package/bundled-skills/transformers-js/references/TEXT_GENERATION.md +315 -0
- package/bundled-skills/viboscope/SKILL.md +64 -0
- package/package.json +1 -1
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# Unsloth: Fast Fine-Tuning with Memory Optimization
|
|
2
|
+
|
|
3
|
+
**Unsloth** is a fine-tuning library that provides ~2x faster training and ~60% less VRAM usage for LLM training. It's particularly useful when working with limited GPU memory or when speed is critical.
|
|
4
|
+
|
|
5
|
+
- **GitHub**: [unslothai/unsloth](https://github.com/unslothai/unsloth)
|
|
6
|
+
- **Docs**: [unsloth.ai/docs](https://unsloth.ai/docs)
|
|
7
|
+
|
|
8
|
+
## When to Use Unsloth
|
|
9
|
+
|
|
10
|
+
Use Unsloth if instructed to do so, or one of the following use cases applies:
|
|
11
|
+
|
|
12
|
+
| Use Case | Recommendation |
|
|
13
|
+
|----------|----------------|
|
|
14
|
+
| Standard text LLM fine-tuning | TRL is sufficient, but Unsloth is faster |
|
|
15
|
+
| Limited GPU memory | **Use Unsloth** - 60% less VRAM |
|
|
16
|
+
| Need maximum speed | **Use Unsloth** - 2x faster |
|
|
17
|
+
| Large models (>13B) | **Use Unsloth** - memory efficiency critical |
|
|
18
|
+
|
|
19
|
+
## Supported Models
|
|
20
|
+
|
|
21
|
+
Unsloth supports many popular models including:
|
|
22
|
+
- **Text LLMs**: Llama 3/3.1/3.2/3.3, Qwen 2.5/3, Mistral, Phi-4, Gemma 2/3, LFM2/2.5
|
|
23
|
+
- **Vision LLMs**: Qwen3-VL, Gemma 3, Llama 3.2 Vision, Pixtral
|
|
24
|
+
|
|
25
|
+
Use Unsloth's pre-optimized model variants when available:
|
|
26
|
+
```python
|
|
27
|
+
# Unsloth-optimized models load faster and use less memory
|
|
28
|
+
model_id = "unsloth/LFM2.5-1.2B-Instruct" # 4-bit quantized
|
|
29
|
+
model_id = "unsloth/gemma-3-4b-pt" # Vision model
|
|
30
|
+
model_id = "unsloth/Qwen3-VL-8B-Instruct" # Vision model
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
# /// script
|
|
37
|
+
# dependencies = [
|
|
38
|
+
# "unsloth",
|
|
39
|
+
# "trl",
|
|
40
|
+
# "datasets",
|
|
41
|
+
# "trackio",
|
|
42
|
+
# ]
|
|
43
|
+
# ///
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Basic Usage: Text LLM
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from unsloth import FastLanguageModel
|
|
50
|
+
from trl import SFTTrainer, SFTConfig
|
|
51
|
+
from datasets import load_dataset
|
|
52
|
+
|
|
53
|
+
# Load model with Unsloth optimizations
|
|
54
|
+
model, tokenizer = FastLanguageModel.from_pretrained(
|
|
55
|
+
model_name="LiquidAI/LFM2.5-1.2B-Instruct",
|
|
56
|
+
max_seq_length=4096,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
# Add LoRA adapters
|
|
60
|
+
model = FastLanguageModel.get_peft_model(
|
|
61
|
+
model,
|
|
62
|
+
r=16,
|
|
63
|
+
lora_alpha=16,
|
|
64
|
+
target_modules=["q_proj", "k_proj", "v_proj", "out_proj", "in_proj", "w1", "w2", "w3"],
|
|
65
|
+
lora_dropout=0,
|
|
66
|
+
bias="none",
|
|
67
|
+
use_gradient_checkpointing="unsloth",
|
|
68
|
+
random_state=3407,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
# Load dataset
|
|
72
|
+
dataset = load_dataset("trl-lib/Capybara", split="train")
|
|
73
|
+
|
|
74
|
+
# Train with TRL
|
|
75
|
+
trainer = SFTTrainer(
|
|
76
|
+
model=model,
|
|
77
|
+
tokenizer=tokenizer,
|
|
78
|
+
train_dataset=dataset,
|
|
79
|
+
args=SFTConfig(
|
|
80
|
+
output_dir="./output",
|
|
81
|
+
per_device_train_batch_size=2,
|
|
82
|
+
gradient_accumulation_steps=4,
|
|
83
|
+
max_steps=500,
|
|
84
|
+
learning_rate=2e-4,
|
|
85
|
+
report_to="trackio",
|
|
86
|
+
),
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
trainer.train()
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## LFM2.5 Specific Settings
|
|
93
|
+
|
|
94
|
+
For LFM2.5 inference, use these recommended generation parameters:
|
|
95
|
+
|
|
96
|
+
**Instruct models:**
|
|
97
|
+
```python
|
|
98
|
+
temperature = 0.1
|
|
99
|
+
top_k = 50
|
|
100
|
+
top_p = 0.1
|
|
101
|
+
repetition_penalty = 1.05
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Thinking models:**
|
|
105
|
+
```python
|
|
106
|
+
temperature = 0.05
|
|
107
|
+
top_k = 50
|
|
108
|
+
repetition_penalty = 1.05
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Vision-Language Models (VLMs)
|
|
112
|
+
|
|
113
|
+
Unsloth provides specialized support for VLMs with `FastVisionModel`:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from unsloth import FastVisionModel, get_chat_template
|
|
117
|
+
from unsloth.trainer import UnslothVisionDataCollator
|
|
118
|
+
from trl import SFTTrainer, SFTConfig
|
|
119
|
+
from datasets import load_dataset
|
|
120
|
+
|
|
121
|
+
# Load VLM with Unsloth
|
|
122
|
+
model, processor = FastVisionModel.from_pretrained(
|
|
123
|
+
"unsloth/gemma-3-4b-pt", # or "unsloth/Qwen3-VL-8B-Instruct"
|
|
124
|
+
load_in_4bit=True,
|
|
125
|
+
use_gradient_checkpointing="unsloth",
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
# Add LoRA for all modalities
|
|
129
|
+
model = FastVisionModel.get_peft_model(
|
|
130
|
+
model,
|
|
131
|
+
finetune_vision_layers=True, # Train vision encoder
|
|
132
|
+
finetune_language_layers=True, # Train language model
|
|
133
|
+
finetune_attention_modules=True, # Train attention
|
|
134
|
+
finetune_mlp_modules=True, # Train MLPs
|
|
135
|
+
r=16,
|
|
136
|
+
lora_alpha=32,
|
|
137
|
+
target_modules="all-linear",
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
# Apply chat template (required for base models)
|
|
141
|
+
processor = get_chat_template(processor, "gemma-3")
|
|
142
|
+
|
|
143
|
+
# Load VLM dataset (with images and messages)
|
|
144
|
+
dataset = load_dataset("your-vlm-dataset", split="train", streaming=True)
|
|
145
|
+
|
|
146
|
+
# Enable training mode
|
|
147
|
+
FastVisionModel.for_training(model)
|
|
148
|
+
|
|
149
|
+
# Train with VLM-specific collator
|
|
150
|
+
trainer = SFTTrainer(
|
|
151
|
+
model=model,
|
|
152
|
+
train_dataset=dataset,
|
|
153
|
+
processing_class=processor.tokenizer,
|
|
154
|
+
data_collator=UnslothVisionDataCollator(model, processor),
|
|
155
|
+
args=SFTConfig(
|
|
156
|
+
output_dir="./vlm-output",
|
|
157
|
+
per_device_train_batch_size=2,
|
|
158
|
+
gradient_accumulation_steps=4,
|
|
159
|
+
max_steps=500,
|
|
160
|
+
learning_rate=2e-4,
|
|
161
|
+
# VLM-specific settings
|
|
162
|
+
remove_unused_columns=False,
|
|
163
|
+
dataset_text_field="",
|
|
164
|
+
dataset_kwargs={"skip_prepare_dataset": True},
|
|
165
|
+
report_to="trackio",
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
trainer.train()
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Key Differences from Standard TRL
|
|
173
|
+
|
|
174
|
+
| Aspect | Standard TRL | Unsloth |
|
|
175
|
+
|--------|--------------|---------|
|
|
176
|
+
| Model loading | `AutoModelForCausalLM.from_pretrained()` | `FastLanguageModel.from_pretrained()` |
|
|
177
|
+
| LoRA setup | `PeftModel` / `LoraConfig` | `FastLanguageModel.get_peft_model()` |
|
|
178
|
+
| VLM loading | Limited support | `FastVisionModel.from_pretrained()` |
|
|
179
|
+
| VLM collator | Manual | `UnslothVisionDataCollator` |
|
|
180
|
+
| Memory usage | Standard | ~60% less |
|
|
181
|
+
| Training speed | Standard | ~2x faster |
|
|
182
|
+
|
|
183
|
+
## VLM Dataset Format
|
|
184
|
+
|
|
185
|
+
VLM datasets should have:
|
|
186
|
+
- `images`: List of PIL images or image paths
|
|
187
|
+
- `messages`: Conversation format with image references
|
|
188
|
+
|
|
189
|
+
```python
|
|
190
|
+
{
|
|
191
|
+
"images": [<PIL.Image>, ...],
|
|
192
|
+
"messages": [
|
|
193
|
+
{"role": "user", "content": [
|
|
194
|
+
{"type": "image"},
|
|
195
|
+
{"type": "text", "text": "Describe this image"}
|
|
196
|
+
]},
|
|
197
|
+
{"role": "assistant", "content": "This image shows..."}
|
|
198
|
+
]
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
## Streaming Datasets
|
|
203
|
+
|
|
204
|
+
For large VLM datasets, use streaming to avoid disk space issues:
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
dataset = load_dataset(
|
|
208
|
+
"your-vlm-dataset",
|
|
209
|
+
split="train",
|
|
210
|
+
streaming=True, # Stream from Hub
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
# Must use max_steps with streaming (no epoch-based training)
|
|
214
|
+
SFTConfig(max_steps=500, ...)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Saving Models
|
|
218
|
+
|
|
219
|
+
### Save LoRA Adapter
|
|
220
|
+
|
|
221
|
+
```python
|
|
222
|
+
model.save_pretrained("./adapter")
|
|
223
|
+
processor.save_pretrained("./adapter")
|
|
224
|
+
|
|
225
|
+
# Push to Hub
|
|
226
|
+
model.push_to_hub("username/my-vlm-adapter")
|
|
227
|
+
processor.push_to_hub("username/my-vlm-adapter")
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Merge and Save Full Model
|
|
231
|
+
|
|
232
|
+
```python
|
|
233
|
+
# Merge LoRA weights into base model
|
|
234
|
+
model = model.merge_and_unload()
|
|
235
|
+
|
|
236
|
+
# Save merged model
|
|
237
|
+
model.save_pretrained("./merged")
|
|
238
|
+
tokenizer.save_pretrained("./merged")
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Convert to GGUF
|
|
242
|
+
|
|
243
|
+
Unsloth models can be converted to GGUF for llama.cpp/Ollama:
|
|
244
|
+
|
|
245
|
+
```python
|
|
246
|
+
# Save in 16-bit for GGUF conversion
|
|
247
|
+
model.save_pretrained_gguf("./gguf", tokenizer, quantization_method="f16")
|
|
248
|
+
|
|
249
|
+
# Or directly quantize
|
|
250
|
+
model.save_pretrained_gguf("./gguf", tokenizer, quantization_method="q4_k_m")
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## Qwen3-VL Specific Settings
|
|
254
|
+
|
|
255
|
+
For Qwen3-VL models, use these recommended settings:
|
|
256
|
+
|
|
257
|
+
**Instruct models:**
|
|
258
|
+
```python
|
|
259
|
+
temperature = 0.7
|
|
260
|
+
top_p = 0.8
|
|
261
|
+
presence_penalty = 1.5
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Thinking models:**
|
|
265
|
+
```python
|
|
266
|
+
temperature = 1.0
|
|
267
|
+
top_p = 0.95
|
|
268
|
+
presence_penalty = 0.0
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Hardware Requirements
|
|
272
|
+
|
|
273
|
+
| Model | Min VRAM (Unsloth 4-bit) | Recommended GPU |
|
|
274
|
+
|-------|--------------------------|-----------------|
|
|
275
|
+
| 2B-4B | 8GB | T4, L4 |
|
|
276
|
+
| 7B-8B | 16GB | A10G, L4x4 |
|
|
277
|
+
| 13B | 24GB | A10G-large |
|
|
278
|
+
| 30B+ | 48GB+ | A100 |
|
|
279
|
+
|
|
280
|
+
## Example: Full VLM Training Script
|
|
281
|
+
|
|
282
|
+
See `scripts/unsloth_sft_example.py` for a complete production-ready example that includes:
|
|
283
|
+
- Unsloth VLM setup
|
|
284
|
+
- Streaming dataset support
|
|
285
|
+
- Trackio monitoring
|
|
286
|
+
- Hub push
|
|
287
|
+
- CLI arguments
|
|
288
|
+
|
|
289
|
+
Run locally:
|
|
290
|
+
```bash
|
|
291
|
+
uv run scripts/unsloth_sft_example.py \
|
|
292
|
+
--dataset trl-lib/Capybara \
|
|
293
|
+
--max-steps 500 \
|
|
294
|
+
--output-repo username/my-model
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Run on HF Jobs:
|
|
298
|
+
```python
|
|
299
|
+
hf_jobs("uv", {
|
|
300
|
+
"script": "<script content>",
|
|
301
|
+
"flavor": "a10g-large",
|
|
302
|
+
"timeout": "2h",
|
|
303
|
+
"secrets": {"HF_TOKEN": "$HF_TOKEN"}
|
|
304
|
+
})
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
## See Also
|
|
308
|
+
|
|
309
|
+
- `scripts/unsloth_sft_example.py` - Complete text LLM training example
|
|
310
|
+
- [Unsloth Documentation](https://unsloth.ai/docs)
|
|
311
|
+
- [LFM2.5 Guide](https://unsloth.ai/docs/models/tutorials/lfm2.5)
|
|
312
|
+
- [Qwen3-VL Guide](https://unsloth.ai/docs/models/qwen3-vl-how-to-run-and-fine-tune)
|
|
313
|
+
- [Unsloth GitHub](https://github.com/unslothai/unsloth)
|