MLOps Infrastructure Development for Trading AI Models

A model shows profit in backtesting, but in live trading the result diverges from the calculation. We develop turnkey MLOps pipelines: model versioning, drift control, safe release, and rollback. The gap between the model and actual trade execution is reduced to a predictable level, and the team gets a manageable process instead of manual runs.

AI Development Areas

Frequently Asked Questions

Latest works

  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1365
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1330
  • B2B Advance company logo design
    B2B Advance company logo design
    776
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1077
  • AIDER company logo development
    AIDER company logo development
    1022
  • CRM development for Chasseurs
    CRM development for Chasseurs
    1113

Model diverges from backtest: where MLOps breaks in trading

A backtest is almost always smoother than live trading — the question is by how much.

The divergence is built in already during training: features are calculated from data that was not yet available at that time, the instrument universe is taken from the “survivors,” and execution costs are not included in the calculation. The model shows a beautiful curve where it simply had no chance to make a mistake.

In the live market, the regime itself changes, not just the data. Intraday liquidity declines, the latency between signal and execution grows, and a large order moves the price against us.

A model trained on a trending segment loses accuracy in a sideways market, and the reason is not the market, but the fact that deployment does not track regime changes.

Manual recalculation of parameters finishes the picture. Hyperparameters are tweaked before the evening session, features are rebuilt by a script on a local machine, weights are updated by copying a file, and a model version registry such as MLflow is never set up.

A week later, no one can reconstruct which model version and which feature set produced the signal for a specific trade — neither for post-mortem analysis nor for rollback.

“The most expensive thing here is not the loss on a single trade, but the inability to explain the result,” says our engineer who has brought such systems into production.

To make divergence from the backtest a manageable variable rather than a surprise, we examine exactly where MLOps breaks in trading and how it is closed.

What a managed lifecycle of a trading model provides

Model version control stops being a folder with files sorted by date.

Every artifact is linked to a code version, the composition of the training sample, the set of hyperparameters, and the environment — the log shows what a specific version was assembled from, and it can be brought up again on another node. This is the foundation on which the other effects rest.

Training reproducibility moves discrepancies between runs out of the realm of mysteries. If a model shows different metrics during validation than during training, the cause is sought in three known places: data, environment, and the order in which examples are fed.

A repeated run produces the same result, and disputed experiments do not have to be redone from scratch.

Time to model release is reduced through a predictable path: a new version passes the same quality gates as the previous one, and deployment into the trading loop follows a proven procedure rather than a one-off manual operation. Routine releases stop being an event and take minutes instead of days.

Reduction in trading failures is a consequence of direct compatibility checks: a mismatch in the feature set between training and live operation, drift of input distributions, and version mismatch are caught at the input, not at the moment an order is placed.

Incident analysis follows the decision log — you can see which version fired, on what data, and why the filter passed or rejected the signal.

An assembled MLOps loop makes the model lifecycle verifiable: any version can be rebuilt, compared with a neighboring one, and rolled back without rewriting the trading logic.

MLOps loop operating modes in trading: comparison of options

MLOps loop modes differ in where data is stored, where the model is computed, and who is responsible for releasing a new version into operation.

A full cycle on the contractor's side starts faster, deployment in the customer's environment removes questions about the data perimeter, a hybrid loop balances both requirements, and automated release is needed where the model shifts noticeably between recalculations.

Option When it fits Limitations
Full cycle on our side No in-house team or capacity, a fast path to production signals is needed, and data may be transferred Data transfer over an external channel, sensitive data cannot be moved outside, incident response time is split between the parties
Deployment in your environment Data does not leave the perimeter, security requirements exist, and low signal latency matters Your own compute resources and on-call shift are required, updates go through approval, part of operations remains with your team
Hybrid loop Training and experiments are more convenient on our side, signal calculation on yours, and features can be anonymized Synchronization of feature and model versions is required, and reproducibility of the result is harder to confirm
Automated release with drift control Models are retrained regularly, data arrives as a stream, and a predictable update cycle is needed Quality metrics on production data and automatic rollback are required, drift thresholds are calibrated for a specific market

