Skip to content

Datasets

A dataset is training data stored on Turion under an id like ds_0123456789abcdef: records in one of four formats, kept as one JSONL file. Training jobs read it by id. You upload a file you already have, convert files in other shapes, or import a Hugging Face dataset repo. On upload, the CLI validates and normalises your file on your machine before anything is sent.

Terminal window
turion datasets upload support.jsonl
# validated support.jsonl: chat, 1,197 examples, 3 duplicates dropped
# uploaded ds_0123456789abcdef support (1,197 examples)
# ds_0123456789abcdef
# train on it: turion train --base gemma-4-e4b --data ds_0123456789abcdef

The id goes to stdout and everything else to stderr, so ID=$(turion datasets upload …) captures just the id. On a terminal, the validation summary and an upload progress bar replace the plain lines shown here. --json prints the created dataset as JSON.

Spreadsheets, exports, PDFs, mailboxes and other files that are not in a Turion format go through turion datasets convert instead: see Convert data. A Hugging Face dataset repo is copied in with turion datasets import (see Hugging Face).

One record per line, one format per dataset.

A conversation in the OpenAI messages shape. The model is trained on the assistant turns only; system, user and tool turns are context.

{"messages": [{"role": "system", "content": "You are Acme's support assistant."}, {"role": "user", "content": "How do I rotate an API key?"}, {"role": "assistant", "content": "Create the new key first, deploy it, then revoke the old one."}]}
  • role is one of system, developer, user, assistant, tool. The trainer treats developer as system.
  • content is a string, or a list of parts that each have a type. Training is text-only, so a record with an image or audio part fails validation, locally with its file:line and on the server, rather than failing the training job later.
  • At least one assistant message per record (an eval record may use expected instead).
  • Tool use is supported. Put the tool definitions in tools, the call on an assistant message as tool_calls (each with function.name), and the result in a tool message with tool_call_id:
{"tools": [{"type": "function", "function": {"name": "get_order", "parameters": {"type": "object", "properties": {"id": {"type": "string"}}}}}], "messages": [{"role": "user", "content": "Where is order 4417?"}, {"role": "assistant", "content": null, "tool_calls": [{"id": "call_1", "type": "function", "function": {"name": "get_order", "arguments": "{\"id\": \"4417\"}"}}]}, {"role": "tool", "tool_call_id": "call_1", "content": "{\"status\": \"shipped\"}"}, {"role": "assistant", "content": "Order 4417 has shipped."}]}
{"prompt": "Translate to French: good morning", "completion": "bonjour"}

Both fields are non-empty strings. The trainer turns each record into a user turn and an assistant turn, so it goes through the base model’s chat template like a chat record.

{"text": "Turion runs fine-tunes behind an OpenAI-compatible endpoint."}

Plain language-model training on the whole text. Text records have no answer to compare against, so they cannot be eval cases: a job trained on text data gets an eval score only from a separate --evals file in the chat or prompt/completion format.

Training data for a decision model: a state, a typed question and its answer.

{"state": "I was charged twice for October.", "question": {"type": "choice", "instructions": "Which team should handle this?", "criteria": ["billing", "tech", "sales", "other"]}, "answer": "billing"}

The question is a choice, score or noul, as POST /v1/systemone takes it. The answer is the option’s name, the level’s number counting from 0, or true/false. A row with questions and answers (several questions about one state) is expanded to one example per question, and a multiple-choice row ({"question": "…", "A": "…", "B": "…", "answer": "B"}) becomes a choice. A choice has 2–26 options and a score 2–10 levels. Decision models → Dataset format has every shape and rule. Decision records are their own eval cases: the trainer scores whether the model picks the right answer.

A .csv file with a prompt,completion header (any column order, header case ignored) is read as prompt/completion. Blank rows are skipped. Other columns are ignored.

A folder of .jsonl and .csv files is read as one dataset, files in name order. Hidden files are skipped, and every file must hold the same format.

The CLI reads the whole file before uploading and stops at the first problem, naming the file and the 1-based line:

error: invalid_dataset: support.jsonl:42: messages[1].role must be one of system, developer, user, assistant, tool (got 'bot')

What it checks: valid JSON on every line, the record shape above, one format across all records and files. What it writes: each record normalised to its canonical keys (unknown keys dropped), one per line. The server validates the uploaded bytes again with the same rules, so a dataset marked ready is one the trainer can read. If the server disagrees, the upload fails with dataset_invalid and the server’s line numbers, and turion datasets get shows the error.

