{"record":{"id":"886a3ba4be88da73","repo":"plandex-ai/plandex","slug":"s-is-a-local-only-built-in-model-so-it-can-t-b","errorCode":null,"errorMessage":"'%s' is a local-only built-in model, so it can't be used on Plandex Cloud","messagePattern":"'(.+?)' is a local-only built-in model, so it can't be used on Plandex Cloud","errorType":"validation","errorClass":null,"httpStatus":422,"severity":"error","filePath":"app/server/handlers/models.go","lineNumber":248,"sourceCode":"\t\t// ensure that all models are either built-in, being imported, or already exist\n\t\tallModelIds := modelPack.AllModelIds()\n\n\t\tfor _, modelId := range allModelIds {\n\t\t\t_, exists := existingCustomModelIds[modelId]\n\t\t\t_, creating := inputModelIds[string(modelId)]\n\t\t\tbm, builtIn := shared.BuiltInBaseModelsById[modelId]\n\n\t\t\tif !exists && !creating && !builtIn {\n\t\t\t\tmsg := fmt.Sprintf(\"'%s' is not built-in, not being imported, and not an existing custom model\", modelId)\n\t\t\t\tlog.Println(msg)\n\t\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif builtIn && os.Getenv(\"IS_CLOUD\") != \"\" && bm.IsLocalOnly() {\n\t\t\t\tmsg := fmt.Sprintf(\"'%s' is a local-only built-in model, so it can't be used on Plandex Cloud\", modelId)\n\t\t\t\tlog.Println(msg)\n\t\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tmp := modelPack.ToModelPack()\n\t\tdbMp := db.ModelPackFromApi(&mp)\n\t\tdbMp.OrgId = auth.OrgId\n\t\tdbMp.Id = mp.Id\n\n\t\ttoUpsertModelPacks = append(toUpsertModelPacks, dbMp)\n\t}\n\n\ttoDeleteCustomModelIds := []string{}\n\ttoDeleteCustomProviderIds := []string{}\n\ttoDeleteModelPackIds := []string{}\n\n\tfor _, model := range customModels {\n\t\tif _, exists := inputModelIds[string(model.ModelId)]; !exists {","sourceCodeStart":230,"sourceCodeEnd":266,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/models.go#L230-L266","documentation":"A 422 validation error thrown when running on Plandex Cloud (IS_CLOUD set) and a custom model pack references a built-in base model for which bm.IsLocalOnly() is true. Local-only built-in models depend on locally running inference and are banned from cloud model pack configurations.","triggerScenarios":"POST to the upsert custom models endpoint against Plandex Cloud with a CustomModelPacks entry whose AllModelIds() includes a local-only built-in base model id (e.g. a locally hosted ollama model that ships as a built-in).","commonSituations":"Copying a self-hosted model pack config to cloud; shared team config files that mix local and cloud environments; forgetting that the restriction applies to any role in the pack, not just the planner.","solutions":["Replace local-only built-in model ids in the pack with cloud-compatible built-ins","Remove those model entries from the pack before importing on cloud","Use self-hosted Plandex if local-only models are required in packs","Maintain environment-specific pack definitions"],"exampleFix":"// before (on Plandex Cloud)\n{\"name\": \"my-pack\", \"summarizer\": {\"modelId\": \"ollama-local-model\"}}\n// after (on Plandex Cloud)\n{\"name\": \"my-pack\", \"summarizer\": {\"modelId\": \"claude-3-haiku\"}}","handlingStrategy":"validation","validationCode":"// pre-check local-only built-ins in packs when on cloud\nif isCloud {\n    for _, pack := range in.CustomModelPacks {\n        for _, id := range pack.AllModelIds() {\n            if bm, ok := shared.BuiltInBaseModelsById[id]; ok && bm.IsLocalOnly() {\n                return fmt.Errorf(\"pack references local-only built-in model: %q\", id)\n            }\n        }\n    }\n}","typeGuard":"func cloudCompatibleModel(id shared.ModelId) bool {\n    bm, builtIn := shared.BuiltInBaseModelsById[id]\n    return !builtIn || !bm.IsLocalOnly()\n}","tryCatchPattern":"// deterministic 422 — swap local-only models then resubmit once\nif resp.StatusCode == 422 && strings.Contains(bodyText, \"local-only built-in model\") {\n    input = replaceLocalOnlyModels(input)\n    return upsert(input)\n}","preventionTips":["Audit pack model ids for IsLocalOnly() before cloud imports","Keep cloud and local pack definitions separate","Check every role in the pack, not just the planner","Prefer explicit cloud-safe model ids in shared team configs"],"tags":["validation","http-422","cloud-restriction","local-only"],"backgroundTag":"unsupported-on-cloud","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}