content/manuals/ai/model-runner/get-started.md
Docker Model Runner (DMR) lets you run and manage AI models locally using Docker. This page shows you how to enable DMR, pull and run a model, configure model settings, and publish custom models.
You can enable DMR using Docker Desktop or Docker Engine. Follow the instructions below based on your setup.
http://localhost:3131.You can now use the docker model command in the CLI and view and interact
with your local models in the Models tab in the Docker Desktop Dashboard.
[!IMPORTANT]
For Docker Desktop versions 4.45 and earlier, this setting was under the Beta features tab.
Ensure you have installed Docker Engine.
Docker Model Runner is available as a package. To install it, run:
{{< tabs >}} {{< tab name="Ubuntu/Debian">}}
$ sudo apt-get update
$ sudo apt-get install docker-model-plugin
{{< /tab >}} {{< tab name="RPM-base distributions">}}
$ sudo dnf update
$ sudo dnf install docker-model-plugin
{{< /tab >}} {{< /tabs >}}
Test the installation:
$ docker model version
$ docker model run ai/smollm2
[!NOTE] TCP support is enabled by default for Docker Engine on port
12434.
To update Docker Model Runner in Docker Engine, uninstall it with
docker model uninstall-runner
then reinstall it:
docker model uninstall-runner --images && docker model install-runner
[!NOTE] With the above command, local models are preserved. To delete the models during the upgrade, add the
--modelsoption to theuninstall-runnercommand.
Models are cached locally.
[!NOTE]
When you use the Docker CLI, you can also pull models directly from HuggingFace.
{{< tabs group="release" >}} {{< tab name="From Docker Desktop">}}
{{< /tab >}} {{< tab name="From the Docker CLI">}}
Use the docker model pull command.
For example:
docker model pull ai/smollm2:360M-Q4_K_M
docker model pull hf.co/bartowski/Llama-3.2-1B-Instruct-GGUF
{{< /tab >}} {{< /tabs >}}
{{< tabs group="release" >}} {{< tab name="From Docker Desktop">}}
{{< /tab >}} {{< tab name="From the Docker CLI" >}}
Use the docker model run command.
{{< /tab >}} {{< /tabs >}}
You can configure a model, such as its maximum token limit and more, use Docker Compose. See Models and Compose - Model configuration options.
[!NOTE]
This works for any Container Registry supporting OCI Artifacts, not only Docker Hub.
You can tag existing models with a new name and publish them under a different namespace and repository:
# Tag a pulled model under a new name
$ docker model tag ai/smollm2 myorg/smollm2
# Push it to Docker Hub
$ docker model push myorg/smollm2
For more details, see the docker model tag
and docker model push command
documentation.
You can also package a model file in GGUF format as an OCI Artifact and publish it to Docker Hub.
# Download a model file in GGUF format, for example from HuggingFace
$ curl -L -o model.gguf https://huggingface.co/TheBloke/Mistral-7B-v0.1-GGUF/resolve/main/mistral-7b-v0.1.Q4_K_M.gguf
# Package it as OCI Artifact and push it to Docker Hub
$ docker model package --gguf "$(pwd)/model.gguf" --push myorg/mistral-7b-v0.1:Q4_K_M
For more details, see the
docker model package command
documentation.
To troubleshoot issues, display the logs:
{{< tabs group="release" >}} {{< tab name="From Docker Desktop">}}
Select Models and select the Logs tab.
{{< /tab >}} {{< tab name="From the Docker CLI">}}
Use the docker model logs command.
{{< /tab >}} {{< /tabs >}}
Inspecting requests and responses helps you diagnose model-related issues. For example, you can evaluate context usage to verify you stay within the model's context window or display the full body of a request to control the parameters you are passing to your models when developing with a framework.
In Docker Desktop, to inspect the requests and responses for each model:
[!NOTE] You can also display the requests for a specific model when you select a model and then select the Requests tab.