UI

Training

Fine-tuning job monitor with a fixed-axis train and validation loss curve, segmented epoch progress bar, keyboard sample inspection, sliding event log, pause and two-step cancel controls, checkpoint retry, and deploy-to-endpoint flow.

import { TrainingRun } from '@uthereal/ui/training-run'

Training run playground

support-classifier-v4

Qwen3.8 Max · LoRA r16 · 8× H200

Queued
Train0.000ValidationVal0.000Step 0 / 1,200
Waiting for 8× H200 · 2nd in queue
Step
0 / 1,200
Train loss
—
Val loss
—
Learning rate
0
Elapsed
0s
ETA
About 18m 40s
  1. Evals and checkpoints show here
northwind/support-tickets-oct48,210 examples
support-classifier-v4: Queued
Loading interactive preview…

Overview

TrainingRun monitors a fine-tuning or model training job inside one 640px card. A live Train (raw + EMA smoothed) and Validation loss curve draws rightward across a fixed totalSteps axis that doubles as a segmented per-epoch progress bar so the chart never rescales mid-run. Below the curve sit live telemetry stats (Step, Train loss, Val loss, Learning rate, Elapsed, ETA), a sliding three-row event log of evals and checkpoints, and lifecycle actions (Pause, Resume, two-step Cancel, Retry from checkpoint, Run again, and Deploy ending in a copyable endpoint).

Use TrainingRun on fine-tuning job detail pages, distillation monitors, and custom model onboarding flows. For a generic multi-series trend chart without job controls, use Line chart.

Usage

'use client'
import { TrainingRun } from '@uthereal/ui/training-run'

export function FineTuneMonitor({ job }: { job: Job }) {
  return (
    <TrainingRun
      status={job.status}
      name={job.outputName}
      modelName={job.baseModel}
      modelBrand="qwen"
      details={['LoRA r16', '8× H200']}
      dataset={{ name: job.datasetName, examples: job.examples }}
      step={job.step}
      totalSteps={job.totalSteps}
      epochs={job.epochs}
      loss={job.loss}
      learningRate={job.learningRate}
      elapsed={job.elapsedSeconds}
      eta={job.etaSeconds}
      events={job.events}
      error={job.error}
      onPause={() =>
        void fetch(`/api/jobs/${job.id}/pause`, { method: 'POST' })
      }
      onResume={() =>
        void fetch(`/api/jobs/${job.id}/resume`, { method: 'POST' })
      }
      onCancel={() =>
        void fetch(`/api/jobs/${job.id}/cancel`, { method: 'POST' })
      }
      onRetry={() =>
        void fetch(`/api/jobs/${job.id}/retry`, { method: 'POST' })
      }
      onDeploy={async (signal) => {
        const res = await fetch(`/api/jobs/${job.id}/deploy`, {
          method: 'POST',
          signal,
        })
        if (!res.ok) throw new Error('Deployment failed')
        return res.json()
      }}
    />
  )
}

Omit status to play the built-in simulated LoRA run of Qwen3.8 Max (pauses automatically while off screen; nothing is sent over the network). Each footer button appears only when its matching callback is provided, so passing data props alone renders a read-only monitor.

Examples

Out-of-memory failure and checkpoint retry

Set scenario="oom" on the built-in simulation to reproduce a GPU out-of-memory failure at step 940, showing the danger badge, error footer, event entry, and Retry from checkpoint recovery back to the epoch 2 checkpoint.

billing-triage-v3

Qwen3.8 Max · LoRA r16 · 8× H200

Queued
Train0.000ValidationVal0.000Step 0 / 1,200
Waiting for 8× H200 · 2nd in queue
Step
0 / 1,200
Train loss
—
Val loss
—
Learning rate
0
Elapsed
0s
ETA
About 18m 40s
  1. Evals and checkpoints show here
northwind/billing-triage-oct34,600 examples
billing-triage-v3: Queued

Completed run with final metrics

Pass status="completed", loss, events, and custom four-cell metrics to render the finished state where the four-column results grid replaces live telemetry.

support-classifier-v4

Qwen3.8 Max · LoRA r16 · 8× H200

Completed
Train0.531ValidationVal0.440Step 1,200 / 1,200
Validation loss
0.442from 2.08
Train loss
0.411EMA
Duration
42m 20s3 epochs
Eval F1
94.6%+6.2 pts
  1. Weights merged and verified for deploymentStep 1,200
  2. Validation loss reached 0.442Step 1,200
  3. Checkpoint saved · epoch 2Step 800
northwind/support-tickets-oct48,200 examples
support-classifier-v4: Completed

Lifecycle and controls

