{"record":{"id":"33ff0fdd4c81a3bb","repo":"abiosoft/colima","slug":"no-models-available-pull-a-model-first-colima-mod","errorCode":null,"errorMessage":"no models available\nPull a model first: colima model pull ai/smollm2","messagePattern":"no models available\nPull a model first: colima model pull ai/smollm2","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/model.go","lineNumber":171,"sourceCode":"\t},\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\trunner, err := getModelRunner()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Determine the model to serve\n\t\tvar modelName string\n\t\tif len(args) > 0 {\n\t\t\tmodelName = args[0]\n\t\t} else if runner.Name() == model.RunnerDocker {\n\t\t\t// For docker runner, get the first available model\n\t\t\tfirstModel, err := model.GetFirstModel()\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif firstModel == \"\" {\n\t\t\t\treturn fmt.Errorf(\"no models available\\nPull a model first: colima model pull ai/smollm2\")\n\t\t\t}\n\t\t\tmodelName = firstModel\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"model name is required for ramalama runner\\nUsage: colima model serve <model>\")\n\t\t}\n\n\t\tif err := runner.EnsureProvisioned(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Ensure the model is available (pull if necessary) - this happens outside alternate screen\n\t\tnormalizedModel, err := runner.EnsureModel(modelName)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Determine the port to use\n\t\tport := modelCmdArgs.ServePort","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/model.go#L153-L189","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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`.","solutions":["Pull a model first: `colima model pull ai/smollm2`, then re-run `colima model serve`","Or pass the model explicitly if one is expected: `colima model serve <model>`","Verify what is available: `colima model list` — empty output confirms the trigger"],"exampleFix":"# before\n$ colima model serve\nerror: no models available. Pull a model first: colima model pull ai/smollm2\n\n# after\n$ colima model pull ai/smollm2\n$ colima model serve","handlingStrategy":"validation","validationCode":"// verify a model exists before serve (docker runner)\nfirst, err := model.GetFirstModel()\nif err != nil || first == \"\" {\n    // pull first: colima model pull ai/smollm2\n}","typeGuard":null,"tryCatchPattern":"if err := serveCmd.Execute(); err != nil {\n    if strings.Contains(err.Error(), \"no models available\") {\n        // pull the suggested model and retry once\n        _ = exec.Command(\"colima\", \"model\", \"pull\", \"ai/smollm2\").Run()\n        err = serveCmd.Execute()\n    }\n}","preventionTips":["Always pull a model immediately after creating a fresh VM — `colima delete` wipes pulled models","Pass the model name explicitly in scripts instead of relying on first-model auto-pick","Model state lives in the guest: budget a re-pull after every VM recreation"],"tags":["colima","llm","model-runner","docker","cli"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}