Skip to content

Commit 0acc7d2

Browse files
committed
add CORS configuration
1 parent 0f98203 commit 0acc7d2

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

content/manuals/ai/model-runner/_index.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,20 +39,25 @@ Models are pulled from Docker Hub the first time they're used and stored locally
3939

4040
### Enable DMR in Docker Desktop
4141

42-
1. Navigate to the **Beta features** tab in settings.
43-
2. Tick the **Enable Docker Model Runner** setting.
44-
3. If you are running on Windows with a supported NVIDIA GPU, you should also see and be able to tick the **Enable GPU-backed inference** setting.
42+
1. In the settings view, navigate to the **Beta features** tab.
43+
1. Tick the **Enable Docker Model Runner** setting.
44+
1. If you are running on Windows with a supported NVIDIA GPU, you should also see and be able to tick the **Enable GPU-backed inference** setting.
45+
1. Optional: If you want to enable TCP support, select the **Enable host-side TCP support**
46+
1. In the **Port** field, type the port of your choice.
47+
1. If you are interacting with Model Runner from a local frontend web app,
48+
in **CORS Allows Origins**, select the origins that Model Runner should accept requests from.
49+
An origin is the URL where your web app is running, for example `http://localhost:3131`.
4550

4651
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.
4752

4853
> [!IMPORTANT]
4954
>
50-
> For Docker Desktop versions 4.41 and earlier, this settings lived under the **Experimental features** tab on the **Features in development** page.
55+
> For Docker Desktop versions 4.41 and earlier, this setting lived under the **Experimental features** tab on the **Features in development** page.
5156
5257
### Enable DMR in Docker Engine
5358

5459
1. Ensure you have installed [Docker Engine](/engine/install/).
55-
2. DMR is available as a package. To install it, run:
60+
1. DMR is available as a package. To install it, run:
5661

5762
{{< tabs >}}
5863
{{< tab name="Ubuntu/Debian">}}
@@ -73,13 +78,19 @@ You can now use the `docker model` command in the CLI and view and interact with
7378
{{< /tab >}}
7479
{{< /tabs >}}
7580

76-
3. Test the installation:
81+
1. Test the installation:
7782

7883
```console
7984
$ docker model version
8085
$ docker model run ai/smollm2
8186
```
8287

88+
1. Optional: To enable TCP support, set the port with the `DMR_RUNNER_PORT` environment variable.
89+
1. Optional: If you enabled TCP support, you can configure CORS allowed origins with the `DMR_ORIGINS` environment variable. Possible values are:
90+
- `*`: Allow all origins
91+
- `-`: Deny all origins
92+
- Comma-separated list of allowed origins
93+
8394
## Pull a model
8495

8596
Models are cached locally.

0 commit comments

Comments
 (0)