The model service approach packages one model’s prediction workflow as a dedicated web service. An application backend sends requests to a predictor, which loads a model artifact, preprocesses input, runs inference, postprocesses output, and returns the result. The predictor commonly runs in a Docker container and can often be adapted from the training container. section 6.3.1
A client/server layout separates the mobile UI, application backend, and single-model predictor. The backend relays a user request to the predictor rather than executing the model in the UI. section 6.3.1
Face-swap predictor
A phone UI uploads source and target images and asks an application backend to swap faces. The backend calls a deepfake predictor API; the predictor transforms the images, executes the model, and returns swapped images for display. This layout suits an application with a web backend and one model. section 6.3.1
This pattern is a pragmatic fit for a single application. Dedicated predictor code is relatively quick to build because serving code simplifies training code, and owning the end-to-end workflow can make maintenance straightforward. Its specificity is also its limit: a predictor built from intent-classification training code serves that model type rather than arbitrary models. section 7.3 section 7.7
Choose the pattern when its operational trade-offs match the system:
- Use it for a single application or a small, model-specific workflow where control of preprocessing, inference, and postprocessing matters. section 7.3 section 7.7
- Prefer a model server for a platform that must support many model types; one generic predictor backend avoids building a dedicated service for every model. section 7.3 section 7.7
- Plan releases and monitoring alongside the service design, including model metric collection and model quality gates. section 7.7
A self-built serving container demonstrates the approach, while TorchServe illustrates the contrasting model server approach. Model servers can serve arbitrary models within their supported ecosystem, but their setup, operation, and maintenance require learning a broader serving system. Existing server tools are recommended over building a model server from scratch when that broader platform capability is needed. section 7.0 section 7.3 section 7.7
