Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions pkg/distribution/distribution/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"log/slog"
"os"
"path/filepath"
"slices"
"strings"

"github.com/docker/model-runner/pkg/distribution/huggingface"
Expand All @@ -22,7 +21,6 @@ import (
"github.com/docker/model-runner/pkg/distribution/registry"
"github.com/docker/model-runner/pkg/distribution/tarball"
"github.com/docker/model-runner/pkg/distribution/types"
"github.com/docker/model-runner/pkg/inference/platform"
"github.com/docker/model-runner/pkg/internal/utils"
)

Expand Down Expand Up @@ -774,13 +772,6 @@ func (c *Client) GetBundle(ref string) (types.ModelBundle, error) {
return c.store.BundleForModel(normalizedRef)
}

func GetSupportedFormats() []types.Format {
if platform.SupportsVLLM() {
return []types.Format{types.FormatGGUF, types.FormatSafetensors, types.FormatDiffusers}
}
return []types.Format{types.FormatGGUF, types.FormatDiffusers}
}

func checkCompat(image types.ModelArtifact, log *slog.Logger, reference string, progressWriter io.Writer) error {
manifest, err := image.Manifest()
if err != nil {
Expand All @@ -797,14 +788,7 @@ func checkCompat(image types.ModelArtifact, log *slog.Logger, reference string,
}

if config.GetFormat() == "" {
log.Warn("Model format field is empty for , unable to verify format compatibility", "model", utils.SanitizeForLog(reference))
} else if !slices.Contains(GetSupportedFormats(), config.GetFormat()) {
Comment thread
ericcurtin marked this conversation as resolved.
// Write warning but continue with pull
log.Warn(warnUnsupportedFormat)
if err := progress.WriteWarning(progressWriter, warnUnsupportedFormat, oci.ModePull); err != nil {
log.Warn("Failed to write warning message", "error", err)
}
// Don't return an error - allow the pull to continue
log.Warn("Model format field is empty; unable to verify format compatibility", "model", utils.SanitizeForLog(reference))
}
Comment thread
sourcery-ai[bot] marked this conversation as resolved.

return nil
Expand Down
13 changes: 0 additions & 13 deletions pkg/distribution/distribution/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/docker/model-runner/pkg/distribution/oci/remote"
mdregistry "github.com/docker/model-runner/pkg/distribution/registry"
"github.com/docker/model-runner/pkg/distribution/registry/testregistry"
"github.com/docker/model-runner/pkg/inference/platform"
)

var (
Expand Down Expand Up @@ -434,25 +433,13 @@ func TestClientPullModel(t *testing.T) {
t.Fatalf("Failed to create test client: %v", err)
}

// Try to pull the safetensors model with a progress writer to capture warnings
var progressBuf bytes.Buffer
err = testClient.PullModel(t.Context(), testTag, &progressBuf)

// Pull should succeed on all platforms now (with a warning on non-Linux)
if err != nil {
t.Fatalf("Expected no error, got: %v", err)
}

if !platform.SupportsVLLM() {
// On non-Linux, verify that a warning was written
progressOutput := progressBuf.String()
if !strings.Contains(progressOutput, `"type":"warning"`) {
t.Fatalf("Expected warning message on non-Linux platforms, got output: %s", progressOutput)
}
if !strings.Contains(progressOutput, warnUnsupportedFormat) {
t.Fatalf("Expected warning about safetensors format, got output: %s", progressOutput)
}
}
})

t.Run("pull with JSON progress messages", func(t *testing.T) {
Expand Down
2 changes: 0 additions & 2 deletions pkg/distribution/distribution/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@ var (
)
ErrConflict = errors.New("resource conflict")
)

const warnUnsupportedFormat = "vLLM backend currently only implemented for x86_64 NVIDIA platforms"
Loading