peft
Parameter-efficient fine-tuning for LLMs using LoRA, QLoRA, and 25+ methods.
Skill by graniet
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/graniet-peft
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/peft
What's inside
- Skill name
peft- Description
- Parameter-efficient fine-tuning for LLMs using LoRA, QLoRA, and 25+ methods. Use when fine-tuning large models (7B-70B) with limited GPU memory, when you need to train <1% of parameters with minimal accuracy loss, or for multi-adapter serving. HuggingFace's official library integrated with transformers ecosystem.
- License
- MIT
- Instructions
- 436 lines in SKILL.md · view on GitHub
Agent Skills spec issues
- name: missing
Files (3)
- SKILL.md
- advanced-usage.md · references/
- troubleshooting.md · references/
SKILL.md (first lines)
## Kheish Compatibility
This skill is repo-local and stays inactive until explicitly activated.
When the original instructions refer to legacy tool names, use these Kheish mappings:
- `terminal` => `bash`
- `web_extract` => `web_fetch`, plus `web_search` when discovery is needed
- `search_files` => `grep_search` and `glob_search`
- `browser_*` tools require a browser-capable surfaced tool or MCP; if none is available, use the closest available surface and say so explicitly
When the instructions mention local helper files, resolve them from `${KHEISH_SKILL_DIR}`.
# PEFT (Parameter-Efficient Fine-Tuning)
Fine-tune LLMs by training <1% of parameters using LoRA, QLoRA, and 25+ adapter methods.
## When to use PEFT
**Use PEFT/LoRA when:**
- Fine-tuning 7B-70B models on consumer GPUs (RTX 4090, A100)
- Need to train <1% parameters (6MB adapters vs 14GB full model)
- Want fast iteration with multiple task-specific adapters
- Deploying multiple fine-tuned variants from one base model
**Use QLoRA (PEFT + quantization) when:**
- Fine-tuning 70B models on single 24GB GPU
- Memory is the primary constraint
- Can accept ~5% quality trade-off vs full fine-tuning
**Use full fine-tuning instead when:**
- Training small models (<1B parameters)
- Need maximum quality and have compute budget
- Significant domain shift requires updating all weights
## Quick start
### Installation
```bash
# Basic installation
pip install peft
# With quantization support (recommended)
pip install peft bitsandbytes
# Full stack
pip install peft transformers accelerate bitsandbytes datasets
```
### LoRA fine-tuning (standard)
```python
from transformers import AutoModelForCausalLM, AutoTokenizer, TrainingArguments, Trainer
from peft import get_peft_model, LoraConfig, TaskType
from datasets import load_dataset
# Load base model
model_name = "meta-llama/Llama-3.1-8B"
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)
tokenizer.pad_token = tokenizer.eos_token
# LoRA configuration
lora_config = LoraConfig(
task_type=TaskType.CAUSAL_LM,
r=16, # Rank (8-64, higher = more capacity)
lora_alpha=32, # Scaling factor (typically 2*r)
lora_dropout=0.05, # Dropout for regularization
target_modules=["q_proj", "v_proj", "k_proj", "o_proj"], # Attention layers
bias="none" # Don't train biases
)
# Apply LoRA
model = get_peft_model(model, lora_config)
model.print_trainable_parameters()
# Output: trainable params: 13,631,488 || all params: 8,043,307,008 || trainable%: 0.17%
# Prepare dataset
dataset = load_dataset("databricks/databricks-dolly-15k", split="train")
def tokenize(example):
text = f"### Instruction:\n{example['instruction']}\n\n### Response:\n{example['response']}"
return tokenizer(text, truncation=True, max_length=512, padding="max_length")
tokenized = dataset.map(tokenize, remove_columns=dataset.column_names)
# Training
training_args = TrainingArguments(
output_dir="./lora-llama",
num_train_epochs=3,
per_device_train_batch_size=4,
gradient_accumulation_steps=4,
learning_rate=2e-4,
fp16=True,
logging_steps=10,
save_strategy="epoch"
)
trainer = Trainer(
model=model,
args=training_args,
train_dataset=tokenized,
data_collator=lambda data: {"input_ids": torch.stack([f["input_ids"] for f in data]),
"attention_mask": torch.stack([f["attention_mask"] for f in data]),
"labels": torch.stack([f["input_ids"] for f in data])}
)
trainer.train()
# Save adapter only (6MB vs 16GB)
model.save_pretrained("./lora-llama-adapter")
```
### QLoRA fine-tuning (memory-efficient)
```python
from transformers import AutoModelForCausalLM, BitsAndBytesConfig
from peft import get_peft_model, LoraConfig, prepare_model_for_kbit_trainingFrom graniet/kheish, MIT.
More from graniet/kheish
- 0.645score
trl-fine-tuning
graniet
Fine-tune LLMs using reinforcement learning with TRL - SFT for instruction tuning, DPO for preference alignment, PPO/GRPO for reward optimization, and reward…
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
godmode
graniet
Jailbreak API-served LLMs using G0DM0D3 techniques — Parseltongue input obfuscation (33 techniques), GODMODE CLASSIC system prompt templates, ULTRAPLINIAN…
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
modal
graniet
Serverless GPU cloud platform for running ML workloads.
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
lm-evaluation-harness
graniet
Evaluates LLMs across 60+ academic benchmarks (MMLU, HumanEval, GSM8K, TruthfulQA, HellaSwag).
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
gguf
graniet
GGUF format and llama.cpp quantization for efficient CPU/GPU inference.
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
vllm
graniet
Serves LLMs with high throughput using vLLM's PagedAttention and continuous batching.
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
creative-ideation
graniet
Generate project ideas through creative constraints.
SkillCFreshness: C★ 217Claude Code +9 - 0.641score
find-nearby
graniet
Find nearby places (restaurants, cafes, bars, pharmacies, etc.) using OpenStreetMap.
SkillCFreshness: C★ 217Claude Code +9 - 0.641score
google-workspace
graniet
Gmail, Calendar, Drive, Contacts, Sheets, and Docs integration via gws CLI (googleworkspace/cli).
SkillCFreshness: C★ 217Claude Code +9 - 0.639score
webhook-subscriptions
graniet
Create and manage webhook subscriptions for event-driven agent activation.
SkillCFreshness: C★ 217Claude Code +9 - 0.636score
xitter
graniet
Interact with X/Twitter via the x-cli terminal client using official X API credentials.
SkillCFreshness: C★ 217Claude Code +9 - 0.636score
plan
graniet
Plan mode for Kheish — inspect context, write a markdown plan into the active workspace's `.kheish/plans/` directory, and do not execute the work.
SkillCFreshness: C★ 217Claude Code +9
Signals
- Stars
- 217
- Forks
- 18
- Open issues
- 0
- Last commit (this folder)
- Jun 25, 2026 (4 months ago)
- Last release
- Jun 27, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/graniet/kheish
- Website
- kheish.ai
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from graniet
- 0.645score
vllm
graniet
Serves LLMs with high throughput using vLLM's PagedAttention and continuous batching.
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
gguf
graniet
GGUF format and llama.cpp quantization for efficient CPU/GPU inference.
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
creative-ideation
graniet
Generate project ideas through creative constraints.
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
lm-evaluation-harness
graniet
Evaluates LLMs across 60+ academic benchmarks (MMLU, HumanEval, GSM8K, TruthfulQA, HellaSwag).
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
modal
graniet
Serverless GPU cloud platform for running ML workloads.
SkillCFreshness: C★ 217Claude Code +9 - 0.645score
trl-fine-tuning
graniet
Fine-tune LLMs using reinforcement learning with TRL - SFT for instruction tuning, DPO for preference alignment, PPO/GRPO for reward optimization, and reward…
SkillCFreshness: C★ 217Claude Code +9
Cite this page
peft skill. Agent Mart. https://agentmart.dev/skills/graniet-peft (last updated 2026-10-24)