Open source · Apache-2.0 · Pre-1.0
A/B testing and feature flags you run yourself.
Controlvar is an open-source experimentation platform for engineering teams that run their experiments and feature flags on their own infrastructure.
The demo is read-only, with simulated traffic, and is rebuilt every night.

Specific to Controlvar
Apache-2.0, SDKs MIT
The core and full builds are both free and have the same licence. Read the LICENSE.
Flags that roll themselves back
Each active flag's error rate and latency are checked against your thresholds every 5 minutes by default, with an automatic rollback on a breach when you turn that on.
Corrected for several variants
Frequentist results are judged at the experiment's confidence level, with Benjamini-Hochberg (the default) or Bonferroni correction across its variants.
Sequential testing
Beta: mSPRT with always-valid confidence intervals, so you can read results at any time.
Compose, Helm or AWS CDK
Docker Compose: one host, on the published images.
Kubernetes: a Helm chart, which CI installs on a kind cluster.
AWS CDK: stacks that provision the API, the dashboard and their data stores in your AWS account.
Tested statistics
Tests check the analysis against known answers: the false-positive rate of A/A tests, interval coverage and a planted lift.
What Controlvar does not do is in Limitations; its main capabilities are in What Controlvar does today.
How it works
Run it
Clone the repository and start it from the root. It runs four containers: Postgres, Redis, the API and the dashboard. The first start builds the images, creates the database and applies the demo seed.
Then open localhost:3000. The quick start has the default credentials and what to change before anyone else can reach it.
git clone https://github.com/Controlvar/ controlvar.git cd controlvar docker compose up -d --wait Or install on AWS with one command, a beta that installs the core profile in us-west-2; as of v0.37.0 it has been run end to end once, in a test account, and it is not for production data.
Add the SDK
Sticky experiment assignment, then a conversion tracked for that experiment. The JavaScript and Python SDKs are on npm and PyPI as betas.
// npm install @controlvar/js-sdk
const assignment = await client.getAssignment('checkout_button_color', user); await client.track( 'user-123', 'purchase', { value: 49.99, experimentKey: 'checkout_button_color' }); Read the result
The change on each metric with its p-value, whether the planned sample is reached, and a sample ratio check of the traffic split.
The Controlvar books
Engineering and programming books that use Controlvar's own code for their examples. They are for newcomers to a language or framework, engineers who already code, and contributors. The licence is CC BY 4.0.
Learn Python in 24 Hours
Python from absolute zero to the modern, typed Python the backend is written in.
Learn FastAPI in 24 Hours
The backend framework layer: FastAPI, Pydantic v2, SQLAlchemy 2, Alembic and the background schedulers.
Learn TypeScript, React & Next.js in 24 Hours
TypeScript, React and Next.js through the real dashboard.
Build an Experimentation Platform in 28 Days
The whole architecture end to end; after this capstone you can read and extend the codebase.
Roll features out gradually, with automatic rollback
Sticky assignment, and gradual rollouts with configurable stages.
- Error rate and latency checked against your thresholds, and an automatic rollback on a breach when you turn that on
- Targeting with 20+ operators: semantic version comparison, geo-distance, time windows and array operations
- Switch a flag on and off, and find each change in the audit log
- Local evaluation (beta): the JavaScript and Python SDKs answer flags in a server process from a downloaded ruleset, checked against cases generated by running the server's own evaluator.

Plan tests and analyse results
Work out a test's sample size in the power calculator, which needs no account.
- Frequentist and Bayesian analysis
- Sequential testing (beta): mSPRT with always-valid confidence intervals
- Multi-armed bandits
- Per-segment breakdowns with a Bonferroni correction across segments
- Mutual exclusion groups and a global holdout, whose results are beta
Revenue, count, duration and custom metrics are analysed as their mean per assigned user, compared with a permutation test of Welch's t and judged at the experiment's confidence level, and their results give the difference per user with its confidence interval.
Invite teammates, each with a role
Admins and developers change experiments and flags; analysts and viewers read them.
- An audit log you can filter by action, entity and date
- It downloads as CSV or JSON (the download is beta)

SDKs for web, mobile and server
All MIT-licensed. By default, flag evaluation and experiment assignment happen on the server.
Walkthroughs
Open source
The whole platform is Apache-2.0 and the SDKs are MIT. The test suites, the automated checks and the release pipeline are all in the repository.