Exact duplicate records (same content after normalisation) are dropped locally and counted in the validated line. The server counts duplicates again and reports them in turion datasets get; after a CLI upload that number is 0. The trainer drops duplicates too, before it holds anything out, so a held-out case is never also a training example.

A training job scores the base model and the fine-tune on eval cases. There are three ways to give it some:

HowWhat happens
turion train --evals evals.jsonl (or a ds_… id)a separate file of cases, all of them scored (up to 1,000)
--eval-split 0.1 with a local filethe CLI holds out that share before upload and uploads it as a second dataset, <name>-eval
neitherthe trainer holds out 10% of the training data (at most 200 cases, none if there are fewer than 10 examples); for decision data, 20% in whole states, at least 50 and at most 1,000 cases and never more than half (The eval split)

turion datasets upload --eval-split 0.1 does the same split without starting a job:

Terminal window
turion datasets upload support.jsonl --eval-split 0.1
# validated support.jsonl: chat, 1,197 examples, 3 duplicates dropped
# uploaded ds_0123456789abcdef support (1,077 examples, train)
# uploaded ds_fedcba9876543210 support-eval (120 examples, 0.1 held out for eval)
# ds_0123456789abcdef ds_fedcba9876543210

Both splits are deterministic: the same file and fraction give the same held-out records. The CLI split keeps at least one record on each side and needs at least two records; decision data splits by state instead and needs at least 10 examples (The eval split). The fraction is 0–0.5, the same range the trainer accepts; --eval-split 0 holds nothing out (for turion train, it also tells the trainer not to hold out its default share: 10%, or 20% for decision data).

Eval records can carry three extra keys, which the CLI keeps:

KeyMeaning
expectedthe answer, instead of the last assistant turn (any JSON value for match: "json")
matchexact, contains, regex, json or f1 (default)
thresholdf1 only, default 0.5

With expected, a chat case can end on the user turn. A prompt/completion case with expected may omit completion in a file you pass to turion eval, but not in an eval set you upload for training: the server requires completion on every prompt/completion record. Evals explains the matchers.

A Hugging Face dataset repo can be the source of a dataset, or receive a copy of one. Imports and pushes run on Turion’s servers with your own Hugging Face token; Turion’s own Hugging Face credentials are never used for your repos.

Terminal window
turion providers set huggingface
# huggingface API key: ********
# stored huggingface key …abcd
# signed in to Hugging Face as acme
# try: turion datasets import hf:<owner>/<name>

Create the token at huggingface.co/settings/tokens: read access is enough to import, and pushing needs write access. The token is checked with Hugging Face before it is stored, and it is kept like any provider key. Without one, the commands below fail with hf_token_missing.

Terminal window
turion datasets import hf:acme/support-tickets
# imported acme/support-tickets into ds_0123456789abcdef (train split, commit 3f9a1c2, 1,200 examples)
# ds_0123456789abcdef
# train on it: turion train --base gemma-4-e4b --data ds_0123456789abcdef

The ref is hf:owner/name[@revision][:split]: a branch, tag or commit after @ (default: the repo’s default branch) and a split after : (default: train), as in hf:acme/support-tickets@v2:test. --name names the dataset; the default is the repo’s name. The copy runs on the server. The command waits for it, and Ctrl-C stops waiting while the import goes on.

An import is a copy that records the commit it read. Importing the same repo and split again while the repo is still at that commit gives the same dataset back, without downloading anything; a new commit makes a new dataset. Deleting the dataset does not touch the repo. turion datasets list shows imported datasets with the source hf.

The first of these paths that exists in the repo holds the split (<split> is train, test, and so on):

PathNotes
data/<split>.jsonlwhat turion datasets push writes
<split>.jsonl
data/<split>-*.parquet, then <split>-*.parquetshards, read in name order
data/<split>.parquet, then <split>.parquet
data/<split>.csv, then <split>.csvone record per row, keyed by the header

For the train split only, a repo with none of these and exactly one .jsonl, .parquet or .csv file is read from that file. A split can be up to the 2 GiB dataset limit. An account has at most two imports and pushes in progress at once; a third fails with too_many_transfers until one finishes.

