abiosoft/colima · error

failed to pull model %q: %w

Error message

failed to pull model %q: %w

What it means

EnsureDockerModel falls back to guest.RunInteractive("docker","model","pull",<modelName>) when inspect fails; a non-zero pull exit produces this wrapped error. The docker pull of the model failed: unknown name/registry path, authentication required, network failure, insufficient disk, or cancellation of the interactive pull.

Source

Thrown at model/docker.go:156

	guest := lima.New(host.New())
	output, err := guest.RunOutput("docker", "model", "version")
	if err != nil {
		return ""
	}
	return strings.TrimSpace(output)
}

// EnsureDockerModel ensures a Docker model is available, pulling if necessary.
// Returns the normalized model name (resolving aliases like hf.co → huggingface.co).
func EnsureDockerModel(modelName string) (string, error) {
	guest := lima.New(host.New())

	// Try to inspect the model first
	modelInfo, err := InspectDockerModel(modelName)
	if err != nil {
		// Model not found locally, try to pull it
		if pullErr := guest.RunInteractive("docker", "model", "pull", modelName); pullErr != nil {
			return "", fmt.Errorf("failed to pull model %q: %w", modelName, pullErr)
		}
		// Retry inspect after pull
		modelInfo, err = InspectDockerModel(modelName)
		if err != nil {
			return "", fmt.Errorf("failed to inspect model %q after pull: %w", modelName, err)
		}
	}

	// Return the first tag as the normalized name (e.g., "docker.io/ai/smollm2:latest")
	if len(modelInfo.Tags) > 0 {
		return modelInfo.Tags[0], nil
	}
	return modelName, nil
}

// DockerModelServeConfig holds configuration for serving a Docker model.
type DockerModelServeConfig struct {
	ModelName string // Model name (e.g., "smollm2")

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Reproduce manually for the real message: colima ssh -- docker model pull <name>
  2. Fix the model reference (correct namespace/repo/tag, GGUF variants)
  3. docker login in the VM for private registries
  4. Free/expand disk (docker system prune, docker model rm unused models, or colima stop + resize) and retry
Defensive patterns

Strategy: try-catch

Validate before calling

// Before pulling: crude name sanity + disk headroom check in the VM.
func canPull(guest environment.VM, name string) bool {
    if len(strings.Split(name, "/")) < 2 && !strings.Contains(name, ":") {
        return false // likely missing namespace or tag
    }
    out, err := guest.RunOutput("sh", "-c", "df -Pk /var/lib/docker | tail -1 | awk '{print $4}'")
    return err == nil && out != "" // require some free space reported
}

Try / catch

if pullErr := guest.RunInteractive("docker", "model", "pull", modelName); pullErr != nil {
    return "", fmt.Errorf("failed to pull model %q: %w (check name, docker login, network, and VM disk)", modelName, pullErr)
}

Prevention

When it happens

Trigger: Model name typo or nonexistent repo (e.g. ai/smollm2 vs ai/smollm2:latest variants); private model without docker login; disk exhausted mid-download (GGUF files are multi-GB); network/proxy drop; user Ctrl-C during the interactive pull.

Common situations: First-time use with a misspelled model; corporate proxy environments; default colima disk (60-100GB) filled by earlier models; large 70B models exceeding free space.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/8fb8fb3722001240. Report an issue: GitHub.