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

# Replay Testing

> Test changes against real production data

Test prompt changes against real production traces before deployment.

***

## Workflow

**1. Capture baseline:**

```typescript theme={null}
await lumina.createReplaySet({
  name: 'Pre-prompt-change',
  filters: {
    service: 'chat-api',
    timeRange: '24h',
    sampleSize: 100,
  },
});
```

**2. Make changes:**
Update your prompts or code.

**3. Replay:**

```typescript theme={null}
await lumina.replayTraces({
  replaySetId: 'replay_001',
});
```

**4. Compare:**
View side-by-side diffs with semantic scoring.

***

## Use Cases

* Prompt engineering
* Model changes
* Infrastructure testing
* A/B testing

***

## Cost Considerations

Replay makes real LLM API calls:

```
100 traces × $0.01 per call = $1.00
```

Use simulation mode for testing without costs:

```typescript theme={null}
await lumina.replayTraces({
  replaySetId: 'replay_001',
  mode: 'simulation',
});
```
