Status: Implemented in v0.5.5; modernised Phase 22 / 2026-05-08; review-cycle 2 polish 2026-05-09 (
forgelm/wizard/sub-package). This document is retained as the historical design reference; the actual implementation inforgelm/wizard/(split from a 976-line monolith into five focused submodules) is now the source of truth.
Review-cycle 2 additions (2026-05-09): validate-on-exit (
ForgeConfig.model_validate), overwrite confirmation with auto- suffix, non-tty stdin refusal, pre-flight checklist, atomicwizard_state.yamlwrites (tempfile+os.replace), webhook SSRF preflight, CLI ↔ web safety field union, web wizardmodel.max_lengthsurface, monitoringendpoint_envsyntax, cross-tabstoragesync, distinctEXIT_WIZARD_CANCELLED = 5exit code, best-effortreadlineintegration. Schema-default parity tightened: judgemin_score5.0(was6.5), weblearningRate2e-5(was1e-4), webbatchSize4(was2).
PR-D additions (E3, 2026-05-09): new
--wizard-start-from <yaml>flag preloads the wizard from an existing config so each step's prompts default to the operator's prior answers; the quickstart-template prelude is skipped, and the save flow defaults to overwriting the start-from path. New_load_initial_state_from_yaml()helper validates the YAML againstForgeConfigup-front so schema rejections surface immediately instead of 30 minutes into a failed training run. Per-step prompts in_step_strategy/_step_training_params/_step_datasetupdated to honour existing values.
To improve accessibility for users coming from no-code tools (like the
DGX-Spark Finetuner), ForgeLM ships an interactive wizard mode that
asks operator-level questions and writes a validated config.yaml.
The wizard is invoked as:
forgelm --wizard(The original python3 -m forgelm.cli --wizard form is preserved; the
top-level forgelm --wizard flag is the canonical operator-facing
entry point.)
The shipped wizard (Phase 22 / 2026-05-08 modernisation) runs 9 steps
plus an optional quickstart-template prelude (_maybe_run_quickstart_template).
The flow listed below describes the CLI surface; the in-browser web wizard
at site/js/wizard.js covers the same nine user-visible stages but uses
different internal step IDs and a trainer ↔ model order swap motivated by
the web's preset-driven flow (web order: welcome → use-case → trainer → model → dataset → training → compliance → operations → review). Both
surfaces produce the same generated YAML; the divergence is by design and
documented inline at forgelm/wizard/_orchestrator.py:
- Quickstart prelude (optional): offer the curated
forgelm/quickstart.py::TEMPLATESlist (customer-support,code-assistant,domain-expert,medical-qa-tr,grpo-math) as a one-shot shortcut. When accepted, the prelude generates the config from the bundled template and skips the full 9-step flow. - Welcome: experience toggle (beginner / expert), navigation
primer (
back/reset/ Ctrl-C), hardware detection (torch + CUDA + VRAM), backend hint (unslothon Linux + GPU, otherwisetransformers). - Use-case: same registry as the prelude, surfaced inside the full flow so operators who declined the shortcut still benefit from sensible preselects (the choice seeds Steps 3 + 5 defaults but the operator can still override every later answer).
- Model: pick a HuggingFace Hub ID from
POPULAR_MODELS(kept in lockstep withsite/js/wizard.js's presets) or enter a custom path. - Strategy: 6 cards (QLoRA / LoRA / DoRA / PiSSA / rsLoRA /
GaLore) covering the full
LoraConfigModel.methodLiteral + GaLore as a separate axis. Captureslora.r,lora.alpha,lora.target_modules(standard / extended / full preset). - Trainer + per-trainer hyperparameters: pick
trainer_typefrom{sft, dpo, simpo, kto, orpo, grpo}; the wizard then prompts for the trainer's specific knobs (dpo_beta,simpo_beta/simpo_gamma,kto_beta,orpo_beta,grpo_num_generations,grpo_max_completion_length,grpo_reward_model). SFT short- circuits (no per-trainer knobs to surface). - Dataset: HF Hub ID, local JSONL, or directory of raw documents.
Directory inputs trigger inline ingestion (Phase 11.5). JSONL
inputs trigger an inline audit (Phase 12.5). Optional Article 10
data.governanceaccordion. - Training parameters: epochs, batch size, max length, output
directory, RoPE scaling (4 schema types incl.
longrope), NEFTune, OOM recovery, GaLore advanced (6-variant optimizer + rank). - Compliance + risk:
compliance(Article 11 + Annex IV §1) plus optionalrisk_assessment(Article 9),data.governance(Article 10),retention(GDPR Article 5(1)(e) + 17),monitoring(Article 12 + 17) accordions. This step is deliberately collected before evaluation so the wizard can front-stop the F-compliance-110 strict-tier gate. - Operations + evaluation:
evaluation.auto_revert,evaluation.safety(Llama Guard, probe set resolved throughimportlib.resources),evaluation.benchmark,evaluation.llm_judge,webhook(single prompt withenv:VARprefix sugar),syntheticblock. After the operator answers,_apply_strict_tier_coercionenforces F-compliance-110 (high- risk → safety enabled + Article 14 staging gate).
Persistence: state snapshot is written to
$XDG_CACHE_HOME/forgelm/wizard_state.yaml after each completed step
so a Ctrl-C / fresh session can offer to resume. Snapshot is cleared
on successful completion or when the operator types reset / r.
The wizard uses pure stdlib input() prompts — neither rich nor
questionary was adopted. The rationale:
- The wizard runs inside CI containers and minimal-image deployments where adding a TUI dependency for a one-shot interactive flow is costly.
- Pure-stdlib prompts keep the dependency footprint identical to the
rest of
forgelm(onlypyyaml+pydantic). - The output is plain YAML; the visual polish of
questionary-style picklist UIs gave no benefit at the schema-validation step that follows.
The wizard's primary output is a standard config.yaml validated
against ForgeConfig before being written, ensuring compatibility
with the existing config-driven architecture. Any operator response
that fails Pydantic validation is re-prompted with the validation
error message inline.