@@ -152,9 +152,18 @@ func cmdPull(client *distribution.Client, args []string) int {
152152}
153153
154154func cmdPackage (args []string ) int {
155- fs := flag .NewFlagSet ("push " , flag .ExitOnError )
155+ fs := flag .NewFlagSet ("package " , flag .ExitOnError )
156156 var licensePaths stringSliceFlag
157+ var contextSize uint64
158+
157159 fs .Var (& licensePaths , "licenses" , "Paths to license files (can be specified multiple times)" )
160+ fs .Uint64Var (& contextSize , "context-size" , 0 , "Context size in tokens" )
161+ fs .Usage = func () {
162+ fmt .Fprintf (os .Stderr , "Usage: model-distribution-tool package [OPTIONS] <path-to-gguf> <reference>\n \n " )
163+ fmt .Fprintf (os .Stderr , "Options:\n " )
164+ fs .PrintDefaults ()
165+ }
166+
158167 if err := fs .Parse (args ); err != nil {
159168 fmt .Fprintf (os .Stderr , "Error parsing flags: %v\n " , err )
160169 return 1
@@ -163,7 +172,7 @@ func cmdPackage(args []string) int {
163172
164173 if len (args ) < 2 {
165174 fmt .Fprintf (os .Stderr , "Error: missing arguments\n " )
166- fmt . Fprintf ( os . Stderr , " Usage: model-distribution-tool push <source> <reference> [--licenses <path-to-license-file1> --licenses <path-to-license-file2> ...] \n " )
175+ fs . Usage ( )
167176 return 1
168177 }
169178
@@ -222,6 +231,11 @@ func cmdPackage(args []string) int {
222231 }
223232 }
224233
234+ if contextSize > 0 {
235+ fmt .Println ("Setting context size:" , contextSize )
236+ builder = builder .WithContextSize (contextSize )
237+ }
238+
225239 // Push the image
226240 if err := builder .Build (ctx , target , os .Stdout ); err != nil {
227241 fmt .Fprintf (os .Stderr , "Error writing model %q to registry: %v\n " , reference , err )
0 commit comments