@@ -15,7 +15,6 @@ import (
1515 "github.com/docker/model-runner/pkg/distribution/distribution"
1616 "github.com/docker/model-runner/pkg/distribution/registry"
1717 "github.com/docker/model-runner/pkg/inference"
18- "github.com/docker/model-runner/pkg/internal/utils"
1918 "github.com/docker/model-runner/pkg/logging"
2019 "github.com/docker/model-runner/pkg/middleware"
2120 "github.com/sirupsen/logrus"
@@ -81,7 +80,6 @@ func (h *HTTPHandler) routeHandlers() map[string]http.HandlerFunc {
8180 return map [string ]http.HandlerFunc {
8281 "POST " + inference .ModelsPrefix + "/create" : h .handleCreateModel ,
8382 "POST " + inference .ModelsPrefix + "/load" : h .handleLoadModel ,
84- "POST " + inference .ModelsPrefix + "/package" : h .handlePackageModel ,
8583 "GET " + inference .ModelsPrefix : h .handleGetModels ,
8684 "GET " + inference .ModelsPrefix + "/{name...}" : h .handleGetModel ,
8785 "DELETE " + inference .ModelsPrefix + "/{name...}" : h .handleDeleteModel ,
@@ -436,44 +434,6 @@ func (h *HTTPHandler) handlePushModel(w http.ResponseWriter, r *http.Request, mo
436434 }
437435}
438436
439- // handlePackageModel handles POST <inference-prefix>/models/package requests.
440- func (h * HTTPHandler ) handlePackageModel (w http.ResponseWriter , r * http.Request ) {
441-
442- // Decode the request
443- var request ModelPackageRequest
444- if err := json .NewDecoder (r .Body ).Decode (& request ); err != nil {
445- http .Error (w , "invalid request body" , http .StatusBadRequest )
446- return
447- }
448-
449- // Validate required fields
450- if request .From == "" || request .Tag == "" {
451- http .Error (w , "both 'from' and 'tag' fields are required" , http .StatusBadRequest )
452- return
453- }
454-
455- err := h .manager .Package (request .From , request .Tag , request .ContextSize )
456- if err != nil {
457- if errors .Is (err , distribution .ErrModelNotFound ) {
458- h .log .Warnf ("Failed to package model from %q: %v" , utils .SanitizeForLog (request .From , - 1 ), err )
459- http .Error (w , "Model not found" , http .StatusNotFound )
460- return
461- }
462- http .Error (w , err .Error (), http .StatusInternalServerError )
463- return
464- }
465-
466- // Return success response
467- w .Header ().Set ("Content-Type" , "application/json" )
468- response := map [string ]string {
469- "message" : fmt .Sprintf ("Successfully packaged model from %s with tag %s" , request .From , request .Tag ),
470- "model" : request .Tag ,
471- }
472- if err := json .NewEncoder (w ).Encode (response ); err != nil {
473- h .log .Warnln ("Error while encoding package response:" , err )
474- }
475- }
476-
477437// handlePurge handles DELETE <inference-prefix>/models/purge requests.
478438func (h * HTTPHandler ) handlePurge (w http.ResponseWriter , _ * http.Request ) {
479439 err := h .manager .Purge ()
0 commit comments