/ml-finetune

ML Model Fine-Tuning & Dataset Pipeline

JSONL dataset formatter, LoRA fine-tuning scripts, and model evaluation.

/ml-finetune Prepare JSONL dataset formatter for OpenAI GPT-4o fine-tuning with validation split

Where it installs

# .claude/commands/ml-finetune.md
---
description: ...
argument-hint: [model, dataset, and eval target]
allowed-tools: Read, Grep, Glob, Skill, TodoWrite, Task, ...
---

What it does

/ml-finetune is a Cursor slash command. Type it in chat to run a saved workflow: ML Model Fine-Tuning & Dataset Pipeline.

Prepares training datasets, validates JSONL formats, configures fine-tuning jobs (LoRA / OpenAI), and benchmarks model output accuracy.

JSONL dataset formatter, LoRA fine-tuning scripts, and model evaluation. Unlike a skill, a command is something you invoke on purpose. The agent does not decide to run /ml-finetune for you.

Why it exists

Founders retype the same multi-step prompt until it rots. /ml-finetune exists so the pipeline, all 4 steps of it, is a file in .cursor/commands, versioned with the repo.

It ships in the Engineering Kit. It is wired to the Machine Learning Engineer (ml-engineer) and AI & Vector Engineer (ai-engineer) agents. Required skills: Machine Learning Fine-Tuning & Model Evaluation; LLM Integration & Streaming AI Workflows.

When to use it

  • Use when customizing open-source LLMs on proprietary domain data.
  • Use /ml-finetune when you want that pipeline, not a freeform chat. If you only need one step, use a narrower command or a single agent.
  • Start a new chat. Do not run this command in a thread that just wrote marketing copy.

When not to use it

  • Do not run /ml-finetune as a substitute for reading the diff. The command produces files; you still gate them.
  • Do not chain it into a 40-turn chat. Fresh context is part of the design.
  • Do not run it if you have not filled CURSOR.md. The pipeline will invent a stack.

Example workflow

  1. Clean, deduplicate, and format training conversation pairs into JSONL
  2. Split dataset into training (80%) and validation (20%) sets
  3. Create fine-tuning submission script with hyperparameter configuration
  4. Generate evaluation benchmark suite to measure accuracy improvements

Example usage

Type this in Cursor chat: /ml-finetune Prepare JSONL dataset formatter for OpenAI GPT-4o fine-tuning with validation split

The command file tells the session which agents to adopt and which skills to read. You should see phase headers, not a single dump of code.

If a phase fails its gate, stop. Do not add 'just continue'.

Example output

  • Expected artifact: scripts/format-dataset.py
  • Expected artifact: scripts/finetune.py
  • Expected artifact: data/train.jsonl

Best practices

  • Keep the prompt specific. /ml-finetune Prepare JSONL dataset formatter for OpenAI GPT-4o fine-tuning with validation split is the shape: object, constraint, and outcome.
  • Let the listed agents work in order: ml-engineer → ai-engineer.
  • Save outputs in the repo. Chat-only answers evaporate.
  • Engineering commands should leave tests or an audit note, not only implementation files.

Common mistakes

  • Typing /ml-finetune with no object ('do the thing'). The pipeline will guess.
  • Re-running the command in the same chat after a failed gate instead of fixing the failing file.
  • Editing the command file to skip review so it 'goes faster'.
  • Skipping the Machine Learning Fine-Tuning & Model Evaluation skill that the command depends on.

Frequently asked questions

  • What does /ml-finetune do in Cursor?
    Prepares training datasets, validates JSONL formats, configures fine-tuning jobs (LoRA / OpenAI), and benchmarks model output accuracy.
  • When should I run /ml-finetune?
    Use when customizing open-source LLMs on proprietary domain data.
  • What is an example /ml-finetune prompt?
    /ml-finetune Prepare JSONL dataset formatter for OpenAI GPT-4o fine-tuning with validation split
  • Which skills does /ml-finetune load?
    Machine Learning Fine-Tuning & Model Evaluation; LLM Integration & Streaming AI Workflows
  • Is /ml-finetune a Cursor skill?
    No. /ml-finetune is a slash command you type. Skills are playbooks the agent may load. Use both: the command runs the workflow, the skills constrain how it writes.

Run /ml-finetune from your own repo

AgenticKit installs 47 slash commands, 46 agents, and 61 skills. One command installation.