Skip to main content
Training jobs reference ready datasets by name. Prepare a JSONL file, upload it through the two-step dataset API, and confirm the processed version exists before calling POST /v1/training/jobs.

Choose a dataset format

Each line in the file must be one JSON object. Use one consistent shape throughout a dataset.

Named entity recognition

Use text plus an entities list of [span, label] pairs. Every span must appear in the text, but matching is case-insensitive: "ada lovelace" is valid for "Ada Lovelace". Include negative examples with an empty list.

Classification

Use label for single-label data or labels for multi-label data. Use the same field in every row.

GLiNER2 library format

NER and classification uploads also accept GLiNER2’s canonical input and output shape. For NER, map each entity label to its matching spans:
For classification, classifications can contain one or several tasks in each row:
Use one shape per row. Do not mix text, label, labels, or entities with input and output fields in the same row.

Joint NER and classification

A row can contain both entities and label to train both heads. Keep that same joint shape in every row, and do not mix single-label label with multi-label labels.

Decoder

Set dataset_type to decoder and give every row a messages array with chat roles and content.
The dataset service accepts decoder datasets for fine-tune-agent and storage workflows. Config jobs reject decoder base models, so don’t treat dataset_type: decoder as a direct config-job decoder-training path. Interactive jobs don’t accept a dataset name; read and tokenize the examples in your application, then send tokenized datums as shown in the Decoder Quickstart.

Upload a dataset

1. Reserve an upload URL

The response contains a short-lived presigned_url, a dataset_id, and a version_number. The commands above retain all three values. Upload the exact file bytes to the presigned URL:

2. Process the uploaded file

Processing returns 202. Poll the dataset by name and select the entry whose version_number exactly matches the upload response. Continue until that version’s status is ready or failed. If it is failed, stop and surface its processing_error; do not submit that version to training.

Start training

Pass the exact dataset name to the training-job create endpoint:
Use GET /v1/base-models?supports_training=true immediately before submission to select a currently trainable base model.

Common blockers

Dataset API contracts

Upload URL

Process upload

List datasets

Dataset versions

Delete dataset