Skip to content
Agentmart
Submit a tool

fine-tuning-guide

End-to-end LLM fine-tuning workflow -- dataset preparation, LoRA/QLoRA configuration, training, and evaluation.

Skill by tezansahu

IndexedGPL-3.0★ 16
Write a review

Chalk Labs

Need help deploying fine-tuning-guide?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

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/tezansahu-fine-tuning-guide

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.

We use your email only for this newsletter. Privacy

About

End-to-end LLM fine-tuning workflow -- dataset preparation, LoRA/QLoRA configuration, training, and evaluation. Trigger when the user asks to "fine-tune a model", "fine-tune an LLM", "train a language model", "LoRA", "QLoRA", "adapt a model", "custom model training", "fine-tune BERT/Llama/Mistral/GPT", "prepare training data for fine-tuning", or wants to customize a foundation model for a specific task. Also triggers on "should I fine-tune or prompt engineer", "dataset format for fine-tuning", "how to fine-tune", "Hugging Face training".

Use cases: data, ml, productivity, agent-building

No 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. 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/fine-tuning-guide

What's inside

Skill name
fine-tuning-guide
Description
End-to-end LLM fine-tuning workflow -- dataset preparation, LoRA/QLoRA configuration, training, and evaluation. Trigger when the user asks to "fine-tune a model", "fine-tune an LLM", "train a language model", "LoRA", "QLoRA", "adapt a model", "custom model training", "fine-tune BERT/Llama/Mistral/GPT", "prepare training data for fine-tuning", or wants to customize a foundation model for a specific task. Also triggers on "should I fine-tune or prompt engineer", "dataset format for fine-tuning", "how to fine-tune", "Hugging Face training".
License
GPL-3.0
Instructions
265 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Fine-Tuning Guide

Fine-tune language models efficiently with proper data prep, LoRA config, and evaluation.

---

## Workflow

```
1. Decide: fine-tune vs. alternative approaches
2. Prepare dataset
3. Select base model and method
4. Configure and train
5. Evaluate and iterate
```

---

## Step 1 -- Should You Fine-Tune?

| Approach | When | Cost |
|---|---|---|
| **Prompt engineering** | Task achievable with good prompts, sufficient quality | Free |
| **Few-shot examples** | Need consistent format/style, small improvement needed | Free |
| **RAG** | Model needs access to private/up-to-date knowledge | Low |
| **Fine-tuning** | Need specific style/behavior/domain that prompts can't achieve | Moderate |
| **Full training** | Building a new capability from scratch | High |

**Fine-tune when:**
- Prompt engineering gives 70-80% quality but you need 95%+
- You have 100+ high-quality examples of desired behavior
- You need consistent output format that prompts can't reliably enforce
- You're optimizing for cost (fine-tuned small model replaces large model prompting)
- Domain-specific terminology or reasoning patterns needed

---

## Step 2 -- Prepare Dataset

### Format: Instruction Tuning (Chat Format)

```jsonl
{"messages": [{"role": "system", "content": "You are a medical coding assistant."}, {"role": "user", "content": "Code this diagnosis: chest pain on exertion"}, {"role": "assistant", "content": "ICD-10: R07.9 - Chest pain, unspecified. Consider also I20.9 if angina suspected."}]}
{"messages": [{"role": "system", "content": "You are a medical coding assistant."}, {"role": "user", "content": "Code this procedure: knee replacement"}, {"role": "assistant", "content": "CPT: 27447 - Total knee arthroplasty."}]}
```

### Dataset Size Guidelines

| Task | Minimum | Good | Great |
|---|---|---|---|
| Style/format adaptation | 50 | 200 | 500+ |
| Domain knowledge injection | 200 | 500 | 2000+ |
| Complex reasoning | 500 | 2000 | 10000+ |
| Classification | 100/class | 500/class | 2000+/class |

### Quality Checklist

```python
# Validation script for training data
import json
from pathlib import Path

def validate_dataset(path: str):
    issues = []
    examples = [json.loads(l) for l in Path(path).read_text().splitlines() if l.strip()]

    for i, ex in enumerate(examples):
        # Check structure
        if "messages" not in ex:
            issues.append(f"Row {i}: missing 'messages' key")
            continue

        msgs = ex["messages"]
        roles = [m["role"] for m in msgs]

        # Must end with assistant
        if roles[-1] != "assistant":
            issues.append(f"Row {i}: must end with assistant message")

        # Must have at least user + assistant
        if "user" not in roles or "assistant" not in roles:
            issues.append(f"Row {i}: needs both user and assistant messages")

        # Check for empty content
        for m in msgs:
            if not m.get("content", "").strip():
                issues.append(f"Row {i}: empty {m['role']} message")

    print(f"Total examples: {len(examples)}")
    print(f"Issues found: {len(issues)}")
    for issue in issues[:20]:
        print(f"  - {issue}")

    return len(issues) == 0
```

### Train/Val Split
```python
import random
random.seed(42)
random.shuffle(examples)
split = int(len(examples) * 0.9)
train, val = examples[:split], examples[split:]
```

---

## Step 3 -- Select Base Model and Method

### Base Model Selection

| Model | Size | When | Hugging Face ID |
|---|---|---|---|
| Llama 3.1 8B | 8B | General purpose, good quality/size balance | `meta-llama/Llama-3.1-8B-Instruct` |
| Mistral 7B | 7B | Strong for size, fast inference | `mistralai/Mistral-7B-Instruct-v0.3` |
| Phi-3 Mini | 3.8B | Resource constrained, surprisingly capable | `microsoft/Phi-3-mini-4k-instruct` |
| Qwen 2.5 7B | 7B | Strong math / code capabilities | `Qwen/Qwen2.5-7B-Instruct` |
| Gemma 2 9B | 9B | Google ecosystem, strong multilingual | `google/gemma-2-9b-it` |

From tezansahu/ai-garage, GPL-3.0.

More from tezansahu/ai-garage

Signals

Stars
16
Forks
8
Open issues
1
Last commit (this folder)
Jul 7, 2026 (3 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
GPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from tezansahu

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get fine-tuning-guide running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying fine-tuning-guide?

CallGet help
Cite this page

fine-tuning-guide skill. Agent Mart. https://agentmart.dev/skills/tezansahu-fine-tuning-guide (last updated 2026-10-24)