abiosoft/colima · error

could not determine hash for model %q

Error message

could not determine hash for model %q

What it means

ServeDockerModel derives the model's content hash via modelInfo.Hash(); an empty result means the inspect JSON lacked the field Hash() reads (the ID/config digest). The model is inspectable but its identity fields are absent, so no bundle path can be computed.

Source

Thrown at model/docker.go:210

		cfg.GPULayers = 999
	}

	// Get the model info (model should already be available via EnsureDockerModel)
	modelInfo, err := InspectDockerModel(cfg.ModelName)
	if err != nil {
		return fmt.Errorf("failed to inspect model %q: %w", cfg.ModelName, err)
	}

	// Check model format - only GGUF models are supported
	if modelInfo.Config.Format != "gguf" {
		return fmt.Errorf("model %q has format %q, only GGUF models are supported\n"+
			"Try a GGUF version of this model (e.g., from TheBloke on HuggingFace)",
			cfg.ModelName, modelInfo.Config.Format)
	}

	modelHash := modelInfo.Hash()
	if modelHash == "" {
		return fmt.Errorf("could not determine hash for model %q", cfg.ModelName)
	}

	// Ensure docker-model-runner container is running (needed to find GGUF path)
	if err := ensureDockerModelRunner(guest); err != nil {
		return err
	}

	// Find the GGUF file path (handles both Docker registry and HuggingFace models)
	ggufPath, err := findGGUFPath(guest, modelHash)
	if err != nil {
		return fmt.Errorf("could not find GGUF file for model %q: %w", cfg.ModelName, err)
	}

	// Get container IP
	containerIP, err := getDockerModelRunnerIP(guest)
	if err != nil {
		return err
	}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Inspect the raw record: colima ssh -- docker model inspect <name> and check which identity fields are present
  2. Re-pull the model to regenerate complete metadata, then retry serve
  3. Update colima (struct may need the new field) and/or the Docker engine in the VM
  4. If a stale entry is the cause, docker model rm it first
Defensive patterns

Strategy: type-guard

Validate before calling

info, err := InspectDockerModel(cfg.ModelName)
if err == nil && info.Hash() == "" {
    // re-pull or bail before ServeDockerModel
}

Type guard

func hasModelIdentity(info *DockerModelInfo) bool {
    return info != nil && info.Hash() != ""
}

Try / catch

modelHash := modelInfo.Hash()
if modelHash == "" {
    return fmt.Errorf("could not determine hash for model %q — re-pull the model or update docker/colima", cfg.ModelName)
}

Prevention

When it happens

Trigger: Docker version whose inspect output omits or renames the ID/digest field Hash() relies on; a partially pulled or mid-deletion model whose metadata is incomplete; schema drift after a Model Runner update.

Common situations: Version skew between the docker CLI in the colima VM and colima's DockerModelInfo struct; models interrupted mid-pull; runner reinstalled while a model entry lingered.

Related errors


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