Requirements
- The Together CLI or an SDK (version 2 or later of the Python SDK, or the TypeScript SDK), with your API key set. The CLI ships with the Python package (
pip install "together>=2.0.0"). See the quickstart for setup. - A dataset of the inputs you want to evaluate.
Prepare a dataset
Datasets are JSONL or CSV files where every row contains the same fields. A row can hold a prompt to generate from, pre-generated responses to judge, or both. The job must use every column: each one has to appear in a template placeholder, be named as a pre-generated response column, or be theimage_data_urls image column. A dataset with unused columns (metadata like id or category) fails validation with a user_error, so remove them or reference them in a template; see dataset columns for the exact rules. The examples in this guide inject the prompt column below with {{prompt}}.
dataset.jsonl
image_data_urls column whose value is a base64-encoded image data URL, or a list of them:
dataset.jsonl
- Only base64 data URLs (
data:image/...;base64,...) are supported, not remotehttp(s)links. - Images are translated to each provider’s native format automatically (OpenAI-style
image_urlparts for Together serverless, dedicated, and other OpenAI-compatible endpoints, inline image data for Google Gemini, and image blocks for Anthropic), so the same dataset works across providers. - The evaluated model, and the judge if it should see the image, must be vision-capable.
Upload the dataset
Upload the file withpurpose: "eval" and keep the returned file ID to reference when you create the job.
The SDKs run a local format check before uploading that can misclassify a valid evaluation dataset. The examples above disable it (
check=False in Python, the false argument in TypeScript) so the eval file uploads. The server still validates the file.Run the evaluation
Create the job with the type that matches your task. Themodel_to_evaluate (and model_a / model_b for compare) can be either a model configuration object that generates fresh responses, or a string naming a dataset column that already holds responses. The CLI examples below reference the uploaded file with $FILE_ID. The CLI also accepts a local dataset path in --input-data-file-path and uploads it with purpose: "eval" automatically, so you can skip the upload step.
- Classify
- Score
- Compare
Provide
labels for the judge to choose from, and pass_labels marking the labels that count as passing.dedicated or external. See supported models for endpoint IDs, external shortcuts, and custom base URLs.
Monitor and download results
Creating a job returns aworkflow_id and an initial status:
JSON
result_file_id. A job that fails ends in error or user_error instead, with the reason in results.error; to see recent jobs and their statuses, use tg evals list (client.evals.list() in the SDKs).
JSON
result_file_id to download the row-level report. Each line includes the original input, any generated responses, the judge’s decision and feedback, and an evaluation_successful field indicating whether the row was processed successfully.
In
together 2.24.0, tg files download cannot save evaluation result files; use the SDKs or the files API to download them.Write a strong judge template
The judge’ssystem_template is the biggest lever on evaluation quality:
- Write detailed, structured instructions: Give the judge an explicit procedure, concrete criteria with examples, and rules for edge cases.
- Use a judge at least as capable as the models being evaluated: Larger judges follow the criteria and output format more reliably.
- Test your templates: Verify that your Jinja2 templates render your dataset columns correctly before running a large job.
Python
Next steps
Parameters and results
Parameters, result formats, and template syntax.
Supported models
Serverless models and external provider shortcuts.
Evaluations overview
The concepts behind classify, score, and compare.