Levered Docs
Getting Started

Create Your First Optimization

Define design factors, choose a model type, and link a reward metric to create a live optimization.

An optimization is the core unit in Levered. It defines what you are testing (design factors and their levels), how you measure success (a reward metric), and what model allocates traffic (MAB or CMAB).

Key concepts

  • Design factor -- A variable you want to optimize. Examples: headline, cta_text, hero_image.
  • Level -- A possible value for a design factor. Example: the headline factor might have levels "Ship faster", "Save time", and "Build better".
  • Variant -- A specific combination of levels across all design factors. With 3 headlines and 2 CTA texts, you have 6 variants.

Levered explores these variants automatically and shifts traffic toward the ones that produce the most reward.

Model types

ModelBest forHow it works
MAB (Multi-Armed Bandit)Simple optimizations, small variant spacesTreats each variant independently. Learns which variant wins overall.
CMAB (Contextual Multi-Armed Bandit)Personalization, larger variant spacesUses context factors (device, location, user segment) to learn which variant works best for each type of user.

Start with MAB if you are new to Levered. Switch to CMAB when you want to personalize variant selection based on user attributes.

Create an optimization

Optimizations are created with the Levered CLI or the Levered plugin for Claude Code — not from the dashboard. (The dashboard's create form exists only in non-production for Levered staff; customers create via the CLI or a coding agent.)

With the Levered plugin installed, describe what you want to test — Claude builds the factor JSON, picks the model, and runs the CLI for you:

Prompt for Claude Code

Using Levered, create an optimization for my landing page hero — test the headline (Ship faster, Save time, Build better) and the CTA text (Start free, Try it now), optimizing for my "Signup Conversion" metric.

levered optimizations create \
  --name "Landing Page Hero" \
  --design-factors '[
    {"name": "headline", "levels": ["Ship faster", "Save time", "Build better"]},
    {"name": "cta_text", "levels": ["Start free", "Try it now"]}
  ]' \
  --reward-metric-id <metric-uuid> \
  --model-type mab
  • --reward-metric-id -- the metric you created in the previous step (run levered metrics list for the id).
  • --model-type -- mab to start, or cmab for personalization (add --context-factors).

The optimization is live immediately. Once you integrate the SDK and start logging exposures and rewards, Levered begins training on the next scheduled cycle.

What happens after creation

Once the optimization is live:

  1. You integrate the SDK (next step) to request variants and log exposures.
  2. Users see variants based on the bandit's current allocation.
  3. Exposure and reward events land in your warehouse.
  4. Levered trains on a recurring schedule, reads new data from your warehouse, and updates the model.
  5. Traffic shifts toward variants with higher reward rates.

There is no manual "launch" or "stop" step. The optimization starts learning as soon as data flows.

Next step

Your optimization is created. Now integrate the SDK to start serving variants and logging exposures.