Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 24 additions & 57 deletions src/langsmith/custom-output-rendering.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,25 @@ title: Custom output rendering
sidebarTitle: Custom output rendering
---

This page describes how to use custom output rendering to visualize outputs from [_experiments_](/langsmith/evaluation-concepts#experiment) using your own custom HTML pages.

You'll learn how to:

- **[Configure custom rendering](#configure-custom-output-rendering)** in the LangSmith UI or via the API.
- **[Build a custom renderer](#build-a-custom-renderer)** to display output data.
- **[Understand where custom rendering appears](#where-custom-rendering-appears)** in LangSmith.

## Overview

By default, LangSmith displays outputs in a standard JSON format. With custom output rendering, you can replace this default view with your own HTML page that receives the output data via the postMessage API and renders it however you choose.

This is particularly useful for:
Custom output rendering allows you to visualize run outputs and dataset reference outputs using your own custom HTML pages. This is particularly useful for:

- **Domain-specific formatting**: Display medical records, legal documents, or other specialized data types in their native format.
- **Custom visualizations**: Create charts, graphs, or diagrams from numeric or structured output data.

Custom rendering is configured per-[_dataset_](/langsmith/evaluation-concepts#datasets).

## Prerequisites
In this page you'll learn how to:

<Check>
- A LangSmith dataset
- A web page that can receive postMessage events (can be hosted anywhere or run locally)
- Basic knowledge of HTML/JavaScript and the postMessage API
</Check>
- **[Configure custom rendering](#configure-custom-output-rendering)** in the LangSmith UI.
- **[Build a custom renderer](#build-a-custom-renderer)** to display output data.
- **[Understand where custom rendering appears](#where-custom-rendering-appears)** in LangSmith.

## Configure custom output rendering

### In the LangSmith UI
Configure custom rendering at two levels:

- **For datasets**: Apply custom rendering to all runs associated with that dataset, wherever they appear—in experiments, run detail panes, or annotation queues.
- **For annotation queues**: Apply custom rendering to all runs within a specific annotation queue, regardless of which dataset they come from. This takes precedence over dataset-level configuration.
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The precedence note appears twice (here and in the Info box at line 52-54). Consider removing the precedence mention from line 22 to avoid redundancy, keeping only the more prominent Info callout.

Suggested change
- **For annotation queues**: Apply custom rendering to all runs within a specific annotation queue, regardless of which dataset they come from. This takes precedence over dataset-level configuration.
- **For annotation queues**: Apply custom rendering to all runs within a specific annotation queue, regardless of which dataset they come from.

Copilot uses AI. Check for mistakes.

### For datasets

To configure custom output rendering for a dataset:

Expand All @@ -47,44 +36,22 @@ To configure custom output rendering for a dataset:

![Custom Output Rendering modal with fields filled in](/langsmith/images/custom-output-rendering-modal.png)

### Via the API
### For annotation queues

You can also configure custom rendering programmatically by updating the dataset metadata:
To configure custom output rendering for an annotation queue:

<CodeGroup>
```python Python
from langsmith import Client
![Annotation queue settings showing custom output rendering configuration](/langsmith/images/annotation-queue-custom-output-rendering-settings.png)

client = Client()

# Update dataset metadata with iframe config
client.update_dataset(
dataset_id="your-dataset-id",
metadata={
"iframe_config": {
"enabled": True,
"url": "https://your-domain.com/output-renderer.html"
}
}
)
```

```typescript TypeScript
import { Client } from "langsmith";

const client = new Client();
1. Navigate to the **Annotation Queues** page.
2. Click on an existing annotation queue or create a new one.
3. In the annotation queue settings pane, scroll to the **Custom Output Rendering** section.
4. Toggle **Enable custom output rendering**.
5. Enter the webpage URL in the **URL** field.
6. Click **Save** or **Create**.

// Update dataset metadata with iframe config
await client.updateDataset("your-dataset-id", {
metadata: {
iframe_config: {
enabled: true,
url: "https://your-domain.com/output-renderer.html"
}
}
});
```
</CodeGroup>
<Info>
When custom rendering is configured at both levels, annotation queue configuration takes precedence over dataset configuration for runs viewed within that queue.
</Info>

## Build a custom renderer

Expand Down Expand Up @@ -163,6 +130,6 @@ When enabled, your custom rendering will replace the default output view in:

![Run detail pane showing custom rendering](/langsmith/images/custom-output-rendering-run-details.png)

- **Annotation queues**: When experiments are added to annotation queues for review:
- **Annotation queues**: When reviewing runs in annotation queues:
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider using a more specific verb. 'When reviewing runs' could be 'When you review runs' to maintain consistency with the second-person voice per the style guide.

Suggested change
- **Annotation queues**: When reviewing runs in annotation queues:
- **Annotation queues**: When you review runs in annotation queues:

Copilot uses AI. Check for mistakes.

![Annotation queue showing custom rendering](/langsmith/images/custom-output-rendering-annotation-queue.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.