This commit is contained in:
Michael Yang
2025-10-28 20:55:22 -07:00
parent ec8a9f11ae
commit a3df958032
3 changed files with 4 additions and 22 deletions

View File

@@ -35,6 +35,7 @@ import (
"golang.org/x/term"
"github.com/ollama/ollama/api"
"github.com/ollama/ollama/client"
"github.com/ollama/ollama/envconfig"
"github.com/ollama/ollama/format"
"github.com/ollama/ollama/parser"
@@ -1575,12 +1576,7 @@ func checkServerHeartbeat(cmd *cobra.Command, _ []string) error {
}
func versionHandler(cmd *cobra.Command, _ []string) {
client, err := api.ClientFromEnvironment()
if err != nil {
return
}
serverVersion, err := client.Version(cmd.Context())
serverVersion, err := client.New().Version(cmd.Context())
if err != nil {
fmt.Println("Warning: could not connect to a running Ollama instance")
}