abiosoft/colima · error

failed to inspect model %q after pull: %w

Error message

failed to inspect model %q after pull: %w

What it means

After a pull that exited 0, EnsureDockerModel re-runs InspectDockerModel; if that still fails this error is returned. The pull claimed success but the model is still not inspectable: registration lag, inspect output unparseable (see error 227), or the pulled alias normalizes to a name inspect cannot resolve back.

Source

Thrown at model/docker.go:161

	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")
	Port      int    // Host port to expose the model on
	Threads   int    // Number of CPU threads (default: 2)
	GPULayers int    // Number of GPU layers (default: 999 = all)
}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. List what actually landed: colima ssh -- docker model ls — inspect the exact listed name
  2. Retry serve/ensure with the name exactly as shown by docker model ls
  3. Check whether the inner error is a parse failure (error 227) rather than not-found, and address that
  4. Update Docker/colima to versions whose alias handling agrees
Defensive patterns

Strategy: retry

Validate before calling

// After a successful pull, allow metadata a moment to settle before re-inspect.
time.Sleep(2 * time.Second)
modelInfo, err = InspectDockerModel(modelName)

Try / catch

var modelInfo *DockerModelInfo
for attempt := 0; attempt < 3; attempt++ {
    info, err := InspectDockerModel(modelName)
    if err == nil { modelInfo = info; break }
    if attempt == 2 {
        return "", fmt.Errorf("failed to inspect model %q after pull: %w", modelName, err)
    }
    time.Sleep(2 * time.Second)
}

Prevention

When it happens

Trigger: Pull succeeded under an alias (hf.co/...) but inspect of the original modelName still 404s; inspect CLI error right after pull while metadata settles; the parsing failure of error 227 recurring post-pull.

Common situations: Alias normalization mismatches between pull and inspect; slow VMs where the model registry is not yet consistent; Docker CLI/Model Runner version skew.

Related errors


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