Skip to content

Fine-tuning jobs

A job describes one training: the provider plugin, the base model, the dataset and the state the provider reports back. Jobs live at /admin/config/ai/finetune (Configuration > AI > AI Infrastructure > Fine-tuning).

Lifecycle

stateDiagram-v2
    [*] --> draft: Save job
    draft --> pending: Start training
    pending --> running: Provider picks it up
    running --> completed: Result id received
    running --> failed
    pending --> failed
    pending --> cancelled: Cancel
    running --> cancelled: Cancel
    completed --> pending: Train again
    failed --> pending: Train again
    cancelled --> pending: Train again

pending and running are the active states. While a job is active, cron and the Refresh status operation ask the plugin for news; once it leaves the active states it is left alone until you start it again.

Creating a job

Click Add fine-tuning job on the list page. The form has three parts.

Provider

  • Name: the name of the resulting style or model. Required.
  • Fine-tuning provider: the plugin to train with. Changing it reloads the fields below, since base models, training types and settings come from the plugin. Plugins whose provider has no API key still appear, and the form says so.
  • Dataset type: Images (train a style or LoRA) or Text (fine-tune a language model on entities). Only the types the plugin accepts are offered.
  • Base model: one of the models the plugin can fine-tune.
  • Training type: shown only when the plugin defines training types (for example Style or Character).
  • Trigger word: the word that activates the style in prompts. Defaults to the name. Plugins decide whether they use it.
  • Provider settings: plugin specific options such as training steps. Hidden when the plugin has none.

Dataset

Pick one Source:

  • Upload images: attach 5 to 30 consistent, high resolution images to the job.
  • Entities of a type/bundle, rendered through a view display: choose an entity type, optionally a bundle machine name, the view mode (defaults to ai_finetuner), optional entity ids and a maximum number of entities (defaults to 200).
  • A view with an "AI fine-tuning dataset" display: pick one of the displays of that type. The select stays empty until a view has such a display.

Datasets explains what each source collects.

Uploaded images cannot feed a text dataset; the form rejects that combination.

Saving

Saving stores the job as draft and immediately builds the dataset once to report its size, for example The dataset currently contains 12 items. If the dataset cannot be built (no matching entities, a missing view, an unusable provider) the job is still saved and a warning shows the reason. Fix the source and save again until the count is right.

Starting a training

Use the Start training operation on the list page. The module then:

  1. Checks that the plugin is usable.
  2. Builds the dataset from the source.
  3. Checks that the plugin accepts the dataset type and that the item count meets the plugin's minimum.
  4. Hands the dataset to the plugin, which uploads it and starts the remote training.
  5. Stores the remote job id, the reported status and the dataset size on the job.

Any failure in these steps is shown as an error message and the job stays where it was.

Following the status

The list page shows the status, result id and last message of every job. While a job is active it offers two operations:

  • Refresh status asks the plugin right now.
  • Cancel training asks the plugin to cancel. If the provider cannot cancel, the job is marked cancelled locally and the message says so.

Cron refreshes every active job as well, so you can leave a job alone and come back later.

Using the result

When a training completes, the job stores the provider's result id (a style id, model id or similar, depending on the provider). Open the job with Edit: the Training state section at the top shows the status, remote job id, result id and last message, followed by the plugin's usage instructions. For the Krea plugin, for example, this is the style id to set on a compatible Krea image model.

Training again

A job that is completed, failed or cancelled offers Train again. This starts a new remote training with the current dataset and settings and overwrites the remote job id, status and result id on the job. Duplicate the job first if you want to keep the earlier result id in Drupal.

Deleting a job

Delete removes the job entity only. The trained model or style stays at the provider.