The records must already be in a Turion format: the server validates them as it does an upload. Data in another shape fails with dataset_invalid, the first problems, the columns of the first row, and the commands that convert the repo instead:

Terminal window
hf download --repo-type dataset acme/support-tickets --local-dir raw
turion datasets convert raw

hf is Hugging Face’s own CLI, from the huggingface_hub package. Convert data covers the second command.

Terminal window
turion datasets push ds_0123456789abcdef --to hf:acme/support-tickets
# pushed ds_0123456789abcdef to acme/support-tickets (commit 8b1d0e4)
# https://huggingface.co/datasets/acme/support-tickets

A push writes the dataset to data/train.jsonl in one new commit, with a README.md dataset card when the repo has none; other files are left as they are. A missing repo is created private (--public creates it public), and an existing repo keeps its visibility. The card points Hugging Face’s dataset viewer at the file and records the format, the example count and the source dataset. Only a ready dataset can be pushed, and the token needs write access.

Turion writes to a Hugging Face repo only when you push: turion datasets push, or turion datasets convert --push.

Terminal window
turion train --base gemma-4-e4b --data hf:acme/support-tickets \
--evals hf:acme/support-tickets:test

--data and --evals take an hf: ref. turion train imports it first, as above, then trains on the dataset; a repo unchanged since an earlier import reuses that dataset with no download. Decision data trains with --method decision, picked for you. The errors an import can end with, and what to do about each, are listed under turion datasets import.

LimitValue
dataset size2 GiB; 413 dataset_too_large above it
dataset name1–100 characters; names need not be unique
one line (server)16 MiB
problems reported by the serverthe first 5, with line numbers
upload URL lifetime1 hour
Terminal window
turion datasets list # newest first
turion datasets get ds_0123456789abcdef # one dataset, and the reason if invalid
turion datasets rm ds_0123456789abcdef # asks first; -y skips the prompt

list shows each dataset’s status, format, examples, tokens and source. status is uploading, ready or invalid; an upload not finished within 2 hours turns invalid, with the reason in get. tokens is an estimate (characters / 4). source is upload, traces for a dataset built from an agent’s traces by turion agent distil, or hf for a Hugging Face import. A dataset that a queued or running job uses cannot be deleted (409 dataset_in_use). list and get take --json.

Deleting a dataset removes its record and the stored file. What else Turion keeps, and how to delete it, is in Data & security.

import turion
client = turion.Client()
ds = client.datasets.upload("support.jsonl") # Dataset
train, held_out = client.datasets.upload("support.jsonl", eval_split=0.1)
ds = client.datasets.create_from_records(
[{"prompt": "2+2?", "completion": "4"}, {"prompt": "3+3?", "completion": "6"}],
name="arithmetic",
)
local = turion.load_dataset("support.jsonl") # validate only, no upload
print(local.format, local.examples, local.duplicates)
started = client.datasets.import_hf("hf:acme/support-tickets")
t = client.datasets.wait_transfer(started.id) # DatasetTransfer
print(t.status, t.dataset_id) # done ds_…
client.datasets.push_hf("ds_0123456789abcdef", "hf:acme/support-tickets")
client.datasets.list()
client.datasets.get("ds_0123456789abcdef")
client.datasets.delete("ds_0123456789abcdef")

A local problem raises turion.DatasetError (a TurionError with code invalid_dataset); a server rejection raises TurionError with code dataset_invalid.

An upload is three calls: create the dataset, PUT the file to the presigned URL (no Authorization header), then ask the server to validate it.

Terminal window
curl -sX POST https://api.turion.ai/v1/datasets \
-H "Authorization: Bearer $TURION_API_TOKEN" -H "Content-Type: application/json" \
-d '{"name": "support", "bytes": 482113}'
# {"dataset": {"id": "ds_0123456789abcdef", "status": "uploading", …},
# "upload_url": "https://…", "expires_at": "2026-10-08T11:00:00Z"}
curl -sX PUT --upload-file support.jsonl "$UPLOAD_URL"
curl -sX POST https://api.turion.ai/v1/datasets/ds_0123456789abcdef/complete \
-H "Authorization: Bearer $TURION_API_TOKEN"
# {"id": "ds_0123456789abcdef", "status": "ready", "format": "chat", "examples": 1197, …}

The server does not normalise: upload JSONL that already follows the rules above. A Hugging Face import or push is one call that starts a background transfer, which you then poll. Full shapes: REST API → Datasets.