Skip to content

feat(studio): add model selector to Safe Synthesizer creation [ASTD-19]#874

Open
marcusds wants to merge 2 commits into
mainfrom
astd-19-add-model-selector-training-data-config/mschwab
Open

feat(studio): add model selector to Safe Synthesizer creation [ASTD-19]#874
marcusds wants to merge 2 commits into
mainfrom
astd-19-add-model-selector-training-data-config/mschwab

Conversation

@marcusds

@marcusds marcusds commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a model dropdown under Training Data Configuration in the Safe Synthesizer creation flow (ASTD-19). Bound to spec.config.training.pretrained_model.

Options (in ticket order):

  1. HuggingFaceTB/SmolLM3-3B (default)
  2. mistralai/Mistral-7B-Instruct-v0.3
  3. TinyLlama/TinyLlama-1.1B-Chat-v1.0

Info tooltip: "Model that gets fine-tuned to generate synthetic data."

Changes

  • constants.tsPRETRAINED_MODEL_OPTIONS + DEFAULT_PRETRAINED_MODEL.
  • schema.ts — added pretrained_model to the training config + default. Flows into the submitted job payload automatically.
  • AdvancedParameters.tsxControlledSelect at the top of the Training Data Configuration section.
  • AdvancedParameters.test.tsx — tests for render, default (SmolLM3), option order, and selection updating the config.

Acceptance criteria

  • Selector shown under Training Data Configuration
  • Three options, in the specified order
  • Defaults to SmolLM3-3B when untouched
  • Saved config reflects the selection

Note

Backend pretrained_model is a free-form string; only SmolLM3-3B is currently pre-provisioned as a model fileset (plugins/nemo-safe-synthesizer/scripts/setup_model_filesets.py). Mistral-7B and TinyLlama resolve via HF at job time and may require provisioning before they run reliably.

Testing

pnpm --filter nemo-studio-ui test src/routes/SafeSynthesizerNewRoute → 71 passed.

Summary by CodeRabbit

  • New Features

    • Added a pretrained model selector to the Safe Synthesizer “Training Data Configuration”.
    • The selector offers three supported options and applies a default when none is chosen.
    • The selected pretrained model is included in the saved synthesizer configuration.
  • Bug Fixes

    • Ensured the pretrained model field is part of schema validation and form default behavior.
  • Tests

    • Expanded coverage for the default selection, available options order, and updating the watched value after user changes.

@marcusds
marcusds requested review from a team as code owners July 23, 2026 20:38
@github-actions github-actions Bot added the feat label Jul 23, 2026
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9f2c5e79-4d74-44a5-8ba4-42bf7c61c927

📥 Commits

Reviewing files that changed from the base of the PR and between 8e55735 and 945529a.

📒 Files selected for processing (1)
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/schema.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/schema.ts

📝 Walkthrough

Walkthrough

Adds pretrained-model constants and defaults, extends the Safe Synthesizer schema, renders a model selector in advanced parameters, and tests default, option-list, and selection-update behavior.

Changes

Pretrained Model Selection

Layer / File(s) Summary
Model constants and form contract
web/packages/studio/src/routes/SafeSynthesizerNewRoute/constants.ts, web/packages/studio/src/routes/SafeSynthesizerNewRoute/schema.ts
Defines supported models, derives the default model, and adds the optional pretrained-model schema field and form default.
Training configuration selector
web/packages/studio/src/routes/SafeSynthesizerNewRoute/components/AdvancedParameters.tsx
Adds a controlled selector bound to the pretrained-model form field and populated from the supported model options.
Selector behavior coverage
web/packages/studio/src/routes/SafeSynthesizerNewRoute/components/AdvancedParameters.test.tsx
Tests selector rendering, default state, option ordering, and form updates after selecting another model.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant AdvancedParameters
  participant ControlledSelect
  participant FormState
  User->>AdvancedParameters: open Training Data Configuration
  AdvancedParameters->>ControlledSelect: render supported model options
  ControlledSelect->>FormState: initialize default pretrained_model
  User->>ControlledSelect: select another model
  ControlledSelect->>FormState: update pretrained_model
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding a model selector to Safe Synthesizer creation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch astd-19-add-model-selector-training-data-config/mschwab

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/packages/studio/src/routes/SafeSynthesizerNewRoute/schema.ts`:
- Line 106: Update the pretrained_model field in the schema to validate against
the same supported-model tuple used by the selector, rather than accepting any
string. Reuse the existing PRETRAINED_MODEL_OPTIONS symbol from the
SafeSynthesizerNewRoute implementation and preserve optionality.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d5be11d0-bd74-46ea-a012-4a9257b80158

📥 Commits

Reviewing files that changed from the base of the PR and between 26319c9 and 8e55735.

📒 Files selected for processing (4)
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/components/AdvancedParameters.test.tsx
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/components/AdvancedParameters.tsx
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/constants.ts
  • web/packages/studio/src/routes/SafeSynthesizerNewRoute/schema.ts

Comment thread web/packages/studio/src/routes/SafeSynthesizerNewRoute/schema.ts Outdated
@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor
Suite Lines Covered Line Rate Branch Rate
Unit Tests 27146/34858 77.9% 62.1%
Integration Tests 15964/33570 47.5% 20.0%

marcusds added 2 commits July 23, 2026 14:00
Add a model dropdown under Training Data Configuration in the Safe
Synthesizer creation flow, bound to spec.config.training.pretrained_model.
Options: SmolLM3-3B (default), Mistral-7B-Instruct-v0.3, TinyLlama-1.1B.

ASTD-19

Signed-off-by: mschwab <[email protected]>
Validate against PRETRAINED_MODEL_OPTIONS instead of any string so
programmatic form values cannot submit unsupported model IDs.

Signed-off-by: mschwab <[email protected]>
@marcusds
marcusds force-pushed the astd-19-add-model-selector-training-data-config/mschwab branch from 945529a to 1c6c2b6 Compare July 23, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant