Cloud

Cloud & Deployment

Kubernetes, secure data integration, active learning, and the apps that put a model in front of the people who need it and feed what they see back into the next version.

A model that only runs on the laptop it was trained on is a result, not a system. The work that turns one into the other is unglamorous, and it is most of the job. The model needs somewhere to run that survives a traffic spike, a path for data to reach it that does not involve anyone emailing a spreadsheet, a way for the people who use it to say when it is wrong, and a route for that correction to reach the next version.

  1. 1

    Data

    Collected, validated and versioned, so a training set can be reproduced a year from now.

  2. 2

    Model

    Trained and evaluated against a held-out set, with the uncertainty of each prediction as a first-class output.

  3. 3

    Deployment

    Containerised and served on Kubernetes, scaled to the load, versioned so a bad release can be rolled back.

  4. 4

    Use

    Reached from a web app, a phone in the field, a desktop tool or another service over an API.

Back to step one. Predictions the model was least certain about, corrections from the people using it, and anything new the sensors saw all land back in the same store the next training run reads.

The model lifecycle: data collection, training, deployment, and use, with feedback from use returning to data collection.

Running models on Kubernetes

Inference is spiky. A quality-control model sees nothing overnight and everything at shift change; a screening run is idle for a week and then wants forty GPUs for an afternoon. Kubernetes handles that pattern well, which is why we use it by default, either on GKE or on whichever cluster you already run.

Containerised, reproducible

The model, its dependencies and its preprocessing ship as one image, with a version you can point at. Nobody has to say "it worked on the training machine".

Scaled to the load

We set up horizontal autoscaling on request volume or queue depth, separate GPU node pools for the work that needs them, and scale-to-zero for endpoints that are idle most of the week.

Safe releases

Releases go out as blue/green or canary rollouts, with health and drift checks in front of the switch. Rolling back takes one command instead of an evening.

Batch and stream

Real-time endpoints serve the interactive cases, and queued batch jobs handle the overnight sweep across everything that arrived that day.

Observable

We track latency, throughput and cost, and also the one people forget: the distribution of the inputs. That way you find out the camera was replaced before the accuracy report tells you.

Costed

Spot and preemptible nodes are used where the work can tolerate interruption, requests are right-sized, and the bill can be attributed to a workload.

Security is part of the architecture from the start

Scientific and industrial data, such as process parameters, unpublished results and patient records, is usually the most sensitive thing a company owns. The infrastructure has to assume that.

  • Isolation by default. Clusters are private, nothing gets a public endpoint unless it needs one, and network policy separates workloads instead of leaving them in a flat namespace.
  • Least privilege. We use workload identity instead of long-lived keys and scoped service accounts, and secrets live in a managed store, never in an image or a repository.
  • Auditability. Who called the model, with what input, and what it answered is retained wherever that matters for review or regulation.
  • Data residency. Storage and processing stay in the EU region where that is a requirement, and you get a clear answer about where every copy lives.
  • Supply chain. Dependencies are pinned, images are scanned, and the base image gets rebuilt instead of staying pinned to 2021.

Integration with your data

The most common reason a good model falls out of use is that nobody rebuilt the path that fed it. Deployment and data plumbing are the same project.

We build the collection and validation side too. That means ingesting from instruments, databases, object storage or an existing warehouse, and validating on arrival so that a schema change surfaces as an alert instead of as an unexplained accuracy drop months later. It also means making sure the transformations applied at inference are the same ones applied during training, because when they diverge the failure is subtle and expensive.

Where a database is the right home for it, the model's outputs (predictions, confidence and model version) go back in alongside the inputs, so the record of what was decided can be queried instead of sitting in a log file.

Automated processing pipelines

Almost none of this is a single job. Between an instrument writing a file and someone reading a number there is a chain of steps, and at each of them things can stop happening without anyone noticing. That chain is worth building as one orchestrated pipeline, not as a folder of scripts and a cron entry nobody remembers writing.

  1. 1

    Ingest

    From instruments, databases, object storage or an existing warehouse, either on a schedule or when something arrives.

  2. 2

    Validate

    Schema, ranges and completeness are checked. A row that fails is rejected and raises an alert instead of passing through unnoticed.

  3. 3

    Transform

    This is the same code path that will run at inference time, so training and serving cannot drift apart.

  4. 4

    Store

    Data is versioned, and the raw input is kept alongside the derived form, because the next question is always one the current transform throws away.

  5. 5

    Run

    Scoring, aggregation, retraining, or whatever else this pipeline exists to do.

  6. 6

    Publish

    Results go to a database, a dashboard, an API or a report, with provenance attached to every figure.

What separates a pipeline from a scheduled script is mostly what happens when something goes wrong:

Scheduled and event-driven

Nightly sweeps run where that fits, and triggered runs where it does not: a new file landing in a bucket, a message on a queue, or a row appearing in a table.

Idempotent and re-runnable

Running a step twice produces the same result as running it once. That property is what makes a retry safe, and a retry that is not safe is not a retry.

Backfills

When a transform changes or a bug is found, the last two years can be reprocessed with the new code as a normal operation instead of an incident.

Lineage

Every output traces back to the inputs, the code version and the parameters that produced it. When a number is questioned six months later, that question can be answered.

Failure that is visible

A step that fails raises an alert, retries with backoff, and stops the steps downstream of it. The expensive failure mode is silent partial success, not the loud failure.

Tested like code

Data contracts and expectations are checked in CI, so a change to a transform has to pass the same bar as a change to the application around it.

The same machinery runs the training side. A retrain is a pipeline that pulls the current labelled set, trains, evaluates against the incumbent on a held-out set, and registers the candidate. Promotion to production remains a deliberate step, never an automatic one.

Active learning: the deployment improves the model

A deployed model generates the most valuable training data you will ever get, and most deployments throw it away.

Because our models carry uncertainty alongside each prediction, we can rank incoming cases by how unsure the model was about them. Those are the cases most worth a human's attention, and their labels improve the next version most per hour of expert time. Once the loop exists, it is straightforward:

  1. The model flags the cases it found hardest, instead of an operator sampling at random.
  2. Someone who knows the domain resolves them, in the same tool they were already using.
  3. Those resolutions land in the training store with provenance attached.
  4. Retraining runs on a schedule or on a trigger, and the candidate is evaluated against the current model before anything is promoted.

Alongside this, drift monitoring watches whether today's inputs still look like the ones the model was trained on. That is what tells you a retrain is needed before performance degrades far enough for someone to complain.

Applications people use

An API is only useful to a system. When the user is a person, such as an operator on a line, a researcher at a bench or a technician in a field, the model needs a front end, and often one that works where the network does not.

Android & iOS

Apps are cross-platform, so the experience does not depend on which phone someone was issued. They support camera capture, on-device inference where latency or connectivity demands it, and a sync queue for everything recorded while offline.

Desktop tools

These serve workflows that live next to an instrument or a large local dataset, where uploading everything to review it is not realistic.

Web

Dashboards, review queues and internal tools are where the uncertain cases get resolved and where the labels come from.

We build these ourselves because of the return path. An app that shows a prediction is a demo; an app where the user can say "no, that one is a crack, not a scratch" and have it reach the training set is part of the system. Every correction, every new observation and every image the model has not seen before flows back into the same store the next training run reads from.

Where to go next