Skip to content

Commit 9474ef7

Browse files
committed
models: return untagged model information on delete
Bump model-distribution to docker/model-distribution@a633223 (current latest) to include docker/model-distribution@67a3bf2. Signed-off-by: Dorin Geman <dorin.geman@docker.com>
1 parent 9806a43 commit 9474ef7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/inference/models/manager.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,8 @@ func (m *Manager) handleDeleteModel(w http.ResponseWriter, r *http.Request) {
333333
}
334334
}
335335

336-
if _, err := m.distributionClient.DeleteModel(r.PathValue("name"), force); err != nil {
336+
resp, err := m.distributionClient.DeleteModel(r.PathValue("name"), force)
337+
if err != nil {
337338
if errors.Is(err, distribution.ErrModelNotFound) {
338339
http.Error(w, err.Error(), http.StatusNotFound)
339340
return
@@ -346,6 +347,11 @@ func (m *Manager) handleDeleteModel(w http.ResponseWriter, r *http.Request) {
346347
http.Error(w, err.Error(), http.StatusInternalServerError)
347348
return
348349
}
350+
351+
w.Header().Set("Content-Type", "application/json")
352+
if err := json.NewEncoder(w).Encode(resp); err != nil {
353+
http.Error(w, fmt.Sprintf("error writing response: %v", err), http.StatusInternalServerError)
354+
}
349355
}
350356

351357
// handleOpenAIGetModels handles GET <inference-prefix>/<backend>/v1/models and

0 commit comments

Comments
 (0)