A/B Testing
A/B testing in VersionR lets you split SDK traffic between two prompt versions and track which one performs better — without changing your application code.
⚠️
A/B testing is a v1.5 feature and is not yet available. This page describes the planned design.
How it works
- You configure a split on a prompt: e.g. 80% version A, 20% version B
- The SDK fetches a version transparently — each call gets routed to A or B based on the split
- Results logged via
pd.log()are tagged with the variant - The dashboard shows performance metrics per variant side-by-side
Your application code doesn’t change. The pd.get() and pd.render() calls look identical — the routing is handled server-side.
Setting up a split
From the prompt detail page:
- Click A/B Test in the version toolbar
- Select the two versions to compare
- Set the traffic split percentage (e.g. 80/20)
- Click Start test
The test runs until you stop it or declare a winner.
Metrics
You can measure:
| Metric | Source |
|---|---|
| Latency | Logged via pd.log() — latencyMs field |
| Token usage | Logged via pd.log() — tokens field |
| Output score | Logged via pd.log() — optional score field (0–1) |
| Error rate | SDK-level errors logged automatically |
The score field gives you flexibility — populate it from user ratings, downstream model evaluation, or any signal that matters for your use case.
Declaring a winner
When you’re satisfied with the result:
- Open the A/B test view in the dashboard
- Click Promote to 100% on the winning variant
- The losing variant is archived
Traffic immediately shifts to 100% of the winning version. No code change required.
Design principles
- The SDK is unaware of A/B testing — routing is entirely server-side
- No SDK update is needed when starting or stopping a test
- Both variants use the same slug — your code never needs a branch
- A test can be paused and resumed without losing accumulated data