Skip to main content
Using a coding agent? Install the together-evaluations skill to let your agent write correct evaluation code automatically. Learn more.
The Together AI Evaluations service is a powerful framework for using LLM-as-a-Judge to evaluate other LLMs and various inputs.

Overview

Large language models can serve as judges to evaluate other language models or assess different types of content. You can simply describe in detail how you want the LLM-as-a-Judge to assess your inputs, and it will perform this evaluation for you. For example, they can identify and flag content containing harmful material, personal information, or other policy-violating elements. Another common use case is comparing the quality of two LLMs, or configurations of the same model (for example prompts) to determine which performs better on your specific task. Our Evaluations service allows you to easily submit tasks for assessment by a judge language model. With Evaluations, you can:
  • Compare models and configurations: Understand which setup works best for your task
  • Measure performance: Use a variety of metrics to score your model’s responses
  • Filter datasets: Apply LLM-as-a-Judge to filter and curate your datasets
  • Gain insights: Understand where your model excels and where it needs improvement
  • Build with confidence: Ensure your models meet quality standards before deploying them to production

Quickstart

To launch evaluations using the UI, please refer to: AI Evaluations UI For the full API specification, please refer to docs Get started with the Evaluations API in just a few steps. This example shows you how to run a simple evaluation.

1. Prepare Your Dataset

First, you’ll need a dataset to evaluate your model on. The dataset should be in JSONL or CSV format. Each line must contain the same fields. Example JSONL dataset:
dataset.jsonl
You can find example datasets at the following links:

Evaluating with images

To evaluate vision-capable models, add an image_data_urls column to your dataset rows:
dataset.jsonl
  • Its value is a base64-encoded image data URL (or a list of them) and the images are attached to the model and judge requests alongside the rendered text prompt.
  • Only base64 data URLs (data:image/...;base64,...) are supported, not remote http(s) image links.
  • Images are automatically translated to each provider’s native format: OpenAI-style image_url parts for Together serverless, dedicated endpoints, and other OpenAI-compatible endpoints; inline image data for Google Gemini; and image blocks for Anthropic. The same dataset works across providers.
  • The model being evaluated (and the judge, if it should also see the image) must be vision-capable.

2. Upload Your Dataset

You can use our UI, API, or CLI.
Make sure to specify purpose: "eval" to ensure the data is processed correctly.

3. Run the Evaluation

We support three evaluation types, each designed for specific assessment needs:
  • classify — Classifies the input into one of the provided categories. Returns one of the predefined classes.
  • score — Takes an input and produces a score within a specified range. Returns a numerical score.
  • compare — Takes responses from two models and determines which one is better according to a given criterion.

Evaluation Type: Classify

Purpose: Categorizes input into predefined classes (e.g., “Toxic” vs “Non-toxic”) Parameters:
  • judge (required): Configuration for the judge model
    • model – The model to use for evaluation
    • model_source – One of: “serverless”, “dedicated”, or “external”
    • system_template – Jinja2 template providing guidance for the judge (see Understanding Templates)
    • external_api_token – Optional; required when model_source = "external". If you select external model source, use this to provide API bearer authentication token (eg. OpenAI token)
    • external_base_url - Optional; when using an external model source, you can specify your own base URL. (e.g., "https://api.openai.com"). The API must be OpenAI chat/completions-compatible.
    • max_tokens – Optional; maximum number of tokens the judge model can generate. Defaults to 32768. Increase for reasoning models (for example, Gemini or o-series) that consume output token budget for chain-of-thought.
    • temperature – Optional; sampling temperature for the judge model. Defaults to 0.05.
    • num_workers – Optional; number of concurrent workers for judge inference requests. Defaults: serverless → 25, dedicated → 5 (minimum), external → 2 for first-party APIs (OpenAI, Anthropic, Google) or 20 for proxy/aggregator endpoints (e.g. OpenRouter). Override this to tune throughput for your workload.
  • labels (required): List of strings defining the classification categories
  • pass_labels (optional): List of labels considered as “passing” for statistics
  • model_to_evaluate (required): Configuration for the model being evaluated
    • Can be either:
      • A string referencing a column in your dataset (e.g., "prompt")
      • A model configuration object (see below)
  • input_data_file_path (required): File ID of your uploaded dataset
