Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.
better error message when model not found on pull
Bruce MacDonald536028c35a7f
diff --git a/api/client.go b/api/client.goindex 571625710..7a6126cdb 100644--- a/api/client.go+++ b/api/client.go@@ -131,7 +131,7 @@ func (c *Client) stream(ctx context.Context, method, path string, data any, fn f}if errorResponse.Error != "" {- return fmt.Errorf("stream: %s", errorResponse.Error)+ return fmt.Errorf(errorResponse.Error)}if response.StatusCode >= 400 {diff --git a/server/images.go b/server/images.goindex 06ee8e06d..9be097d1b 100644--- a/server/images.go+++ b/server/images.go@@ -684,7 +684,7 @@ func PullModel(name string, regOpts *RegistryOptions, fn func(api.ProgressResponmanifest, err := pullModelManifest(mp, regOpts)if err != nil {- return fmt.Errorf("pull model manifest: %q", err)+ return fmt.Errorf("pull model manifest: %s", err)}var layers []*Layer@@ -738,6 +738,8 @@ func PullModel(name string, regOpts *RegistryOptions, fn func(api.ProgressResponreturn nil}+var errModelNotFound = fmt.Errorf("model not found")+func pullModelManifest(mp ModelPath, regOpts *RegistryOptions) (*ManifestV2, error) {url := fmt.Sprintf("%s/v2/%s/manifests/%s", mp.Registry, mp.GetNamespaceRepository(), mp.Tag)headers := map[string]string{@@ -753,6 +755,9 @@ func pullModelManifest(mp ModelPath, regOpts *RegistryOptions) (*ManifestV2, err// Check for success: For a successful upload, the Docker registry will respond with a 201 Createdif resp.StatusCode != http.StatusOK {+ if resp.StatusCode == http.StatusNotFound {+ return nil, errModelNotFound+ }body, _ := io.ReadAll(resp.Body)return nil, fmt.Errorf("on pull registry responded with code %d: %s", resp.StatusCode, body)}