abiosoft/colima · error

no models available Pull a model first: colima model pull ai

Error message

no models available
Pull a model first: colima model pull ai/smollm2

What it means

`colima model serve` with the docker runner and no positional model argument falls back to model.GetFirstModel(), which shells out to `docker model list --json` in the guest and returns the first model's first tag. When that list is empty (no models pulled into Docker Model Runner), GetFirstModel returns the empty string and this error tells you to pull one, naming ai/smollm2 as the example.

Source

Thrown at cmd/model.go:171

	},
	RunE: func(cmd *cobra.Command, args []string) error {
		runner, err := getModelRunner()
		if err != nil {
			return err
		}

		// Determine the model to serve
		var modelName string
		if len(args) > 0 {
			modelName = args[0]
		} else if runner.Name() == model.RunnerDocker {
			// For docker runner, get the first available model
			firstModel, err := model.GetFirstModel()
			if err != nil {
				return err
			}
			if firstModel == "" {
				return fmt.Errorf("no models available\nPull a model first: colima model pull ai/smollm2")
			}
			modelName = firstModel
		} else {
			return fmt.Errorf("model name is required for ramalama runner\nUsage: colima model serve <model>")
		}

		if err := runner.EnsureProvisioned(); err != nil {
			return err
		}

		// Ensure the model is available (pull if necessary) - this happens outside alternate screen
		normalizedModel, err := runner.EnsureModel(modelName)
		if err != nil {
			return err
		}

		// Determine the port to use
		port := modelCmdArgs.ServePort

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Pull a model first: `colima model pull ai/smollm2`, then re-run `colima model serve`
  2. Or pass the model explicitly if one is expected: `colima model serve <model>`
  3. Verify what is available: `colima model list` — empty output confirms the trigger

Example fix

# before
$ colima model serve
error: no models available. Pull a model first: colima model pull ai/smollm2

# after
$ colima model pull ai/smollm2
$ colima model serve
Defensive patterns

Strategy: validation

Validate before calling

// verify a model exists before serve (docker runner)
first, err := model.GetFirstModel()
if err != nil || first == "" {
    // pull first: colima model pull ai/smollm2
}

Try / catch

if err := serveCmd.Execute(); err != nil {
    if strings.Contains(err.Error(), "no models available") {
        // pull the suggested model and retry once
        _ = exec.Command("colima", "model", "pull", "ai/smollm2").Run()
        err = serveCmd.Execute()
    }
}

Prevention

When it happens

Trigger: Fresh colima + docker runner install with zero pulled models; all previously pulled models removed; `docker model list` returning an empty JSON array; a pull still in progress so the list is empty when serve queries it.

Common situations: First-time use of the model feature on a new VM; after `docker model rm` of every model; after recreating the VM — models live in the guest's docker store and are lost with `colima delete`.

Related errors


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