Model Configuration Object (when generating new responses):
  • model – Choose from supported serverless models; for model_source = "dedicated", use your dedicated endpoint. When model_source = "external", you can specify either a model name shortcut (e.g., openai/gpt-5), or provide a model name for an OpenAI-compatible URL. For more details, see the notes below.
  • model_source – Literal: “serverless” | “dedicated” | “external” (required)
  • external_api_token – Optional; required when model_source = "external". If you select external model source, use this to provide API bearer authentication token (eg. OpenAI token)
  • external_base_url - Optional; when using an external model source, you can specify your own base URL. (e.g., "https://api.openai.com"). The API must be OpenAI chat/completions-compatible.
  • system_template – Jinja2 template for generation instructions (see Understanding Templates)
  • input_template – Jinja2 template for formatting input (see Understanding Templates)
  • max_tokens – Maximum tokens for generation
  • temperature – Temperature setting for generation
  • num_workers – Optional; number of concurrent workers for inference requests. Defaults: serverless → 25, dedicated → 5 (minimum), external → 2 for first-party APIs or 20 for proxy endpoints. Override to tune throughput for your workload.
Model source options:
Evaluating external models
You can evaluate models from external providers like OpenAI, Anthropic, or Google by setting model_source = "external" in the model_to_evaluate configuration. Use a supported shortcut or provide a custom external_base_url for OpenAI-compatible APIs.
Using external models as judges
You can use external models as the judge by setting judge.model_source = "external" and providing judge.external_api_token in the parameters. Use a supported shortcut or specify judge.external_base_url for custom OpenAI-compatible endpoints.

Evaluation Type: Score

Purpose: Rates input on a numerical scale (e.g., quality score from 1-10) Parameters:
  • judge (required): Configuration for the judge model
    • model – The model to use for evaluation
    • model_source – One of: “serverless”, “dedicated”, or “external”
    • system_template – Jinja2 template providing guidance for the judge (see Understanding Templates)
    • external_api_token – Optional; required when model_source = "external". If you select external model source, use this to provide API bearer authentication token (eg. OpenAI token)
    • external_base_url - Optional; when using an external model source, you can specify your own base URL. (e.g., "https://api.openai.com"). The API must be OpenAI chat/completions-compatible.
    • max_tokens – Optional; maximum number of tokens the judge model can generate. Defaults to 32768. Increase for reasoning models (for example, Gemini or o-series) that consume output token budget for chain-of-thought.
    • temperature – Optional; sampling temperature for the judge model. Defaults to 0.05.
    • num_workers – Optional; number of concurrent workers for judge inference requests. Defaults: serverless → 25, dedicated → 5 (minimum), external → 2 for first-party APIs (OpenAI, Anthropic, Google) or 20 for proxy/aggregator endpoints (e.g. OpenRouter). Override this to tune throughput for your workload.
  • min_score (required): Minimum score the judge can assign (float)
  • max_score (required): Maximum score the judge can assign (float)
  • pass_threshold (optional): Score at or above which is considered “passing”
  • model_to_evaluate (required): Configuration for the model being evaluated
    • Can be either:
      • A string referencing a column in your dataset
      • A model configuration object (same structure as in Classify)
  • input_data_file_path (required): File ID of your uploaded dataset
Evaluating external models
You can evaluate models from external providers like OpenAI, Anthropic, or Google by setting model_source = "external" in the model_to_evaluate configuration. Use a supported shortcut or provide a custom external_base_url for OpenAI-compatible APIs.
Using external models as judges
You can use external models as the judge by setting judge.model_source = "external" and providing judge.external_api_token in the parameters. Use a supported shortcut or specify judge.external_base_url for custom OpenAI-compatible endpoints.

Evaluation Type: Compare

Purpose: Determines which of two models performs better on the same task Parameters:
  • judge (required): Configuration for the judge model
    • model – The model to use for evaluation
    • model_source – One of: “serverless”, “dedicated”, or “external”
    • system_template – Jinja2 template providing guidance for comparison (see Understanding Templates)
    • external_api_token – Optional; required when model_source = "external". If you select external model source, use this to provide API bearer authentication token (eg. OpenAI token)
    • external_base_url - Optional; when using an external model source, you can specify your own base URL. (e.g., "https://api.openai.com"). The API must be OpenAI chat/completions-compatible.
    • max_tokens – Optional; maximum number of tokens the judge model can generate. Defaults to 32768. Increase for reasoning models (for example, Gemini or o-series) that consume output token budget for chain-of-thought.
    • temperature – Optional; sampling temperature for the judge model. Defaults to 0.05.
    • num_workers – Optional; number of concurrent workers for judge inference requests. Defaults: serverless → 25, dedicated → 5 (minimum), external → 2 for first-party APIs (OpenAI, Anthropic, Google) or 20 for proxy/aggregator endpoints (e.g. OpenRouter). Override this to tune throughput for your workload.
  • model_a (required): Configuration for the first model
    • Can be either:
      • A string referencing a column in your dataset
      • A model configuration object
  • model_b (required): Configuration for the second model
    • Can be either:
      • A string referencing a column in your dataset
      • A model configuration object
  • input_data_file_path (required): File ID of your uploaded dataset
  • disable_position_bias_correction (optional, default: false): When false (default), the judge runs twice per sample — once in the original order (A then B) and once in the flipped order (B then A) — and the two verdicts are reconciled to cancel out position bias. Set to true to run only the original-order pass, halving judge cost and latency at the expense of position-bias correction.
