Skip to content

Recipes: Add "Train on this dataset" card with training configuration#7395

Draft
LeoBorcherding wants to merge 1 commit into
unslothai:mainfrom
LeoBorcherding:recipes-train-on-dataset-card
Draft

Recipes: Add "Train on this dataset" card with training configuration#7395
LeoBorcherding wants to merge 1 commit into
unslothai:mainfrom
LeoBorcherding:recipes-train-on-dataset-card

Conversation

@LeoBorcherding

Copy link
Copy Markdown
Collaborator

Closes #6178

Summary

Adds a first-class Train node to the Recipe Studio graph. A finished dataset pipeline connects into this card, which holds a full training config and kicks off a fine-tuning run on the generated output. It's the first step toward the closed loop: generate, train, benchmark, regenerate.

What's included

  • New train node kind with its own card, built on the existing BaseNode primitives so it matches the other nodes (fuchsia tone, stat chips, dataset-status row, primary action button). A single data-input handle lets the recipe output wire straight in.
  • Dataset auto-wiring. The card defaults to "Auto-wire from recipe output": it reads the most recent completed execution's artifact_path (RecipeExecutionRecord) and trains on that. You can override it with a Hugging Face dataset or a local file.
  • Full training config in the Configure dialog, mirroring the Studio training section. Base model, method (QLoRA/LoRA/Full/CPT), epochs, LoRA rank, batch size, learning rate, max sequence length, and output adapter name sit up front. Everything else (LoRA alpha/dropout/variant, gradient accumulation, warmup, max steps, weight decay, optimizer, scheduler, gradient checkpointing, seed, packing, train-on-completions, W&B/TensorBoard, HF token) lives behind an Advanced accordion, the same pattern the other cards use.
  • Inline launch. "Run training" maps the card config into the shared training-config store and calls the existing startTrainingRun(), so it reuses the real training runtime, consent gates, and dataset checks. The button disables while a run is active and surfaces start errors on the card.
  • Palette, drag-and-drop, and round-trip. Train shows up in the Add-a-step sheet, supports drag-drop, and survives recipe JSON export/import. It's persisted UI-side like markdown_note, so it stays out of the dataset payload but is restored on load.

Data wired

  • Recipe output: RecipePayload.run.artifact_path, run.dataset_name, run.output_formats
  • Training input: TrainingConfigState.datasetSource, uploadedFile, dataset, datasetFormat

Testing

  • npm run typecheck: clean
  • biome check: new files clean, no new lint introduced
  • Builds and runs from source in a local studio (supervisor install.ps1 --local). Screenshots to follow.

The Train node is UI-only in the recipe payload (not a dataset column); the backend training API is unchanged.

@LeoBorcherding LeoBorcherding changed the title Recipes: Add "Train on this dataset" card with training configuration (#6178) Recipes: Add "Train on this dataset" card with training configuration Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Recipes: "Train on this dataset" card with training configuration

1 participant