> ## Documentation Index
> Fetch the complete documentation index at: https://docs.braintrust.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Score pre-generated model outputs from logs

> Run existing scorers on pre-generated model outputs without calling the model again.

> [!NOTE]
>
> **Applies to:**
>
> * Plan - Any
> * Deployment - Any
> *
> * Use case - Run existing Braintrust scorers on previously generated model outputs by uploading outputs as logs or returning stored outputs from an SDK evaluation

## Summary

You can run your existing scorers on pre-generated model outputs by uploading input/output pairs as logs or by running an SDK evaluation that returns stored outputs. The UI experiment flow expects a task, so upload-then-score in Logs is the simplest way to reuse scorers without calling the model again. Include the `input`, `output`, `expected`, and any metadata your scorers need.

## Overview

Braintrust scorers expect `input`, `output`, `expected`, and per-case `metadata` for each row they evaluate. When outputs already exist (from a batch run, a third-party model, or a previous session), you can upload them as logs and score them without re-running the model.

The UI experiment flow normally runs a task that calls a model. It does not support a scorer-only pass over an uploaded dataset without a task function.

## Score pre-generated outputs

### Option 1: upload logs and run scorers from Logs (recommended)

1. Prepare rows with the fields your scorers expect: `input`, `output`, `expected` when applicable, and any metadata keys your scorers read. Add a batch marker like `metadata.sample_batch` to filter the rows later.
2. Use the Python SDK logger to upload the rows. Keep the format consistent with your scorers.

```python theme={null}
from braintrust import init_logger

logger = init_logger(project="your-project")  # Replace with your project name
samples = [
  {"input": "What is the capital of France?",
   "output": "Paris",
   "expected": "Paris",
  }
]
for s in samples:
  logger.log(
    input=s["input"],
    output=s["output"],
    expected=s.get("expected"),
    metadata={**s.get("metadata", {}), "sample_batch": "bedrock-validation-001"},
  )
logger.flush()
```

3. In the UI, go to [** Logs**](https://www.braintrust.dev/app/~/logs) and filter by `metadata.sample_batch = 'bedrock-validation-001'` or your chosen marker. Select rows and click  **Score**. Choose your existing scorers.
4. Review results in the Logs table. Teammates can repeat the same selection and scoring steps.

### Option 2: run an SDK evaluation that returns stored outputs

1. Create a dataset where each row includes the original `input`, any `expected` value, and the stored output in `metadata.run_output`.

2. Keep the original case input in `input`. `Eval()` passes that value to the task, so read the stored answer through `hooks.metadata`:

   Write a simple task that reads the dataset row and returns the stored `output` without calling the model. The task should return the value in the same field your scorers expect as the run `output`.

   ```python theme={null}
   data = [
       {
           "input": "What is the capital of France?",
           "expected": "Paris",
           "metadata": {"run_output": "Paris"},
       }
   ]

   def stored_output_task(input, hooks):
       return hooks.metadata["run_output"]
   ```

3. Attach your saved scorers to the evaluation and run it. The scorers will receive the returned `output`, plus `input`, `expected`, and `metadata` for each case.

4. To let teammates launch the evaluation from the UI, [serve and register it as a remote eval](https://docs.braintrust.dev/evaluate/remote-evals.md).

   Keep the remote eval server running while teammates use it.

## How to confirm it worked

* In Logs, the selected rows show score spans and numeric or categorical results from your scorers. The scores match your expectations on known examples.
* For SDK evaluations, open the experiment run and confirm the scorers appear in the run and that their outputs match expected values for test cases.

## Notes

* Include any `expected` values and per-case metadata your scorers rely on when you upload rows.
* Use a consistent `metadata` key such as `sample_batch` to find and select the uploaded rows quickly.
* Uploading logs does not re-run the model. The scorers evaluate the saved `output` values only.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.