Merge pull request #774 from jmorganca/mxyng/server-version

add version api and show server version in cli
This commit is contained in:
Michael Yang
2023-12-06 13:22:55 -08:00
committed by GitHub
3 changed files with 71 additions and 30 deletions

View File

@@ -827,6 +827,9 @@ func Serve(ln net.Listener, allowOrigins []string) error {
})
r.Handle(method, "/api/tags", ListModelsHandler)
r.Handle(method, "/api/version", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"version": version.Version})
})
}
log.Printf("Listening on %s (version %s)", ln.Addr(), version.Version)