MULTI-ARMED BANDIT API

Multi-armed bandits, as a service

Search for a multi-armed bandit and you will find papers, libraries, and bandits buried as a checkbox inside somebody’s experimentation suite. What you probably wanted was an endpoint you can call. That is what qbrix is: two calls — select and feedback — and the learning loop runs on our side.

THE TWO CALLS

The whole integration

Ask which variant to show, then say what happened. That is the entire runtime surface — everything else is setup you do once. The request_id you get back from a selection is what ties the two calls together: hand it to feedback whenever the outcome lands — a second later, or the next morning.

select.sh
1# 1. select — which variant should this user see?
2curl -X POST https://cloud.qbrix.io/api/v1/agent/select \
3 -H "X-API-Key: $QBRIX_API_KEY" \
4 -H "Content-Type: application/json" \
5 -d '{"experiment_id": "exp_a1b2", "context": {"id": "user-001"}}'
6
7# 200 {"arm": {"id": "arm_7c", "name": "gradient-bold", "index": 1},
8# "request_id": "req-abc123", "is_default": false}
9
10# 2. feedback — what happened?
11curl -X POST https://cloud.qbrix.io/api/v1/agent/feedback \
12 -H "X-API-Key: $QBRIX_API_KEY" \
13 -H "Content-Type: application/json" \
14 -d '{"request_id": "req-abc123", "reward": 1.0}'
15
16# 201 {"accepted": true}

Reward is just a number. Send 1.0 and 0.0 for a conversion, or an order value, or a dwell time — whatever you are actually trying to maximize.

LIBRARY VS SERVICE

A library is not a service

The bandit libraries are good. MABWiser is genuinely well built, and Vowpal Wabbit is a serious piece of engineering. But read how MABWiser describes itself — “a research library… for rapid prototyping” — and it is telling you exactly what it is. Prototyping is not the hard part.

The hard part starts after the algorithm works on your laptop. Where do the parameters live once two servers are serving traffic? Who retrains, and how often? What happens on deploy — does the thing forget everything it learned? How do you keep any of it off the request path? None of that is bandit research. It is distributed systems work, and it is where the months go.

A bandit libraryqbrix
The algorithmYou get it — this is what a library is forSame algorithms, already running
Where parameters liveYou choose, deploy and operate a storeManaged — cached on the selection path
Consistency across replicasYours to solve once more than one process serves trafficHandled — one training path, many stateless readers
The training loopYou build the queue, the batching and the workerRuns continuously off your feedback
Latency of a decisionDepends what you put on the request pathZero database calls — in-memory on a dedicated hot path
Restarts and deploysCold start unless you persist state yourselfState outlives any single process
Scaling outRe-architect once one box is not enoughSelection scales horizontally by design
Time to first decisionWeeks to monthsTwo API calls

If bandits are your research — you are tuning the algorithm itself, or publishing — take the library. It is the right tool and you should not pay anyone for an endpoint. This page is for the other case: you want the behavior in production next week, and the algorithm is a means, not the project.

WHAT YOU DON’T RUN

Selection never waits for learning

The reason a bandit is hard to productionize is that it wants to do two things at once: answer instantly, and keep learning. Those pull in opposite directions, so qbrix splits them. Selection and training are separate services that never block each other.

On the serving side there are zero database calls during a selection. The policy runs in-process against an in-memory cache — no locks, no I/O on the critical path once caches are warm — and that path scales horizontally, so more traffic means more replicas rather than a rewrite. Your feedback goes onto a stream instead, where a single training service consumes it in batches and writes updated parameters back for the selection path to pick up. Nothing on your request waits for any of it.

Read the architecture deep-dive — theory, trade-offs, and what it costs
DOES IT ACTUALLY WORK

We benchmarked it against a fixed split

A managed service is only worth the call if it beats what you would have done anyway. So we ran qbrix’s default auto policy against a textbook fixed-split A/B test — twenty runs each, through the full distributed stack, network hops and cache staleness included, on a deliberately hard problem: a 20% relative lift buried under 90% noise.

+5.2%more conversions than the A/B test, per run
−34%less regret — traffic wasted on weaker variants
No overlap95% CIs are disjoint: [1,502–1,543] vs [1,432–1,463]

Worth being straight about the trade: the A/B test found the single best variant 100% of the time, and qbrix found it 95% of the time. A bandit buys you more conversions during the learning, not a cleaner verdict at the end. If a defensible causal readout is the deliverable, run the A/B test. If the traffic you spend while deciding is real money, that is the gap this measures.

Read the full benchmark — methodology and the dollar-scaling math
THE SDKS ARE OPEN SOURCE

Read the code you run

The clients are MIT-licensed and on GitHub. The service itself is managed cloud — you cannot self-host it, and we would rather say so plainly than let you find out later — but nothing about the code sitting inside your application is a black box.

Two calls away

Free to start, no card. Define your variants, send a reward signal, and qbrix steers the traffic — no infrastructure to operate.

FAQ

Frequently asked questions

What qbrix is, when to use it, how fast it is, and how to connect it to your app.

It is a hosted service that makes the explore-exploit decision for you over HTTP. You call select to ask which variant a given user should see, and call feedback to report what happened. The service keeps the reward estimates for every variant, updates them as feedback arrives, and shifts traffic toward whatever is working. You never implement the algorithm, store its parameters, or run the training loop.

A library gives you the algorithm; a service gives you the running system. With a library you still have to decide where the parameters live, keep them consistent across every process that serves traffic, retrain as feedback arrives, survive restarts and deploys, and keep it all off your request path. That is the part that takes months. qbrix is the algorithm plus the system around it — the library question never comes up. See how qbrix works

Stochastic policies including Thompson sampling variants, UCB variants, epsilon-greedy and MOSS; contextual policies including LinUCB, LinTS, GLM-UCB and logistic Thompson sampling; and adversarial policies including EXP3, EXP3-IX and FPL. There is also auto, a meta-bandit that picks and tunes the policy for you, so you do not need to choose up front. Browse the policies

Only if you use a contextual policy. Every select call carries a context object with a stable id — a user or session identifier. Contextual policies such as LinUCB and LinTS also read a feature vector from that context, and its length has to match the experiment's configured dimension. Non-contextual policies ignore it. Read about contexts

Yes. Pools, experiments, and feature gates all have full REST endpoints, and the Python SDK wraps every one of them. The JavaScript/TypeScript SDK is deliberately narrower — it is a small isomorphic client for the runtime hot path, select and feedback, so define your experiments with the Python SDK, curl, or the console. See the API reference

Feedback is processed asynchronously rather than on your request. It is consumed off a stream and trained in batches, so updated parameters reach the selection path within seconds, depending on batch settings. Your feedback call returns as soon as the event is accepted — it never blocks on training.

No. qbrix is a managed cloud service — that is the point of the product, and it is why there is no infrastructure for you to operate. The Python and JavaScript/TypeScript SDKs are open source under the MIT license, so the client code you run is fully inspectable. See pricing

Still have questions?