Skip to main content
POST
Together AI SDK (Python)

Authorizations

Authorization
string
header
default:default
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for previewing tokenized fine-tuning data.

model
string
required

Name of the base model whose tokenizer and chat template will be used.

training_file
string
required

File-ID of the uploaded JSONL training file to sample for preview.

training_method
enum<string>
default:sft

Fine-tuning method to preview. Only supervised fine-tuning is currently supported.

Available options:
sft
train_on_inputs
boolean
default:false

Whether prompt or user-message tokens should contribute to training loss in the preview.

top_k
integer
default:5

Maximum number of rows from the start of the training file to tokenize.

Required range: 1 <= x <= 50

Response

Tokenized data preview generated successfully

Tokenized preview for sampled rows from a fine-tuning training file.

model
string
required

Name of the base model used to tokenize the sampled rows.

dataset_format
enum<string>
required

Detected SFT dataset format for the sampled rows.

Available options:
general,
conversation,
instruction
max_seq_length
integer
required

Maximum sequence length configured for the requested model.

train_on_inputs
boolean
required

Whether prompt or user-message tokens contribute to training loss.

rows
object[]
required

Tokenized preview rows, in the same order as the sampled training file rows.