ConceptsA/B Testing

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

  1. You configure a split on a prompt: e.g. 80% version A, 20% version B
  2. The SDK fetches a version transparently — each call gets routed to A or B based on the split
  3. Results logged via pd.log() are tagged with the variant
  4. 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:

  1. Click A/B Test in the version toolbar
  2. Select the two versions to compare
  3. Set the traffic split percentage (e.g. 80/20)
  4. Click Start test

The test runs until you stop it or declare a winner.


Metrics

You can measure:

MetricSource
LatencyLogged via pd.log()latencyMs field
Token usageLogged via pd.log()tokens field
Output scoreLogged via pd.log() — optional score field (0–1)
Error rateSDK-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:

  1. Open the A/B test view in the dashboard
  2. Click Promote to 100% on the winning variant
  3. 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

MIT 2026 © Nextra.