Browse Source

separate deprecation changes

Roy Han 10 months ago
parent
commit
0ac5cbc00e
4 changed files with 7 additions and 3 deletions
  1. 2 0
      api/types.go
  2. 2 2
      cmd/cmd.go
  3. 1 1
      llm/llama.cpp
  4. 2 0
      server/routes.go

+ 2 - 0
api/types.go

@@ -293,6 +293,7 @@ type ProcessResponse struct {
 // ListModelResponse is a single model description in [ListResponse].
 type ListModelResponse struct {
 	Name       string       `json:"name"`
+	Model      string       `json:"model"`
 	ModifiedAt time.Time    `json:"modified_at"`
 	Size       int64        `json:"size"`
 	Digest     string       `json:"digest"`
@@ -301,6 +302,7 @@ type ListModelResponse struct {
 
 // ProcessModelResponse is a single model description in [ProcessResponse].
 type ProcessModelResponse struct {
+	Name      string       `json:"name"`
 	Model     string       `json:"model"`
 	Size      int64        `json:"size"`
 	Digest    string       `json:"digest"`

+ 2 - 2
cmd/cmd.go

@@ -525,7 +525,7 @@ func ListRunningHandler(cmd *cobra.Command, args []string) error {
 	var data [][]string
 
 	for _, m := range models.Models {
-		if len(args) == 0 || strings.HasPrefix(m.Model, args[0]) {
+		if len(args) == 0 || strings.HasPrefix(m.Name, args[0]) {
 			var procStr string
 			switch {
 			case m.SizeVRAM == 0:
@@ -539,7 +539,7 @@ func ListRunningHandler(cmd *cobra.Command, args []string) error {
 				cpuPercent := math.Round(float64(sizeCPU) / float64(m.Size) * 100)
 				procStr = fmt.Sprintf("%d%%/%d%% CPU/GPU", int(cpuPercent), int(100-cpuPercent))
 			}
-			data = append(data, []string{m.Model, m.Digest[:12], format.HumanBytes(m.Size), procStr, format.HumanTime(m.ExpiresAt, "Never")})
+			data = append(data, []string{m.Name, m.Digest[:12], format.HumanBytes(m.Size), procStr, format.HumanTime(m.ExpiresAt, "Never")})
 		}
 	}
 

+ 1 - 1
llm/llama.cpp

@@ -1 +1 @@
-Subproject commit 5921b8f089d3b7bda86aac5a66825df6a6c10603
+Subproject commit 7c26775adb579e92b59c82e8084c07a1d0f75e9c

+ 2 - 0
server/routes.go

@@ -747,6 +747,7 @@ func (s *Server) ListModelsHandler(c *gin.Context) {
 
 		// tag should never be masked
 		models = append(models, api.ListModelResponse{
+			Model:      trimLatest(n.DisplayShortest()),
 			Name:       trimLatest(n.DisplayShortest()),
 			Size:       m.Size(),
 			Digest:     m.digest,
@@ -1156,6 +1157,7 @@ func (s *Server) ProcessHandler(c *gin.Context) {
 
 		mr := api.ProcessModelResponse{
 			Model:     trimLatest(model.ShortName),
+			Name:      trimLatest(model.ShortName),
 			Size:      int64(v.estimatedTotal),
 			SizeVRAM:  int64(v.estimatedVRAM),
 			Digest:    model.Digest,