Job states

StatusBadge tone & iconChart & stats behaviorFooter actions (when callbacks are wired)
queuedQuiet clockShimmering activity overlay over empty plot; ETA reads "About …".Cancel (two-step)
runningLive spinner (Starting / Training)Live EMA train + validation curve and eased epoch segments; 6 live telemetry cells.Cancel (two-step), Pause
pausedQuiet pauseHead dot dims to muted; ETA reads "On hold".Cancel (two-step), Resume
failedDanger circle-alertHead dot turns danger; footer replaces dataset with error text.Run again, Retry from checkpoint
cancelledQuiet circle-dashedCurve and epoch bars rest muted; ETA reads "Stopped".Run again
completedSuccess circle-checkStats crossfade to 4-column metrics summary.Run again, Deploy
DeployedSuccess sparklesFooter reveals monospace endpoint with an icon-only Copy endpoint button.Run again

Two-step cancel & deploy lifecycle

  • Pressing Cancel morphs the button into a danger Confirm cancel state for 3 seconds; pressing again confirms and invokes onCancel, preventing accidental termination of a long run.
  • Pressing Deploy enters a loading state while onDeploy(signal) settles, aborts automatically on unmount or status change, and displays either the copyable endpoint or an inline error with Retry deploy.

API reference

These serializable arguments and defaults come directly from the component schema.

ArgumentType / defaultDescription
statusqueued | running | paused | completed | failed | cancelled—Where the job is. Leave it out to play the built-in simulated run; running with no loss samples reads as starting up.
namestringDefault: "support-classifier-v4"The job or output model name, "support-classifier-v4".
modelNamestringDefault: "Qwen3.8 Max"The base model being fine-tuned, shown beside the mark.
modelBrandanthropic | openai | google | qwen | meta | mistral | customDefault: "qwen"Base model mark shown beside the name; renderModelMark overrides it in React.
detailsstring[]Default: ["LoRA r16","8× H200"]Short facts after the model name, such as LoRA rank and GPUs. Defaults to LoRA r16 on 8× H200.
datasetobject—The training data, shown in the footer with its example count. Hidden while a run failed with an error.
stepintegerDefault: 0Optimizer steps done, out of totalSteps.
totalStepsintegerDefault: 1200Steps in the whole run. Fixes the x axis so the curve never rescales mid-run.
epochsintegerDefault: 3Number of epochs. The step axis splits into one band and one progress segment per epoch.
lossTrainingLossPoint[]Default: []Loss samples, oldest first. Train is drawn raw (faint) and smoothed; validation joins its own samples. The line eases toward each new point.
learningRatenumber—The current learning rate, formatted as 1.84e-4. Reads "Not set" when omitted.
elapsednumber—Seconds of training so far, excluding pauses.
etanumber—Estimated seconds left. While queued it reads as the expected duration, "About 18m 40s".
eventsTrainingEvent[]Default: []The run's event log, oldest first. The newest three show; kinds are start, checkpoint, eval, epoch, warning, error and done.
metricsTrainingMetric[]—Up to four results that replace the live stats on completion. Defaults to final train loss, validation loss, steps and duration.
activitystring—A short line over the empty chart while queued or starting, "Waiting for 8× H200 · 2nd in queue".
errorstring—Why the run failed, shown in the footer in place of the dataset.
scenariohealthy | oomDefault: "healthy"Demo only, used when status is left out: "oom" fails once at step 940 so the retry path can be seen.
pauseActionstring—Registered host action requested when Pause is pressed.
resumeActionstring—Registered host action requested when Resume is pressed.
cancelActionstring—Registered host action requested when Cancel is confirmed with a second press.
retryActionstring—Registered host action requested when Retry from checkpoint is pressed.
restartActionstring—Registered host action requested when Run again is pressed.
deployActionstring—Registered host action requested when Deploy is pressed; the React onDeploy callback drives the loading and endpoint states.
localestring—BCP 47 locale for number formatting; inherited from the page when omitted.
recipestudio | softDefault: "studio"Visual treatment. Both recipes preserve interaction behavior.
themeTrainingRunThemeDefault: {}Color mode, accent, and typed semantic token overrides.
motionnone | subtle | expressiveDefault: "subtle"Animation preset. System reduced-motion preferences take precedence.
motionOptionsTrainingRunMotionOptionsDefault: {}Crossfade, event slide, and curve easing timing overrides in milliseconds.
dirltr | rtl—Reading direction; inherited from the page when omitted.
  • TrainingLossPoint accepts { step, train?, val? } ordered oldest first (step 0..1,000,000).
  • TrainingEvent accepts { id, kind, label, step? } with unique IDs (kind: 'start' | 'checkpoint' | 'eval' | 'epoch' | 'warning' | 'error' | 'done').
  • TrainingMetric accepts { label, value, hint? } (up to 4 cells shown on completion).

