abiosoft/colima · error

error inspecting model %q: %w

Error message

error inspecting model %q: %w

What it means

InspectDockerModel runs guest.RunOutput("docker","model","inspect",<modelName>) in the colima VM; non-zero exit produces this error. The docker CLI in the VM failed: model not present locally, the 'model' subcommand missing from that docker build, the runner backend not running, or the name/alias unresolvable.

Source

Thrown at model/docker.go:102

	// Create bundle directory and hard-link the blob (same approach as Docker Model Runner)
	bundleDir := fmt.Sprintf("/models/bundles/sha256/%s/model", modelHash)
	if err := guest.RunQuiet("docker", "exec", "docker-model-runner", "mkdir", "-p", bundleDir); err != nil {
		return "", fmt.Errorf("failed to create bundle directory: %w", err)
	}

	if err := guest.RunQuiet("docker", "exec", "docker-model-runner", "ln", blobPath, bundlePath); err != nil {
		return "", fmt.Errorf("failed to link model file: %w", err)
	}

	return bundlePath, nil
}

// InspectDockerModel returns information about a Docker model.
func InspectDockerModel(modelName string) (*DockerModelInfo, error) {
	guest := lima.New(host.New())
	output, err := guest.RunOutput("docker", "model", "inspect", modelName)
	if err != nil {
		return nil, fmt.Errorf("error inspecting model %q: %w", modelName, err)
	}

	var info DockerModelInfo
	if err := json.Unmarshal([]byte(strings.TrimSpace(output)), &info); err != nil {
		return nil, fmt.Errorf("error parsing model info: %w", err)
	}

	return &info, nil
}

// SetupOrUpdateDocker reinstalls Docker Model Runner in the VM.
func SetupOrUpdateDocker() error {
	guest := lima.New(host.New())

	log.Println("reinstalling Docker Model Runner...")

	if err := guest.RunInteractive("docker", "model", "reinstall-runner"); err != nil {
		return fmt.Errorf("error reinstalling Docker Model Runner: %w", err)

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Run it manually to see the real error: colima ssh -- docker model inspect <name>
  2. Pull first: docker model pull <name> (EnsureDockerModel does this automatically when inspect fails)
  3. Check docker model support in the VM: colima ssh -- docker model version; if absent, update Docker/colima and restart
  4. Fix the model reference (correct namespace/alias) and ensure docker login for private models
Defensive patterns

Strategy: try-catch

Validate before calling

// Optional pre-check that the docker CLI even supports models.
func dockerModelSupported(guest environment.VM) bool {
    return guest.RunQuiet("docker", "model", "version") == nil
}

Try / catch

modelInfo, err := InspectDockerModel(modelName)
if err != nil {
    // inspect failure doubles as "not found": fall through to pull, but keep the cause
    if pullErr := guest.RunInteractive("docker", "model", "pull", modelName); pullErr != nil {
        return "", fmt.Errorf("model %q not inspectable (%v) and pull failed: %w", modelName, err, pullErr)
    }
    modelInfo, err = InspectDockerModel(modelName)
}

Prevention

When it happens

Trigger: Calling InspectDockerModel/EnsureDockerModel for a model that was never pulled; VM docker CLI predates the 'docker model' command; docker-model-runner stopped so inspect cannot resolve the model; typo or wrong alias (e.g. hf.co vs huggingface.co namespace).

Common situations: First use of colima model serve before any pull; colima VM created with an older Docker version; switching between Docker Desktop and colima contexts; private registries without login.

Related errors


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