{"record":{"id":"371f2dbccd0c3e0c","repo":"plandex-ai/plandex","slug":"built-in-local-model-s-can-t-be-used-on-plandex-c","errorCode":null,"errorMessage":"Built-in local model %s can't be used on Plandex Cloud","messagePattern":"Built-in local model (.+?) can't be used on Plandex Cloud","errorType":"http","errorClass":"http","httpStatus":422,"severity":"warning","filePath":"app/server/handlers/settings.go","lineNumber":140,"sourceCode":"\t\t\t}\n\t\t}\n\t}\n\n\tif req.ModelPack != nil {\n\t\tif req.ModelPack.LocalProvider != \"\" {\n\t\t\tmsg := fmt.Sprintf(\"Local model pack %s can't be used on Plandex Cloud\", req.ModelPack.Name)\n\t\t\tlog.Println(msg)\n\t\t\thttp.Error(w, msg, http.StatusUnprocessableEntity)\n\t\t\treturn\n\t\t}\n\n\t\tids := req.ModelPack.ToModelPackSchema().AllModelIds()\n\t\tfor _, id := range ids {\n\t\t\tbm, builtIn := shared.BuiltInBaseModelsById[id]\n\t\t\tif builtIn && os.Getenv(\"IS_CLOUD\") != \"\" && bm.IsLocalOnly() {\n\t\t\t\tmsg := fmt.Sprintf(\"Built-in local model %s can't be used on Plandex Cloud\", id)\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\t}\n\n\tctx, cancel := context.WithCancel(r.Context())\n\n\tvar commitMsg string\n\n\terr = db.ExecRepoOperation(db.ExecRepoOperationParams{\n\t\tOrgId:    auth.OrgId,\n\t\tUserId:   auth.User.Id,\n\t\tPlanId:   planId,\n\t\tBranch:   branch,\n\t\tReason:   \"update settings\",\n\t\tScope:    db.LockScopeWrite,\n\t\tCtx:      ctx,\n\t\tCancelFn: cancel,","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/server/handlers/settings.go#L122-L158","documentation":"For custom packs, the handler enumerates every model id via ModelPack.ToModelPackSchema().AllModelIds() and rejects the pack if any referenced built-in base model (shared.BuiltInBaseModelsById) is local-only while running on Plandex Cloud. HTTP 422 names the offending model id.","triggerScenarios":"Custom ModelPack references at least one built-in base model id where bm.IsLocalOnly() is true, and IS_CLOUD is set on the server.","commonSituations":"User hand-assembles a pack and includes a local-only model (e.g. a local inference model) among otherwise cloud models; pack copied wholesale from a self-hosted instance to cloud.","solutions":["Remove the local-only model id from the custom pack and replace it with a cloud-available model","Check each model id against shared.BuiltInBaseModelsById and IsLocalOnly before submitting","Run self-hosted if local-only models are required"],"exampleFix":"// before\nmodels: [\"gpt-4o\", \"local-llama\"]\n// after\nmodels: [\"gpt-4o\", \"claude-3-5-sonnet\"]","handlingStrategy":"validation","validationCode":"for _, id := range pack.ToModelPackSchema().AllModelIds() {\n    if bm, ok := shared.BuiltInBaseModelsById[id]; ok && os.Getenv(\"IS_CLOUD\") != \"\" && bm.IsLocalOnly() {\n        return fmt.Errorf(\"model %q is local-only and unavailable on cloud\", id)\n    }\n}","typeGuard":null,"tryCatchPattern":"resp, err := client.UpdateSettings(ctx, req)\nif err != nil {\n    var apiErr *APIError\n    if errors.As(err, &apiErr) && apiErr.StatusCode == 422 {\n        // remove/replace the local-only model id reported in the message\n    }\n    return err\n}","preventionTips":["Pre-validate all model ids with AllModelIds() before submitting packs","Maintain a cloud-safe model allowlist for custom packs","Replace local-only models with cloud equivalents when moving packs to cloud"],"tags":["http","configuration","cloud"],"backgroundTag":"local-model-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"}