React integration

PropPurpose
onPause / onResumePause a running job or resume a paused job.
onCancelCalled after the reader confirms the two-step Confirm cancel prompt within 3 seconds.
onRetry / onRestartRetry a failed job from its last checkpoint or restart a finished, failed, or cancelled job from step 0.
onDeploy(signal)Async deploy handler resolving to { endpoint?: string } | void; rejections display an error message and Retry deploy.
onAction(action)Called with the matching registered action ref (pauseAction, resumeAction, cancelAction, retryAction, restartAction, deployAction).
noticeOne-off announcement appended to the polite screen-reader live region.
renderModelMark({ brand })Replaces the 24px base-model mark in the header. Keep returned elements decorative.
renderDatasetMark()Replaces the 14px dataset mark in the footer. Keep returned elements decorative.
presetApplication defaults overridden by explicit instance arguments.
tokensCSS variables applied after the typed theme, forwarded to the root card and footer buttons.
ref, className, styleApplied to the root <section> element.
Native attributesid, aria-*, data-*, and remaining <section> props forwarded to the root element.

Keyboard & accessibility

KeyAction
TabMoves through the loss chart, Copy endpoint (when deployed), and footer action buttons.
ArrowLeft / ArrowRightOn the focused chart, steps backward or forward across loss samples and updates the legend.
Shift+ArrowLeft / RightJumps ten samples along the loss curve.
Home / EndJumps inspection to the first or latest loss sample.
EscapeClears the inspected step and returns the legend to live values.
Enter / SpaceActivates focused footer buttons (Cancel requires a second press on Confirm cancel).
  • The chart exposes role="group" with a dynamic aria-label carrying current step, train loss, and validation loss; numeric step axis stays dir="ltr" while surrounding card chrome mirrors cleanly in RTL.
  • A pre-mounted polite role="status" live region announces status transitions, errors, confirm-cancel prompts, and host notice strings without spamming every training step.
  • Container queries adapt the card below 440px: padding drops to 16px, the legend shortens Validation to Val, live and completed stats wrap to two columns, and the footer stacks context above actions.

Motion & theming

Curve paths and epoch fill bars write directly to the DOM on an exponential smoothing clock (120ms time constant) so bursty updates glide smoothly without React re-renders, while checkpoint rollbacks jump immediately. New event rows slide down on the snappy spring (0.26s), and status badges, stats grids, and footer lines crossfade inside single-cell grid slots so the card height never jumps.

Under prefers-reduced-motion: reduce, the curve jumps straight to each sample, the event slide travel drops, the spinner and waiting shimmer stop, and swaps stay as 120ms opacity crossfades. Setting motion="none" makes every swap immediate (0ms) and stops the spinner.

theme accepts mode, accent, and typed tokens across these groups:

Token groupCSS custom properties
core--ui-surface, --ui-surface-raised, --ui-text, --ui-text-secondary, --ui-muted, --ui-border, --ui-highlight, --ui-accent, --ui-accent-foreground, --ui-danger, --ui-focus-ring, --ui-radius, --ui-border-width, --ui-font, --ui-font-size, --ui-font-weight
extended--ui-surface-sunken, --ui-border-strong, --ui-border-subtle, --ui-track, --ui-info, --ui-success, --ui-warning, --ui-tone-foreground, --ui-overlay, --ui-tint-strength
shape--ui-radius-sm, --ui-popup-radius, --ui-surface-radius
accentTones--ui-accent-strong, --ui-accent-subtle
type--ui-font-mono, --ui-font-display
include--ui-series-1 (train loss), --ui-series-2 (validation loss)
component--ui-training-run-plot-height (156px default plot height)

An application-wide UtherealProvider supplies defaults.

Composition

In an agent composition, TrainingRun is a leaf block. Configure status, job metadata (name, modelName, modelBrand, details, dataset), totalSteps, epochs, loss, events, and registered lifecycle actions. See Building with agents.

{
  "type": "TrainingRun",
  "props": {
    "status": "running",
    "name": "support-classifier-v4",
    "modelName": "Qwen3.8 Max",
    "modelBrand": "qwen",
    "details": ["LoRA r16", "8× H200"],
    "totalSteps": 1200,
    "epochs": 3,
    "pauseAction": "pause_training_run",
    "cancelAction": "cancel_training_run",
    "deployAction": "deploy_trained_model"
  },
  "children": []
}

On this page