Advertising technology

An AI forecasting pipeline that never makes up a number

A hybrid forecasting system producing 30-day impression, CPM, reach and strategy-split forecasts for 13 ad products. Deterministic engines compute every figure; a self-hosted LLM handles classification and narrative.

Client
Ad-tech platform (confidential)
Timeline
2024 – present
Ad products forecast
13
DI pipelines in .NET 10
4
Impression, CPM & reach forecasts
30-day
The challenge

The platform’s LLM-based prototype produced plausible-looking forecasts, but the model was getting numbers wrong. Sales teams needed forecasts they could put in front of advertisers.

The problem

The first version of the forecasting tool asked a large language model to do everything: read the campaign brief, pick inventory, and calculate impressions, CPMs and reach. The output read well. The numbers, however, were not always right, and there was no way to know which ones.

Our approach: keep the math deterministic

We redesigned the system around one rule: the model never computes a number.

  • Deterministic engines now calculate every figure: the inventory waterfall, data-CPM tiering and strategy allocation across display, video, native, CTV, audio, social and more.
  • The LLM only classifies and writes. It maps free-text briefs to categories and explains the forecast in plain language.
  • Guardrails sit between the two: JSON schema validation with retries, post-processing overrides and invariant spot-checks that reject any output that doesn't add up.

Self-hosted models

The models run on the client's own hardware using llama.cpp on CUDA GPUs in Docker, behind an OpenAI-compatible API. We started with a quantized DeepSeek-R1-Distill-Qwen-32B and later moved to Qwen3.5-35B-A3B on an RTX 5090. The client layer handles JSON mode, retries with temperature adjustment and multi-endpoint failover.

From prototype to production service

We ported the Python/Flask prototype (a ~9K-line orchestrator) to a .NET 10 worker service with four dependency-injected pipelines: DSP, Performance Max, Geo-Framing and Meta. Product rules and thresholds moved into configuration (Redis and the database), and fragile text detection was replaced with ID-based lookups passed end to end.

Real data or no forecast

  • Geo-resolution on the US Census Bureau API (ZIP, county, city, state, DMA and radius), with the LLM normalizing free-text locations first.
  • Meta Marketing API delivery estimates, with LLM-suggested categories verified against Meta's own data.
  • When real data is missing, the job fails loudly instead of guessing.

The result

Forecasts the sales team can defend: every number traceable to deterministic code, every narrative checked before it ships.

Have a similar project?

Tell us about your operation, the systems you use, and the challenges you want to solve. Softlaunchers can help you evaluate a practical approach to software development, workflow automation, and integrations for your logistics business.