Convert data
turion datasets convert turns spreadsheets, exports, documents and mailboxes into a Turion
dataset. It uploads your files and runs the data-converter agent on your
account. The agent reads each file, asks a model how to turn it into training records, checks every
record with the rules turion datasets upload uses, and creates the dataset.
Use it when your data is not already JSONL or CSV in one of the four dataset formats. A file that already is goes into the dataset unchanged.
Deploy the converter
Section titled “Deploy the converter”The converter is an agent on your account, named data-converter. The CLI carries its code, and
the first turion datasets convert deploys it for you: on a terminal it asks first (Enter says
yes), and --yes deploys it without asking, which is how a script does it. Without a terminal and
without --yes, the command stops with
error: converter_not_deployed: no agent named data-converter on this account and
hint: run it again with --yes to deploy the converter now.
Its model calls go to deepseek-v4.1-flash, Turion’s shared model from the
model garden, so there is no provider key to set. The deployed copy is
yours: turion agent pull data-converter downloads its code, and turion agent deploy in that
directory deploys your changes. --agent NAME runs a converter deployed under another name; that
name is never deployed for you, so a typo stops with an error instead of creating an agent.
Convert
Section titled “Convert”turion datasets convert ./raw --format chat \ --instructions "support replies, newest first" --name support# uploaded 3 files (4 MB)# tickets.xlsx#Tickets map 1,180 records# handbook.pdf synthesize 34 examples# logo.png skip unsupported file type .png# chat, 1,197 examples; dropped 17 duplicates# ds_0123456789abcdef# train on it: turion train --base gemma-4-e4b --data ds_0123456789abcdefEach path is uploaded, a folder as one zip without its hidden files. The dataset id goes to stdout
and everything else to stderr, so ID=$(turion datasets convert …) captures just the id; with
--push, the repo’s URL follows the id on stdout. On a terminal the summary is drawn as a table,
and a spinner shows the elapsed time while the run waits for a container and works. Ctrl-C stops
waiting, not the run, and prints the commands to follow and stop it.
| Option | Default | What it does |
|---|---|---|
PATH... | (required) | files or folders, any mix of the types below |
--format | auto | chat, prompt_completion, text, decision, or auto: the model picks from the data and your instructions |
--instructions TEXT | — | what the data is and what the model should learn |
--name | first path’s stem | dataset name |
--max-synthesized N | 500 | cap on examples written from documents |
--agent | data-converter | the deployed converter to run |
--push hf:OWNER/NAME | — | then push the dataset to Hugging Face (below) |
--json | off | print the agent’s result as JSON |
--yes, -y | off | deploy the converter without asking when the account has none |
What it reads
Section titled “What it reads”| Files | Read as |
|---|---|
.csv .tsv | rows; the first row is the header, the delimiter is detected; UTF-8, or Windows-1252 (Excel’s encoding on Windows; the file’s line says read as cp1252) |
.xlsx | rows, each sheet a source of its own (tickets.xlsx#Tickets); the first row is the header |
.json | rows: a list of objects, or an object holding one list |
.jsonl .ndjson | rows, one object per line |
.parquet | rows |
.eml .mbox | one row per message: from, to, subject, date, body |
.txt .md .html .htm .pdf .docx | documents, text only |
.zip .tar .tar.gz .tgz | unpacked and read file by file, with archives inside them up to 3 levels deep (export.zip/tickets.csv) |
Hidden files are skipped. So are other file types, empty files, PDFs with no text layer (a scan
needs OCR first) and archives nested deeper than 3 levels, each with the reason on its line. A file that cannot be read is skipped with the
error, and the run goes on. Empty cells are left out of a row, and the characters { } ! : . [ ]
in a column name become _ (Order No. is read as Order No_), so a template can name every
column.
How each file is handled
Section titled “How each file is handled”Each file gets one mode, shown on its line of the output.
passthrough. Rows that are already Turion records go into the dataset as they are, with no
model call, when their format is the one you asked for. With auto, the first such file’s format
becomes the dataset’s. Chat rows, and decision rows whose question is an object, pass through even
with extra columns such as id; those are ignored and listed (ignored columns: id). A text,
prompt/completion or multiple-choice file with an extra column (text,label) goes to the model
for a plan instead, since that column may carry meaning.
map. For rows. The model gets a profile of the file (below) and answers with a template for
each field of the target format, with {column} placeholders, such as
{"prompt": "{question}", "completion": "{answer}"}. The agent fills the templates in for every
row. A placeholder names a column and nothing else: a template with anything else in braces
({0.__class__}, {answer:>10}) fails the plan check. A row whose answer comes out empty is
dropped and counted. A decision plan also names the question and can map a column’s values to its
options.
synthesize. For documents. The text is cut into chunks of about 3,000 characters, and the
model writes examples from each chunk, answerable from that chunk alone. --max-synthesized caps
the total (default 500). A chunk whose call fails is skipped and counted on the file’s line
(2 chunks failed), and the run goes on.
skip. A file that fits none of these is skipped with the reason.
Before anything is applied, the plan is checked: every file needs a mode, and a template may only
name columns the file has. A plan that fails is sent back to the model once with the problems; a
second failure ends the run. After it is applied, every record is validated with the rules of
turion datasets upload. A dataset holds one format, so a record in another one, or one that
fails validation (a synthesized example in the wrong shape), is dropped and counted as invalid,
and the first 5 reasons are printed. Exact duplicates are dropped and counted.
What reaches the model
Section titled “What reaches the model”The model sees a profile of each file, never the file itself:
- its name, with its path inside the uploaded folder or archive and, for a spreadsheet, the
sheet name (
export.zip/tickets.xlsx#Tickets) - for rows: the column names, the row count and 5 sample rows, each value cut to 300 characters
- for a document: its length and its first 2,000 characters
- your
--formatand--instructions
For a document the plan synthesizes from, the model then gets the text one chunk per call, until the synthesis cap is reached. Rows mapped through templates do not reach the model beyond the 5 samples.
The model answers with JSON only: a plan, or examples. It never writes or runs code. The agent fills the templates with its own substitution and applies only a plan that passes the checks. The agent has no tools, so instructions written inside a file can at worst steer the plan or the examples, which are checked like any others.
Files are downloaded into the run’s container, read there and deleted once read. The model calls are traced like any agent’s. What Turion keeps from a conversion is in Data & security.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| input | 100 MiB in all, counted after unpacking archives |
| synthesized examples | 500 per run by default (--max-synthesized) |
| run time | 1 hour (timeout in the agent’s turion.toml) |
| formats | one per dataset |
turion datasets convert waits for the run with no time limit of its own.
Errors
Section titled “Errors”A failed conversion exits 1 with the reason and a logs: turion agent logs data-converter --run ID line. A missing converter and input over the cap are caught before anything is uploaded.
| Error | Cause | Fix |
|---|---|---|
converter_not_deployed: no agent named data-converter on this account | The converter is not deployed on this account (and there was no terminal to ask on, or you said no), or not under the --agent name | Run it again with --yes, or deploy it with the commands above; the CLI prints both |
conversion failed: no valid examples: … | Nothing survived mapping and validation; the first reasons follow (nothing to convert when every file was skipped) | Check --format, or say more in --instructions |
conversion failed: the model declined to convert this data under its provider's usage policy; nothing was created | The model refused the request because of what the files contain | Running it again gets the same answer; convert other data |
conversion failed: the model could not produce a valid plan: … | The plan failed its checks twice | Run it again with clearer --instructions, or convert the files separately |
input_too_large: … is over the converter's 100 MiB limit | More than 100 MiB of input. The CLI adds up the files before uploading them; the agent counts again after unpacking archives | Convert it in parts, one folder or file per run (the hint says so) |
Push to Hugging Face
Section titled “Push to Hugging Face”turion datasets convert ./raw --format chat --push hf:acme/support-ticketsOnce the dataset is made, --push sends it to a Hugging Face dataset repo, as
turion datasets push does. A missing repo is created private; an
existing one keeps its visibility. It needs a Hugging Face token with write access, stored with
turion providers set huggingface. The repo’s URL goes to stdout after the dataset id. A push
that fails exits 1 but leaves the dataset made, and prints the turion datasets push command
that sends it again.
Run it as an agent
Section titled “Run it as an agent”The converter is an ordinary agent, so turion agent run with --file gives it the same input:
turion agent run data-converter --file ./raw \ -i '{"format": "chat", "name": "support"}' --timeout 0 --jsonThe input is {"files": [...], "format": "auto", "instructions": "…", "name": "…", "max_synthesized": 500}, where files holds the turion:// refs that --file (or
POST /v1/uploads) gives you. The result has
output, dataset, format, examples, duplicates, dropped, drop_reasons, sources (one
entry per file, with its mode) and the plan. --timeout 0 waits for as long as the run takes;
turion agent run otherwise stops waiting after 300 seconds.
A local run in a copy of its code also takes paths on your machine:
turion agent pull data-converter && cd data-converterturion agent run --local \ -i '{"files": ["samples/tickets.csv"], "format": "chat"}'Local runs call the model through the gateway as you, so they need turion login. Every run
creates a real dataset on your account: local, deployed, and turion agent eval, which converts
the three files in samples/.