Skip to main content

MMM Optimizer: Headless

What is the headless optimizer?​

The headless optimizer runs an optimization on a saved scenario against a pinned, approved model fit, with no interactive session. Nobody has to sit in the optimizer screen while it works:

  • you start it from a saved scenario, an agent, or the API;
  • it returns immediately with a run identifier;
  • the solve runs as a background job;
  • you collect the same outputs (tables, weekly plan, summary, report) when it completes.

It is the same solver and the same outputs as the interactive experience, so a headless result means exactly what an interactive one does. Headless is a way of running, not a different model.

It never refits the model. It reallocates budget from a fit that has already been approved, which is why it can run repeatedly and quickly.


How it is started​

SurfaceHow it starts a headless run
Media WorkspaceRun the optimizer on a saved project scenario; it uses the project's primary model
Agent BuilderAn optimization agent submits the request and collects the result
Chat assistantThe assistant runs the optimization as a long-running step and resumes with the result
APIA request with the datasource, objective and constraints

Single-brand and cross-brand runs both work this way. Cross-brand runs carry one pinned fit per brand.


Lifecycle​

Headless optimizer lifecycle

  1. Request. A scenario, agent or API call supplies the objective, budget change and constraints.
  2. Resolve the fit. The run targets one approved fit. In Media Workspace that is the project's primary fit, and in a cross-brand run it is the pinned fit for each brand, rather than simply the newest one.
  3. Run guards. The run is refused if a guard fails (see below).
  4. Load vehicle curves and spend. Current spend comes from the model baseline, or from the supplied merged file or override.
  5. Build the scenario. The same mapping as the interactive path: total budget, guardrails, group or brand bands, locks.
  6. Solve and validate. SLSQP, the stall safeguard, and the five validation gates. The convergence trace, the per-vehicle curve parameters, and the average ROI before and after are logged.
  7. Build deliverables. The detailed media analysis, the weekly plan, the summary and the report.
  8. Register outputs. The files are stored and linked to the run.
  9. Status and results. The run moves from pending to completed or failed, and the outputs can be read.

Guarantees​

GuaranteeWhat it means
Fails loudlyIf no fitted model exists, or the model has no response curves, the run stops with a clear message. The optimizer never invents curves from raw data.
Pinned where a fit is chosenA Media Workspace scenario runs against the project's primary fit, and a cross-brand run against each brand's pinned fit. A newer fit appearing later never silently replaces it.
DeterministicThere is no sampling. The same fit, request and data produce the same allocation.
Nothing silentRequests that had to be clamped, locks that were applied, assumptions used, and solver status are all written to the summary.
Best-effort reportIf the PDF cannot be rendered, the tables, the weekly plan and the summary are still delivered.

Run guards​

A headless run is refused, with a clear message, when:

GuardWhy
No primary model is set for the projectThere is no approved fit to optimize against
The primary model has no channel response dataThe optimizer would otherwise fall back to a different model, so it refuses instead. A smoke run, or a model with a vehicle that failed the conversion gates, has no registered response curves, so it is refused here
The scenario does not belong to the project, or you cannot see itOnly the author, or a shared reader, may run a scenario
The scenario is already runningA second run would overwrite the first run's result

Scenarios and staleness​

A scenario stores the objective, budget change and constraints. In a project, it runs against the project's primary fit. If the primary model is later changed, a scenario whose last result came from a different fit is marked stale, so you can see that its numbers no longer reflect the current primary model, and re-run it deliberately.

Repeated runs of an unchanged scenario against an unchanged fit give identical numbers. A newer fit never replaces a pinned one automatically.


Outputs​

The outputs are the same as the interactive path:

OutputContent
Detailed media analysisPortfolio, group or brand, and vehicle rows with current vs optimized spend, volume, revenue, profit, ROI and cost per unit
Weekly flighting planEach vehicle's annual optimum phased by its own history and attribution
Optimization summarySolver status, validation gates, adjustments, macro assumptions used, model used, target year
Report (PDF)Business-readable summary and weekly budget charts

Scenario comparisons surface the ROI change of the All Media row, not the profit change: a spend-cutting scenario can show a profit drop while still improving ROI, so per-dollar efficiency is the fairer comparison.


Typical use cases​

Use caseHow headless helps
Compare scenariosRun several saved scenarios against the same primary fit and compare their ROI change
Repeatable planning cyclesRe-run a saved scenario after the fit is re-approved, and see that it is flagged stale until you do
Agent-driven planningLet an agent run the optimization and write the result into a report
Portfolio planningRun a cross-brand scenario with one pinned fit per brand

When a run does not complete​

SymptomLikely causeWhat to do
Refused at startA run guard failedRead the message; it names the missing model, the permission, or the running scenario
Stops with an infeasible-budget errorLocks and limits leave no room for the budgetReduce a pinned vehicle's change, unlock a vehicle, or change the budget
Completes but a validation gate failsSolver or constraint issue in the solutionRead the summary; do not use the allocation until it passes
Completes with adjustmentsSome requests were clampedRead the adjustments for the requested and applied values
No PDFThe report render failedUse the tables and summary; they are delivered regardless

For the formulas behind the solve, see mmm-optimizer-methodology.