server/internal: replace model delete API with new registry handler. (#9347)

This commit introduces a new API implementation for handling
interactions with the registry and the local model cache. The new API is
located in server/internal/registry. The package name is "registry" and
should be considered temporary; it is hidden and not bleeding outside of
the server package. As the commits roll in, we'll start consuming more
of the API and then let reverse osmosis take effect, at which point it
will surface closer to the root level packages as much as needed.
This commit is contained in:
Blake Mizerany
2025-02-27 12:04:53 -08:00
committed by GitHub
parent be2ac1ed93
commit 2412adf42b
16 changed files with 705 additions and 90 deletions

View File

@@ -68,7 +68,7 @@ func main() {
log.Fatal(err)
}
rc, err := ollama.RegistryFromEnv()
rc, err := ollama.DefaultRegistry()
if err != nil {
log.Fatal(err)
}
@@ -177,7 +177,7 @@ func cmdPush(ctx context.Context, rc *ollama.Registry, c *blob.DiskCache) error
}
from := cmp.Or(*flagFrom, model)
m, err := ollama.ResolveLocal(c, from)
m, err := rc.ResolveLocal(c, from)
if err != nil {
return err
}