> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fastino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Use https://docs.fastino.ai/llms.txt to discover and navigate pages. Use https://docs.fastino.ai/llms-full.txt when you need the complete documentation corpus. Use https://docs.fastino.ai/openapi.json as the source of truth for customer-facing routes. For GLiDE decision inference, call POST https://api.fastino.ai/v1/systemone with model fastino/GLiDE. Start managed training (config job) with POST /v1/training/jobs using base_model. For interactive training, native JSON clients use the public operations under /v1/training/jobs and /v1/training/usage. Existing Tinker clients use tinker==0.32.0 with TINKER_BASE_URL=https://api.fastino.ai/v1/training/compat/tinker and TINKER_CREDENTIAL_CMD. Compatibility child routes are private and absent from OpenAPI. Auto Train is private access and has no public route; direct interested users to sales@fastino.ai. Do not infer undocumented routes. Read API keys from FASTINO_API_KEY and never embed credentials in code, logs, or reports.

# Prepare and upload training datasets

> Format, upload, validate, and inspect NER or classification datasets before starting a Fastino GLiNER training job.

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.

```jsonl theme={null}
{"text":"Ada Lovelace worked in London.","entities":[["Ada Lovelace","PERSON"],["London","LOCATION"]]}
{"text":"No tagged entities here.","entities":[]}
```

### Classification

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

```jsonl theme={null}
{"text":"The setup was straightforward.","label":"positive"}
{"text":"The request needs technical help.","label":"technical"}
```

### 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:

```jsonl theme={null}
{"input":"Ada Lovelace worked in London.","output":{"entities":{"PERSON":["Ada Lovelace"],"LOCATION":["London"]}}}
{"input":"No tagged entities here.","output":{"entities":{"PERSON":[],"LOCATION":[]}}}
```

For classification, `classifications` can contain one or several tasks in each
row:

```jsonl theme={null}
{"input":"jump now","output":{"classifications":[{"task":"action","labels":["jump","wait"],"true_label":["jump"]},{"task":"urgency","labels":["now","later"],"true_label":["now"]}]}}
```

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`.

```jsonl theme={null}
{"text":"Ada Lovelace worked in London.","entities":[["Ada Lovelace","PERSON"],["London","LOCATION"]],"label":"biography"}
{"text":"No tagged entities here.","entities":[],"label":"other"}
```

### Decoder

Set `dataset_type` to `decoder` and give every row a `messages` array with chat
roles and content.

```jsonl theme={null}
{"messages":[{"role":"user","content":"What is 2+2?"},{"role":"assistant","content":"4"}]}
```

> [!NOTE]
>
> 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](https://docs.fastino.ai/training/decoder-quickstart.md).

## Upload a dataset

### 1. Reserve an upload URL

```bash theme={null}
curl --fail-with-body -sS https://api.fastino.ai/v1/datasets/upload/url \
  -H "X-API-Key: $FASTINO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "dataset_name": "docs-example-ner",
    "filename": "training.jsonl",
    "dataset_type": "ner"
  }' | tee dataset-upload.json

export PRESIGNED_URL="$(jq -r '.presigned_url' dataset-upload.json)"
export DATASET_ID="$(jq -r '.dataset_id' dataset-upload.json)"
export DATASET_VERSION="$(jq -r '.version_number' dataset-upload.json)"
```

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:

```bash theme={null}
curl --fail-with-body -X PUT \
  -H "Content-Type: application/octet-stream" \
  --upload-file training.jsonl "$PRESIGNED_URL"
```

### 2. Process the uploaded file

```bash theme={null}
curl --fail-with-body -sS https://api.fastino.ai/v1/datasets/upload/process \
  -H "X-API-Key: $FASTINO_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg dataset_id "$DATASET_ID" '{dataset_id: $dataset_id}')"
```

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.

```bash theme={null}
curl --fail-with-body -sS https://api.fastino.ai/v1/datasets/docs-example-ner \
  -H "X-API-Key: $FASTINO_API_KEY"
```

## Start training

Pass the exact dataset name to the [training-job create
endpoint](https://docs.fastino.ai/api-reference/training-jobs/create.md):

```json theme={null}
{
  "model_name": "my-ner-model",
  "base_model": "fastino/gliner2-base-v1",
  "datasets": [
    {"name": "docs-example-ner", "version": "VERSION_NUMBER_FROM_UPLOAD"}
  ],
  "training_type": "lora"
}
```

Use `GET /v1/base-models?supports_training=true` immediately before submission to select a
currently trainable base model.

## Common blockers

| Status | Cause | Action |
| - | - | - |
| `401` | Missing or invalid API key | Send `X-API-Key: $FASTINO_API_KEY` |
| `404` | Dataset name does not exist | Confirm the exact name and wait for processing |
| `failed` | Asynchronous content validation failed | Read `processing_error`, correct the JSONL, and upload a new version |
| `422` | The request shape was rejected before processing | Correct the request fields before retrying |

## Dataset API contracts

> [card] [Upload URL](https://docs.fastino.ai/api-reference/datasets/upload-url.md)

> [card] [Process upload](https://docs.fastino.ai/api-reference/datasets/process-upload.md)

> [card] [List datasets](https://docs.fastino.ai/api-reference/datasets/list.md)

> [card] [Dataset versions](https://docs.fastino.ai/api-reference/datasets/versions.md)

> [card] [Delete dataset](https://docs.fastino.ai/api-reference/datasets/delete.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.