Load models from Docker volume without creating copies

Ray Serve does not provide a built-in way to exclude a mounted model registry folder from being copied into the working directory or runtime environment, nor does it support a .rayignore mechanism for this purpose. This means that, by default, Ray may copy the entire working directory—including large mounted volumes—when setting up the runtime environment, which can lead to excessive disk and memory usage, as you observed. There is no documented way to selectively ignore a folder while still allowing read access from within the containerized Ray Serve deployment, according to the available data sources.

A common workaround is to ensure that the model registry folder is not part of the working directory specified in the Ray runtime environment or job submission, and to reference the mounted path directly in your code. However, if you specify the working directory as the parent of the model registry, Ray will attempt to copy everything under it. There is no official support for a .rayignore file or similar exclusion mechanism in Ray’s runtime environment setup as of Ray 2.54. For more details on related issues and workarounds, see discussions at Ray GitHub Issue #59569 and Ray Discuss: Making model accessible across nodes.

Would you like more detail on possible workarounds or deployment patterns to avoid this issue?

Sources:

Hint: Mention @RunLLM in the post for followups.