The choice is rarely binary. Batch recalculation covers daily training and feature rebuilding, while stream recalculation is enabled selectively — where signal latency genuinely affects the result.

In practice, the working configuration for most tasks is a hybrid loop with automated release and drift control.

Loop implementation stages: data audit, architecture, setup, handover

Before deploying the loop, we reconstruct the actual picture: where quotes come from, how features are calculated, and where the history of order execution is lost.

Without this, monitoring turns into watching random metrics, and the divergence between historical validation and the live stream surfaces on real positions.

  1. Data and trading log audit — we reconcile quote sources, history depth, and completeness of execution records, looking for gaps and discrepancies between venue logs and internal accounting.
  2. Loop design — we establish where data, features, models, and signals live, how training and execution are separated, and which failures are considered acceptable.
  3. Model and feature versioning — every trading model is tied to a data set and parameters, and rollback to the previous version happens without rebuilding the entire loop.
  4. Monitoring setup — signal quality, calculation latency, share of rejected orders, and feature distribution drift; alerts are tied to thresholds, not to the fact that a process has crashed.
  5. Historical validation — a run on accumulated data: we compare model behavior against the reference, checking resilience to market regime changes and gaps in the stream.
  6. Live stream validation — shadow mode: the model calculates signals but does not send orders; we compare it with production logic and see how monitoring behaves under load.
  7. Loop handover — design documentation, retraining and rollback procedures, incident review with your team, and the process for further support.

Handover artifacts: configurations, procedures, access schemes

A project is considered delivered not when the model has shown a metric on historical data, but when the loop lives without its authors. Therefore, at the end of the work we hand over a package of artifacts that another team can use to operate and evolve the system. What the customer is left with:

  • Model and version registry — training period, feature set, metrics on a holdout set, and the status of each version: in the loop, in reserve, or retired.
  • Loop configurations — feature calculation parameters, retraining schedules, protection thresholds, and limits; deployed from the repository without manual edits.
  • Access policies — roles by environment: who releases the model, who changes limits, who only reads logs.
  • Release and rollback procedure — mandatory checks before publication, stop criteria, and the process for returning to the previous version in minutes.
  • Audit logs — who, when, and on what basis changed the model, data, or constraints; export for internal control.
  • Loop documentation — data flow design, external dependencies, failure points, and owners for each node.
  • On-call shift instructions — what to do when metrics diverge from expectations, how to stop trading, and whom to notify.

The package is synchronized with the working loop: a change in the repository is reflected in the documentation, so six months later knowledge does not have to be pieced together from chat history.

Case study: divergence between the model and actual trade execution

Before implementation, one version of the model calculated signals, while orders were sent based on an artifact exported before the latest retraining.

The versions diverged by several days, and this surfaced only in an open position: there is an exit signal, but the trade is not closed.

The signal log was reconciled with the execution log manually — analyzing a single trading day took 3-4 hours and barely covered night sessions.

What was changed in the MLOps loop

The model loop was built around the MLflow version registry: each build receives an immutable number, and the same number goes into the signal and the order — divergence is caught at the input, not in the position.

Control was moved to session reproduction: a historical data slice and actual trades are compared automatically, and differences are tagged with the model version and parameter set.

Rollback is a pointer switch in the registry, without rebuilding or manually editing configurations on the execution server.

Metrics before and after

  • Share of signals without a paired trade: 4-6% → 0.2%
  • Trading day analysis: 3-4 hours manually → 10-15 minutes from a ready report
  • Rollback to the previous model version: about a day → minutes
  • Reconciliation coverage: day session only → all sessions, including night sessions

Incident analysis no longer depends on who was on shift. The divergence is reproduced on the same data and the same model version — instead of looking for a team member to blame, the team gets the specific step where the signal and trade execution diverged.

