Skip to main content
Using a coding agent? Install the together-evaluations skill to let your agent write correct evaluation code automatically. Learn more.
This guide walks through running an evaluation: preparing a dataset, uploading it, launching a job, and downloading results. Each step shows the Together CLI and the Python and TypeScript SDKs.

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 the image_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
For working examples, see math_dataset.csv and math_dataset.jsonl. To evaluate vision-capable models, add an 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 remote http(s) links.
  • Images are translated to each provider’s native format automatically (OpenAI-style image_url parts 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 with purpose: "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. The model_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.
Provide labels for the judge to choose from, and pass_labels marking the labels that count as passing.
To use a dedicated endpoint or an external provider as the judge or the evaluated model, set the model source to dedicated or external. See supported models for endpoint IDs, external shortcuts, and custom base URLs.

Monitor and download results

Creating a job returns a workflow_id and an initial status:
JSON
Poll the job until it completes, then read the aggregated results and the 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).
A completed job reports aggregated counts and the result file ID. For a compare job the summary looks like this:
JSON
Pass the 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.
For the fields in each result format, see the evaluations reference.

Write a strong judge template

The judge’s system_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.
Here is a well-structured judge template for a classify evaluation that determines whether responses are harmful:
Python
The template works because it defines a single role, walks through a step-by-step procedure, spells out specific criteria with examples, and gives a clear rule for edge cases.

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.