Default (two-pass): The judge evaluates each sample twice with model positions swapped to correct for position bias. When both verdicts agree the winner is declared; when they disagree the result is a “Tie”.When disable_position_bias_correction: true (single-pass): Only one judge pass is run (original order). This roughly halves judge cost and latency. Use this when speed or cost matters more than bias correction, or when your judge is known to be position-insensitive.When both model_a and model_b are model configuration objects (not pre-generated column references), their inference runs execute in parallel, reducing total wall-clock time.
Evaluating external models
You can compare models from external providers like OpenAI, Anthropic, or Google by setting model_source = "external" in the model configuration. Use a supported shortcut or provide a custom external_base_url for OpenAI-compatible APIs.
Using external models as judges
You can use external models as the judge by setting judge.model_source = "external" and providing judge.external_api_token in the parameters. Use a supported shortcut or specify judge.external_base_url for custom OpenAI-compatible endpoints.
Example response
JSON
Monitor your evaluation job’s progress:
Example response from the detailed endpoint:
JSON
The result file is inside results.result_file_id: "file-95c8f0a3-e8cf-43ea-889a-e79b1f1ea1b9"

4. View Results

We provide comprehensive results without omitting lines from the original file unless errors occur (up to 30% may be omitted in error cases).

Result Formats by Evaluation Type

Classify Results (ClassifyEvaluationResult): Score Results (ScoreEvaluationResult): Compare Results (CompareEvaluationResult):

Downloading Result Files

Pass any result_file_id to the Files API to download a complete report for auditing or deeper analysis. Each line in the result file has an evaluation_status field (True or False) indicating if the line was processed without issues.
You can download the result file using the UI, API, or CLI:
Each line in the result file includes:
  • Original input data
  • Generated responses (if applicable)
  • Judge’s decision and feedback
  • evaluation_status field indicating if processing succeeded (True) or failed (False)
Example result line for compare evaluation:
JSON

Understanding Templates

Templates are used throughout the Evaluations API to dynamically inject data from your dataset into prompts. Both system_template and input_template parameters support Jinja2 templating syntax. Jinja2 templates allow you to inject columns from the dataset into the system_template or input_template for either the judge or the generation model.

Examples

  • You can specify a reference answer for the judge:
    • "Please use the reference answer: {{reference_answer_column_name}}"
  • You can provide a separate instruction for generation for each example:
    • "Please use the following guidelines: {{guidelines_column_name}}"
  • You can specify any column(s) as input for the model being evaluated:
    • "Continue: {{prompt_column_name}}"
  • You can also reference nested fields from your JSON input:
    • "{{column_name.field_name}}"
  • And many more options are supported.

Basic Example

If your dataset contains:
JSON
And you set:
Python
The final input becomes:
Text

Nested Data Example

For complex structures:
JSON
You can access nested fields:
Python
For more Jinja2 functionality, see:

Best Practices

  1. Provide clear judge instructions: Write detailed, structured system prompts with examples and explicit rules for the judge to follow
  2. Choose appropriate judge models: Use larger, more capable models as judges than the models being evaluated
  3. Test your templates: Verify that your Jinja2 templates correctly format your data before running large evaluations
Output format: During the execution, we add a format template to control the output format, for example:
Python

Example: Classification System Prompt

Here’s an example of a well-structured system prompt for a classify evaluation that determines whether model responses are harmful:
Python
This template demonstrates several best practices:
  • Clear role definition: Explicitly states the evaluator’s single purpose
  • Structured procedure: Step-by-step evaluation process
  • Specific criteria: Well-defined categories with examples
  • Decision rules: Clear instructions for edge cases

Models and endpoints

See what models are supported for evaluation by visiting our supported models and dedicated model inference.

Pricing

We charge only for the inference costs required for the evaluation job, according to our serverless inference pricing.

Waiting times

We concurrently submit requests to our serverless inference. Time for completion depends on the model size, current capacity, and other factors. For small jobs (less than 1000 samples) we expect to complete in under an hour.