Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit f6ad1e8

Browse files
authored
Merge pull request #142 from docker/shards
Support packaging sharded models
2 parents adce441 + fd5d60a commit f6ad1e8

File tree

22 files changed

+418
-128
lines changed

22 files changed

+418
-128
lines changed

commands/package.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ func newPackagedCmd() *cobra.Command {
2525

2626
c := &cobra.Command{
2727
Use: "package --gguf <path> [--license <path>...] [--context-size <tokens>] [--push] MODEL",
28-
Short: "Package a GGUF file into a Docker model OCI artifact, with optional licenses. The package is sent to the model-runner, unless --push is specified",
28+
Short: "Package a GGUF file into a Docker model OCI artifact, with optional licenses.",
29+
Long: "Package a GGUF file into a Docker model OCI artifact, with optional licenses. The package is sent to the model-runner, unless --push is specified.\n" +
30+
"When packaging a sharded model --gguf should point to the first shard. All shard files should be siblings and should include the index in the file name (e.g. model-00001-of-00015.gguf).",
2931
Args: func(cmd *cobra.Command, args []string) error {
3032
if len(args) != 1 {
3133
return fmt.Errorf(

docs/reference/docker_model_package.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
command: docker model package
22
short: |
3-
Package a GGUF file into a Docker model OCI artifact, with optional licenses. The package is sent to the model-runner, unless --push is specified
4-
long: |
5-
Package a GGUF file into a Docker model OCI artifact, with optional licenses. The package is sent to the model-runner, unless --push is specified
3+
Package a GGUF file into a Docker model OCI artifact, with optional licenses.
4+
long: |-
5+
Package a GGUF file into a Docker model OCI artifact, with optional licenses. The package is sent to the model-runner, unless --push is specified.
6+
When packaging a sharded model --gguf should point to the first shard. All shard files should be siblings and should include the index in the file name (e.g. model-00001-of-00015.gguf).
67
usage: docker model package --gguf <path> [--license <path>...] [--context-size <tokens>] [--push] MODEL
78
pname: docker model
89
plink: docker_model.yaml

docs/reference/model.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ Docker Model Runner (EXPERIMENTAL)
55

66
### Subcommands
77

8-
| Name | Description |
9-
|:------------------------------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------|
10-
| [`df`](model_df.md) | Show Docker Model Runner disk usage |
11-
| [`inspect`](model_inspect.md) | Display detailed information on one model |
12-
| [`install-runner`](model_install-runner.md) | Install Docker Model Runner (Docker Engine only) |
13-
| [`list`](model_list.md) | List the models pulled to your local environment |
14-
| [`logs`](model_logs.md) | Fetch the Docker Model Runner logs |
15-
| [`package`](model_package.md) | Package a GGUF file into a Docker model OCI artifact, with optional licenses. The package is sent to the model-runner, unless --push is specified |
16-
| [`ps`](model_ps.md) | List running models |
17-
| [`pull`](model_pull.md) | Pull a model from Docker Hub or HuggingFace to your local environment |
18-
| [`push`](model_push.md) | Push a model to Docker Hub |
19-
| [`rm`](model_rm.md) | Remove local models downloaded from Docker Hub |
20-
| [`run`](model_run.md) | Run a model and interact with it using a submitted prompt or chat mode |
21-
| [`status`](model_status.md) | Check if the Docker Model Runner is running |
22-
| [`tag`](model_tag.md) | Tag a model |
23-
| [`uninstall-runner`](model_uninstall-runner.md) | Uninstall Docker Model Runner |
24-
| [`unload`](model_unload.md) | Unload running models |
25-
| [`version`](model_version.md) | Show the Docker Model Runner version |
8+
| Name | Description |
9+
|:------------------------------------------------|:------------------------------------------------------------------------------|
10+
| [`df`](model_df.md) | Show Docker Model Runner disk usage |
11+
| [`inspect`](model_inspect.md) | Display detailed information on one model |
12+
| [`install-runner`](model_install-runner.md) | Install Docker Model Runner (Docker Engine only) |
13+
| [`list`](model_list.md) | List the models pulled to your local environment |
14+
| [`logs`](model_logs.md) | Fetch the Docker Model Runner logs |
15+
| [`package`](model_package.md) | Package a GGUF file into a Docker model OCI artifact, with optional licenses. |
16+
| [`ps`](model_ps.md) | List running models |
17+
| [`pull`](model_pull.md) | Pull a model from Docker Hub or HuggingFace to your local environment |
18+
| [`push`](model_push.md) | Push a model to Docker Hub |
19+
| [`rm`](model_rm.md) | Remove local models downloaded from Docker Hub |
20+
| [`run`](model_run.md) | Run a model and interact with it using a submitted prompt or chat mode |
21+
| [`status`](model_status.md) | Check if the Docker Model Runner is running |
22+
| [`tag`](model_tag.md) | Tag a model |
23+
| [`uninstall-runner`](model_uninstall-runner.md) | Uninstall Docker Model Runner |
24+
| [`unload`](model_unload.md) | Unload running models |
25+
| [`version`](model_version.md) | Show the Docker Model Runner version |
2626

2727

2828

docs/reference/model_package.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# docker model package
22

33
<!---MARKER_GEN_START-->
4-
Package a GGUF file into a Docker model OCI artifact, with optional licenses. The package is sent to the model-runner, unless --push is specified
4+
Package a GGUF file into a Docker model OCI artifact, with optional licenses. The package is sent to the model-runner, unless --push is specified.
5+
When packaging a sharded model --gguf should point to the first shard. All shard files should be siblings and should include the index in the file name (e.g. model-00001-of-00015.gguf).
56

67
### Options
78

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ require (
1111
github.com/docker/docker v28.2.2+incompatible
1212
github.com/docker/go-connections v0.5.0
1313
github.com/docker/go-units v0.5.0
14-
github.com/docker/model-distribution v0.0.0-20250813080006-2a983516ebb8
15-
github.com/docker/model-runner v0.0.0-20250822151118-d8ed37445584
14+
github.com/docker/model-distribution v0.0.0-20250822172258-8fe9daa4a4da
15+
github.com/docker/model-runner v0.0.0-20250822173738-5341c9fc2974
1616
github.com/fatih/color v1.15.0
1717
github.com/google/go-containerregistry v0.20.6
1818
github.com/mattn/go-isatty v0.0.20

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ github.com/docker/go-metrics v0.0.1/go.mod h1:cG1hvH2utMXtqgqqYE9plW6lDxS3/5ayHz
7878
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
7979
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
8080
github.com/docker/libtrust v0.0.0-20160708172513-aabc10ec26b7/go.mod h1:cyGadeNEkKy96OOhEzfZl+yxihPEzKnqJwvfuSUqbZE=
81-
github.com/docker/model-distribution v0.0.0-20250813080006-2a983516ebb8 h1:agH5zeO6tf8lHgMcBZxqCFKPuXHM/cA53gdsn895eMI=
82-
github.com/docker/model-distribution v0.0.0-20250813080006-2a983516ebb8/go.mod h1:dThpO9JoG5Px3i+rTluAeZcqLGw8C0qepuEL4gL2o/c=
83-
github.com/docker/model-runner v0.0.0-20250822151118-d8ed37445584 h1:8YAzh9lihwcFGyHTK9pTFqdM7IwYwb0R/YkrNxmQ2do=
84-
github.com/docker/model-runner v0.0.0-20250822151118-d8ed37445584/go.mod h1:0IAh5ekLg8ipcPAF+Rdav1wbt9xF+zQPoRC1bblk/ik=
81+
github.com/docker/model-distribution v0.0.0-20250822172258-8fe9daa4a4da h1:ml99WBfcLnsy1frXQR4X+5WAC0DoGtwZyGoU/xBsDQM=
82+
github.com/docker/model-distribution v0.0.0-20250822172258-8fe9daa4a4da/go.mod h1:dThpO9JoG5Px3i+rTluAeZcqLGw8C0qepuEL4gL2o/c=
83+
github.com/docker/model-runner v0.0.0-20250822173738-5341c9fc2974 h1:/uF17tBEtsE6T2Xgg4cgrrqNcQ02gY5Lp98je+2K0nQ=
84+
github.com/docker/model-runner v0.0.0-20250822173738-5341c9fc2974/go.mod h1:1Q2QRB5vob542x6P5pQXlGTYs5bYPxNG6ePcjTndA0A=
8585
github.com/dvsekhvalnov/jose2go v0.0.0-20170216131308-f21a8cedbbae/go.mod h1:7BvyPhdbLxMXIYTFPLsyJRFMsKmOZnQmzh6Gb+uquuM=
8686
github.com/elastic/go-sysinfo v1.15.3 h1:W+RnmhKFkqPTCRoFq2VCTmsT4p/fwpo+3gKNQsn1XU0=
8787
github.com/elastic/go-sysinfo v1.15.3/go.mod h1:K/cNrqYTDrSoMh2oDkYEMS2+a72GRxMvNP+GC+vRIlo=

vendor/github.com/docker/model-distribution/distribution/client.go

Lines changed: 8 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/model-distribution/internal/bundle/bundle.go

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/model-distribution/internal/bundle/parse.go

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/github.com/docker/model-distribution/internal/bundle/unpack.go

Lines changed: 85 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)