In this article
Per-model environments isolate dependencies but still exchange runtime objects with the main server, requiring compatible MLServer and Python communication behavior.
The model imports alone but fails in serving
A team packages a custom model environment to avoid conflicting numerical-library dependencies. The model loads in a standalone interpreter, yet a request fails when the server delegates it to the worker. Local import success did not exercise the communication path between the main process and the isolated runtime.
Evaluate the environment as a participant in a serving protocol, not merely a directory containing installed packages. Both ends must agree on the objects exchanged during request processing.
Custom environments depend on parallel inference
The custom-runtime guide documents per-model environment tarballs and states that parallel inference must be enabled. It also explains communication through multiprocessing queues using pickled objects, with compatible Python behavior and the same MLServer version across the participating environments.
Avoid turning an older documentation compatibility table into a universal promise about every newer interpreter. Validate the actual server and worker combination used for the deployment rather than generalizing from a successful model-only test.
The worker pool remains part of the design
The parallel-inference guide describes separate inference processes and pool controls. An environment change can therefore affect worker startup and communication independently of the model’s own prediction code.
Distributed worker overlap provides background on why worker identity and assignment need explicit evidence. For serving environments, record the environment artifact assigned to each model and the process configuration that consumes it.
Inspect effective server configuration
The server-settings reference documents inference-pool controls and environment-related settings. Check the values actually deployed, including external overrides, so the environment test reflects the server’s real execution path.
Artifact verification can establish the identity of the environment archive being loaded. That identity complements, but does not replace, an operational compatibility check between the archive’s runtime and the main server process.
Test a full request round trip
Start the main server with the packaged environment, load the intended model and send a representative request through the public interface. Confirm correct decoding, worker execution and response reconstruction, not only a successful import or readiness message.
Repeat the round trip when upgrading Python, MLServer or the custom runtime package. Dependency isolation succeeds when the model can execute within its environment while preserving the communication contract with the rest of the serving system.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.