Skip to content

Commit 4551302

Browse files
authored
docs: update the documentation for usage (#150)
Signed-off-by: chlins <[email protected]>
1 parent 140372c commit 4551302

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docs/getting-started.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ Then run the following command to build the model artifact:
8181
$ modctl build -t registry.com/models/llama3:v1.0.0 -f Modelfile .
8282
```
8383

84+
The build command requires additional local storage for the built blobs. Since model files are often large, storing both the original and built versions locally can strain disk space. To avoid this, you can use the following command to build the blob and push it directly to a remote registry.
85+
86+
87+
```shell
88+
$ modctl build -t registry.com/models/llama3:v1.0.0 -f Modelfile . --output-remote
89+
```
90+
8491
### Pull & Push
8592

8693
Before the `pull` or `push` command, you need to login the registry:
@@ -95,6 +102,12 @@ Pull the model artifact from the registry:
95102
$ modctl pull registry.com/models/llama3:v1.0.0
96103
```
97104

105+
Similar to the build above, the above command requires pulling the model image to the local machine before extracting it, which wastes extra storage space. Therefore, you can use the following command to directly extract the model from the remote repository into a specific output directory.
106+
107+
```shell
108+
$ modctl pull registry.com/models/llama3:v1.0.0 --extract-dir /path/to/extract --extract-from-remote
109+
```
110+
98111
Push the model artifact to the registry:
99112

100113
```shell
@@ -109,6 +122,7 @@ Extract the model artifact to the specified directory:
109122
$ modctl extract registry.com/models/llama3:v1.0.0 --output /path/to/extract
110123
```
111124

125+
112126
### List
113127

114128
List the model artifacts in the local storage:
@@ -117,6 +131,27 @@ List the model artifacts in the local storage:
117131
$ modctl ls
118132
```
119133

134+
### Fetch
135+
136+
Fetch the partial files by specifying the file path glob pattern:
137+
138+
```shell
139+
$ modctl fetch registry.com/models/llama3:v1.0.0 --output /path/to/extract --patterns '*.json'
140+
```
141+
142+
### Attach
143+
144+
The `attach` command allows you to add a file to an existing model artifact. This is useful for avoiding a complete rebuild of the artifact when only a single file has been modified:
145+
146+
```shell
147+
# attach the local model artifact.
148+
$ modctl attach foo.txt -s registry.com/models/llama3:v1.0.0 -t registry.com/models/llama3:v1.0.1
149+
150+
# attach the remote model artifact.
151+
$ modctl attach foo.txt -s registry.com/models/llama3:v1.0.0 -t registry.com/models/llama3:v1.0.1 --output-remote
152+
```
153+
154+
120155
### Cleanup
121156

122157
Delete the model artifact in the local storage:

0 commit comments

Comments
 (0)