Trace weights fetched before origins were kept, and let an origin be given by hand
The mirror keeps where it fetched a file beside it, and reports that and the checksum after it restarts. A model whose files the mirror cannot trace is found on the registry: a repository holding a file of that name that has the commit the mirror's directory is named after, with every file at the same size, the most downloaded first. ctl model origin and the console set one by hand, checked the same way. Commits compare shortened. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
dac7ff0e99
commit
f36c46a881
11 files changed
+356
-14
No files matched your search
@@ -117,3 +117,25 @@ func newModelRollbackCmd(client func() *ctlClient) *cobra.Command {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func newModelOriginCmd(client func() *ctlClient) *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "origin MODEL OWNER/REPO",
|
||||
Short: "Say which registry repository a model's weights came from",
|
||||
Long: "For a model fetched before llmgw kept this, and that it could not find on\n" +
|
||||
"its own. The repository is checked: it must have the commit the mirror's\n" +
|
||||
"directory is named after, holding the model's files at the sizes the\n" +
|
||||
"mirror has. From then on its updates are watched.",
|
||||
Args: cobra.ExactArgs(2),
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
body, _ := json.Marshal(map[string]string{"repo": args[1]})
|
||||
var o struct{ Repo, Revision string }
|
||||
if err := client().post(cmd.Context(), "/api/v1/models/"+args[0]+"/origin", body, &o); err != nil {
|
||||
return err
|
||||
}
|
||||
fmt.Fprintf(cmd.OutOrStdout(), "%s came from %s at %s; its updates are watched\n", args[0], o.Repo,
|
||||
catalog.ShortRevision(o.Revision))
|
||||
return nil
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user