---
title: "Behind the scenes: How we designed Docker Model Runner and what’s next"
description: "Docker Model Runner runs AI models locally and exposes them to both containers and host processes through Docker-style /models endpoints and OpenAI-compatible /engines/{engine}/v1 endpoints. llama.cpp is the first backend, but the API path leaves room for others like vLLM and MLX."
url: "https://swe.quest/articles/behind-the-scenes-how-we-designed-docker-model-runner-and-what-s-next-376205c328b89264"
canonical: "https://www.docker.com/blog/how-we-designed-model-runner-and-whats-next/"
source: "Docker"
published: "2025-06-18"
difficulty: "medium"
kind: "Case study"
reading_minutes: 16
tags: ["inference","containers","api-design","system-design","llms"]
---

# Behind the scenes: How we designed Docker Model Runner and what’s next

A post on [Docker](https://swe.quest/sources/docker.md), published 2025-06-18, 16 min read, Case study. Original: [https://www.docker.com/blog/how-we-designed-model-runner-and-whats-next/](https://www.docker.com/blog/how-we-designed-model-runner-and-whats-next/)

## Summary

Docker Model Runner runs AI models locally and exposes them to both containers and host processes through Docker-style /models endpoints and OpenAI-compatible /engines/{engine}/v1 endpoints. llama.cpp is the first backend, but the API path leaves room for others like vLLM and MLX. On Docker Desktop, inference runs on the host outside the VM to get reliable GPU acceleration, with API calls proxied from the VM; on Docker CE it runs in containers with direct hardware access. A scheduler/loader swaps engine-model process pairs in and out of memory and holds requests until RAM/VRAM frees up rather than returning 503s. Model tensors are kept in a separate store so the engine can mmap them.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)
- [API design](https://swe.quest/tags/api-design.md) (Backend & APIs)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- Docker Engine API ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- LLM inference basics ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))
- OpenAI API

## Keywords

Docker Model Runner, Docker Desktop, llama.cpp, OpenAI API, Docker MCP Toolkit, OCI registries, NVIDIA Container Toolkit

## Related posts

- [Run LLMs Locally with Docker: A Quickstart Guide to Model Runner](https://swe.quest/articles/run-llms-locally-with-docker-a-quickstart-guide-to-model-runner-ccfbbb71db5d1485.md): Docker · 2025-04-04 · Medium · 5 min read · Inference & serving, LLMs, Containers, Developer tools
  Docker Model Runner, in beta with Docker Desktop 4.40 on Apple silicon, pulls LLMs packaged as OCI artifacts and serves them through an OpenAI-compatible API backed by llama.cpp.
- [How to Build, Run, and Package AI Models Locally with Docker Model Runner](https://swe.quest/articles/how-to-build-run-and-package-ai-models-locally-with-docker-model-runner-acbc6d65548e5373.md): Docker · 2025-06-12 · Medium · 6 min read · Inference & serving, LLMs, Containers, Developer tools
  Docker Model Runner, enabled as a beta feature in Docker Desktop 4.40+, pulls GGUF-format LLMs from Docker Hub or Hugging Face and runs them locally via the \`docker model\` CLI or an OpenAI-compatible HTTP endpoint on localhost.
- [Docker Model Runner on the new NVIDIA DGX Spark: a new paradigm for developing AI locally](https://swe.quest/articles/docker-model-runner-on-the-new-nvidia-dgx-spark-a-new-paradigm-for-developing-f03f09cdcb90d612.md): Docker · 2025-10-14 · Medium · 7 min read · Inference & serving, Containers, LLMs, AI for coding, Hardware
  Docker Model Runner now supports NVIDIA DGX Spark, a compact Grace Blackwell GB10 workstation with 128GB of unified memory, for running large models locally.
- [Why Docker Chose OCI Artifacts for AI Model Packaging](https://swe.quest/articles/why-docker-chose-oci-artifacts-for-ai-model-packaging-8d56b3acd7f94cc6.md): Docker · 2025-06-18 · Medium · 8 min read · Containers, Inference & serving, LLMs
  Docker Model Runner packages LLMs as a custom OCI artifact type rather than as container images, so models can be pushed, pulled and access-controlled through existing OCI registries like Docker Hub.
- [How to Make an AI Chatbot from Scratch using Docker Model Runner](https://swe.quest/articles/how-to-make-an-ai-chatbot-from-scratch-using-docker-model-runner-48eab58e2814218f.md): Docker · 2025-06-03 · Medium · 17 min read · Inference & serving, Observability, LLMs, Go, Containers
  A local GenAI chatbot built on Docker Model Runner, which runs llama.cpp models natively on the host and exposes an OpenAI-compatible API to containers.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
