{"record":{"id":"b914eaf655199970","repo":"plandex-ai/plandex","slug":"s-is-a-local-only-model-provider-so-it-can-t-b","errorCode":null,"errorMessage":"'%s' is a local-only model provider, so it can't be used on Plandex Cloud","messagePattern":"'(.+?)' is a local-only model provider, so it can't be used on Plandex Cloud","errorType":"validation","errorClass":null,"httpStatus":422,"severity":"error","filePath":"app/server/handlers/models.go","lineNumber":216,"sourceCode":"\t\t\t\t_, creating := inputProviderNames[*provider.CustomProvider]\n\t\t\t\tif !exists && !creating {\n\t\t\t\t\tmsg := fmt.Sprintf(\"'%s' is not a custom model provider that exists or is being imported\", *provider.CustomProvider)\n\t\t\t\t\tlog.Println(msg)\n\t\t\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpc, builtIn := shared.BuiltInModelProviderConfigs[provider.Provider]\n\t\t\t\tif !builtIn {\n\t\t\t\t\tmsg := fmt.Sprintf(\"'%s' is not a built-in model provider\", provider.Provider)\n\t\t\t\t\tlog.Println(msg)\n\t\t\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tif os.Getenv(\"IS_CLOUD\") != \"\" && pc.LocalOnly {\n\t\t\t\t\tmsg := fmt.Sprintf(\"'%s' is a local-only model provider, so it can't be used on Plandex Cloud\", provider.Provider)\n\t\t\t\t\tlog.Println(msg)\n\t\t\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdbModel := db.CustomModelFromApi(model)\n\t\tdbModel.Id = model.Id\n\t\tdbModel.OrgId = auth.OrgId\n\n\t\ttoUpsertCustomModels = append(toUpsertCustomModels, dbModel)\n\t}\n\n\tfor _, modelPack := range updatedModelsInput.CustomModelPacks {\n\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]","sourceCodeStart":198,"sourceCodeEnd":234,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/models.go#L198-L234","documentation":"A 422 validation error thrown when the server runs on Plandex Cloud (IS_CLOUD env var set) and a custom model references a built-in provider whose config has LocalOnly=true. Local-only providers rely on locally hosted infrastructure (e.g. ollama, local transformers) that cannot run in the cloud deployment.","triggerScenarios":"POST to the upsert custom models endpoint against api.plandex.ai (or any deployment with IS_CLOUD set) with CustomModels[].Providers[].provider referencing a LocalOnly built-in provider such as ollama.","commonSituations":"Reusing a local models.json on Plandex Cloud; migrating a self-hosted config to cloud without stripping local providers; not realizing the org/account is in Integrated Models mode restrictions differ from local-only restrictions.","solutions":["Remove the local-only provider entries from the request when targeting Plandex Cloud","Use a cloud-compatible provider (openai, anthropic, etc.) instead","Run Plandex self-hosted if you need local-only providers like ollama","Keep separate model configs for cloud and self-hosted environments"],"exampleFix":"// before (on Plandex Cloud)\n{\"provider\": \"ollama\"}\n// after (on Plandex Cloud)\n{\"provider\": \"openai\"} // or deploy self-hosted to keep ollama","handlingStrategy":"validation","validationCode":"// pre-check LocalOnly providers when targeting Plandex Cloud\nif isCloud {\n    for _, m := range in.CustomModels {\n        for _, pr := range m.Providers {\n            if pc, ok := shared.BuiltInModelProviderConfigs[pr.Provider]; ok && pc.LocalOnly {\n                return fmt.Errorf(\"provider %q is local-only; unusable on cloud\", pr.Provider)\n            }\n        }\n    }\n}","typeGuard":"func cloudCompatible(p shared.ModelProvider) bool {\n    pc, ok := shared.BuiltInModelProviderConfigs[p]\n    return ok && !pc.LocalOnly\n}","tryCatchPattern":"// deterministic 422 — strip local-only providers and resubmit once\nif resp.StatusCode == 422 && strings.Contains(bodyText, \"local-only model provider\") {\n    input = stripLocalOnlyProviders(input)\n    return upsert(input)\n}","preventionTips":["Maintain separate configs for cloud vs self-hosted environments","Check pc.LocalOnly on every provider before cloud imports","Never reuse local models.json directly against Plandex Cloud","Document which providers are local-only for your team"],"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"}