Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
nolintlint
Michael Yang201d853fdf4d
diff --git a/cmd/cmd.go b/cmd/cmd.goindex e4cd6d9b5..b5747543c 100644--- a/cmd/cmd.go+++ b/cmd/cmd.go@@ -1029,22 +1029,6 @@ func initializeKeypair() error {return nil}-func waitForServer(ctx context.Context, client *api.Client) error {- // wait for the server to start- timeout := time.After(5 * time.Second)- tick := time.Tick(500 * time.Millisecond)- for {- select {- case <-timeout:- return errors.New("timed out waiting for server to start")- case <-tick:- if err := client.Heartbeat(ctx); err == nil {- return nil // server has started- }- }- }-}-func checkServerHeartbeat(cmd *cobra.Command, _ []string) error {client, err := api.ClientFromEnvironment()if err != nil {diff --git a/cmd/start.go b/cmd/start.gonew file mode 100644index 000000000..0c4eed084--- /dev/null+++ b/cmd/start.go@@ -0,0 +1,27 @@+//go:build darwin || windows++package cmd++import (+ "context"+ "errors"+ "time"++ "github.com/ollama/ollama/api"+)++func waitForServer(ctx context.Context, client *api.Client) error {+ // wait for the server to start+ timeout := time.After(5 * time.Second)+ tick := time.Tick(500 * time.Millisecond)+ for {+ select {+ case <-timeout:+ return errors.New("timed out waiting for server to start")+ case <-tick:+ if err := client.Heartbeat(ctx); err == nil {+ return nil // server has started+ }+ }+ }+}