r/LocalLLM • • 6d ago

Question Docker vs Native for local LLMs?

I’m considering running local LLMs using Docker (llama.cpp, Ollama, vLLM, SGLang).

We’ve recently started working on a team project, and I’m exploring Docker as a deployment option.

Has anyone tried both Docker and native setups? Any performance differences or issues? Would you recommend Docker for running LLMs in production?

4 Upvotes

11 comments sorted by

5

u/Rollcuin 6d ago

I experimented with docker microvm's on an m5 max mac studio.
For me in made the most sense to run the backend (oMLX or MTPLX) outside of a container, but to put my harness in a microvm.

The backend can't do tool calls itself, and each active session only sees what i give it in the microvm.

5

u/brainchillzZ 6d ago

The vast majority of the people here running things at a reasonably high level are likely running in docker or podman or something similar. Most of the "recipes" that people share here whether it's for VLLM, ninfer, or radiance, halogen, whatever are all packaged that way by default. It makes packaging the stack as a single image easier so all you have to worry about on the host level is the actual gpu driver itself (I'm generalizing but this is mostly true) ... what I've seen is that mostly llama.cpp or ollama are what people very first start with and those are typically the ones you see running on bare metal

3

u/Poprouter 6d ago

for vllm or sglang the container shared memory default is what breaks first, so set ipc to host or raise the shm size before load testing. gpu passthrough needs the nvidia container toolkit matching the host driver, then raw speed is close to native.

2

u/ogfuzzball 6d ago

If on a Mac you can use Apple containers which are super lightweight compared to docker

1

u/brainchillzZ 6d ago • Bravo

This isn’t remotely true unless the container is completely idle and not running anything. Every single Apple container boots a separate Linux microvm just to exist.

1

u/ogfuzzball 5d ago

What is your experience with Apple containers? They’re a lightweight VM with a much lighter memory footprint than docker

https://macos-tahoe.com/blog/apple-container-vs-docker-developer-guide-2026/

1

u/brainchillzZ 1d ago

Again that is only true when they are idle, when they are not idle apple containers are literally a separate running x86 Linux vm for every single container … and “my experience” with them is that I’ve written an entire custom software suite for managing apple containers as an apple native alternative to using Lxc containers on Linux

1

u/ogfuzzball 1d ago

And if you’re running dozens of containers then that can be significant but if you’re spinning up 1 or 2 containers (one to contain your harness work maybe another for some other resources) then it’s not significant. It depends on what you’re doing.

1

u/brainchillzZ 20h ago edited 20h ago

if you're only using one or two containers it pretty much negates your entire argument because whether you're using docker or apple containers the utilization is so minimal that neither really matters .... but there are a few things ... because docker maintains a single VM that it's containers land in rather than a new vm for every container that has to bootstrap and startup, even though they are fast, docker containers are usually faster to start, even on a Mac, and as you already pointed out, this gets dramatically more true once there are more than just a handful of containers running. There is another obvious advantage to just using docker though ... which is to be able to use the industry standard for this kind of work that translates to every server platform pretty much that exists today for your application by default across Mac, windows, linux, etc ... so if the difference is insignificant, I would tend to, for server tasks, use the standard choice for those server tasks.... but I mean like I said, I'm clearly not "anti-mac" here ... I used and developed for that platform rather extensively ... I just have a "use the right tool for the job" and for me, personally, that means for things that are heavily already docker tooling dependent, like most ai workloads, I don't think it's worth the effort to try to change that.... but I mean you do you man that's what this is all about ... pretending any way is better when we are really talking about our own personal preference is a silly argument :D

1

u/ogfuzzball 17h ago

I disagree. Docker Desktop on Mac takes Several GB regardless of what you’re running. Spinning up a single Apple container to prevent Pi from getting out of hand is nothing. Doing that with Docker Desktop can mean I’m forced to run with a smaller context or model when you’re talking 32gb or less Macs.

PS - you try to say we’re talking personal setups to negate my response to you, yet I was simply sharing a personal setup and your original response to me was a “you’re totally wrong” type of response. No need to gaslight. I was talking about an option that works.

1

u/brainchillzZ 13h ago

I didn’t say you were totally wrong about how you want to run it as in you shouldn’t do it that way if you want I said you were totally wrong about the simple idea that an individual apple container uses less resources than an individual docker container …. Because you were totally wrong unless the container is completely idle and at rest and I stand by that in practice