How does shadow model release differ from canary release?

The difference is where the model's response goes. In shadow release, a copy of production traffic goes to the new version, but its signals are not sent anywhere: calculation runs in parallel, and we compare the predictions of the two versions on the same data stream.

In canary release, a portion of live traffic — first 1%, then 5, 25, and 100 — is served by the new version, and its decisions already affect the portfolio.

We bring up shadow mode by mirroring traffic, for example via Istio, and it answers the question “does the model calculate just as correctly?”: whether signal distributions converge, how inference latency has changed, and how many failures occur on rare instruments.

The limitation is honest — a shadow run does not test the link to execution: orders, risk limits, handling of partial fills, and repeated orders.

Canary release tests exactly that, so it comes second. We tie the gradual enablement of the version to metrics: drawdown relative to the reference version, share of rejected orders, and divergence of predictions from the actual outcome.

Automatic rollback triggers by threshold, not by a call from the on-call engineer — otherwise the version stays in production while someone looks at charts.

Typical mistakes when comparing release modes: enabling the canary immediately, bypassing the shadow stage; comparing versions on different market windows — in calm and volatile regimes these are different distributions; not fixing the reference version, which makes it unclear what exactly got worse.

A separate trap is a feature set shared by the two versions: it was recalculated for the new model, and rollback no longer restores the previous behavior.

In practice, the order is: a shadow run over several trading sessions, then a canary with stepwise traffic share and automatic rollback. Both stages run on the same data preparation pipeline — otherwise version divergence cannot be separated from divergence in the data itself.

Technical concerns: data drift, latency, access, rollback

Before starting, teams check four things: what will happen to the model when the market regime changes, how long the path from signal to order takes, how to roll back a version, and who can intervene in the system.

How do you track data drift?

We compare the distribution of input features and forecast quality on a rolling window against the reference profile of the training sample. A discrepancy above the threshold triggers retraining and an alert, not silent degradation. The profile, window, and threshold are stored in configuration — the rule is reproducible.

How do you keep model application latency under control?

Base feature calculations run in advance, and at decision time only lightweight forecast calculation remains.

We measure latency by percentiles, not by average, and maintain a budget across the entire “data — signal — order” chain: a lagging quote source marks the signal as stale, and it does not go to market.

How do you roll back a model version?

The model, feature schemas, and configuration are versioned as a single set. Rollback is a return to the previous artifact set with a single command, without rebuilding; a shadow run on history confirms correctness. Retention depth is designed for rolling back several steps.

How are access and audit set up?

Rights are divided by role: a developer does not release a model to production alone, and launch requires confirmation. Training, deployment, and manual parameter edits go into an immutable log with author and timestamp.

Let's discuss a loop for your trading process and team

The estimate for an MLOps project for a trading loop depends not on the number of models, but on how the signal travels from calculation to order and where manual steps remain along that path.

That is why we start the discussion of the task with an analysis of current execution, not with a presentation. To come back with a clear estimate, it helps to have on hand:

  • a list of strategies: which models are running, what data they are trained on, and how often they are retrained;
  • the current signal path from calculation to order placement — with bottlenecks and manual actions;
  • data sources: quotes, news and alternative streams, their volume and update frequency;
  • latency requirements and acceptable downtime during trading hours;
  • risk policy: limits, auto-stops, who has the right to stop the loop;
  • infrastructure: in-house capacity or cloud, environment isolation, access provisioning process, and who accepts the result.

In response, we send a loop map: data collection and preparation, model training and validation, deployment into the trading loop, monitoring, and rollback to the previous version.

Along with it — a phased implementation plan: what we do first, which artifacts we hand over at each acceptance point, and which dependencies remain on the customer's side. The plan comes as a document with stages, timelines, responsibility areas, and a list of risks.

The first step is a 45–60 minute technical session with the engineer who will lead the project: we analyze the data flow and risk policy, and agree on readiness criteria. Describe the task in any form — we will come back with an estimate and a work plan.