{"record":{"id":"e5fe9ae58a43867e","repo":"Mintplex-Labs/anything-llm","slug":"chromacloud-embedding-dimension-too-large-defaul","errorCode":null,"errorMessage":"ChromaCloud::Embedding dimension too large (default max is ${this.limits.maxEmbeddingDim}). Got ${testSubmission.embedding.length}. Upsert may fail!","messagePattern":"ChromaCloud::Embedding dimension too large \\(default max is (.+?)\\)\\. Got (.+?)\\. Upsert may fail!","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"server/utils/vectorDbProviders/chromacloud/index.js","lineNumber":67,"sourceCode":"   * Local deployments do not have these limitations since they are self-hosted.\n   *\n   * This method, if cloud, will do some simple logic/heuristics to ensure that the upserts are not too large.\n   * Otherwise, it may throw a 422.\n   * @param {import(\"chromadb\").Collection} collection\n   * @param {{ids: string[], embeddings: number[], metadatas: Record<string, any>[], documents: string[]}[]} submissions\n   * @returns {Promise<boolean>} True if the upsert was successful, false otherwise.\n   * If the upsert was not successful, the error message will be returned.\n   */\n  async smartAdd(collection, submission) {\n    const testSubmission = {\n      id: submission.ids[0],\n      embedding: submission.embeddings[0],\n      metadata: submission.metadatas[0],\n      document: submission.documents[0],\n    };\n\n    if (testSubmission.embedding.length > this.limits.maxEmbeddingDim)\n      console.warn(\n        `ChromaCloud::Embedding dimension too large (default max is ${this.limits.maxEmbeddingDim}). Got ${testSubmission.embedding.length}. Upsert may fail!`\n      );\n    if (testSubmission.document.length > this.limits.maxDocumentBytes)\n      console.warn(\n        `ChromaCloud::Document length too large (default max is ${this.limits.maxDocumentBytes}). Got ${testSubmission.document.length}. Upsert may fail!`\n      );\n    if (\n      JSON.stringify(testSubmission.metadata).length >\n      this.limits.maxMetadataBytes\n    )\n      console.warn(\n        `ChromaCloud::Metadata length too large (default max is ${this.limits.maxMetadataBytes}). Got ${JSON.stringify(testSubmission.metadata).length}. Upsert may fail!`\n      );\n\n    // If the submissions are not too large, just add them directly.\n    if (submission.ids.length <= this.limits.maxRecordsPerWrite) {\n      await collection.add(submission);\n      return true;","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/3aec848f2885144aa8f1e53b9731a04310d5d558/server/utils/vectorDbProviders/chromacloud/index.js#L49-L85","documentation":"ChromaCloud (the hosted Chroma vector DB in AnythingLLM) pre-flights every upsert in smartAdd() against static account quotas (see docs.trychroma.com/cloud/quotas-limits): maxEmbeddingDim is 4096. It samples only the first record of the submission (embeddings[0]) and prints this warning when that embedding's dimension exceeds 4096 — a strong signal the cloud service will reject the write (typically HTTP 422). The warning does not block the call; the failure surfaces afterwards.","triggerScenarios":"Calling addDocuments()/smartAdd on a chromacloud-backed workspace with an embedding model whose output dimension exceeds 4096 — e.g. a 6144- or 8192-dimension model — or after switching a workspace to a larger-dimension embedder so new chunks trip the sampled first record.","commonSituations":"Selecting a high-dimension embedder (large voyage/open-class models) while VECTOR_DB=chromacloud; migrating from local Chroma (which has no such limits) to Chroma Cloud and re-embedding existing workspaces; dimension mismatches between old and new vectors in the same collection.","solutions":["Switch the workspace's embedder to a model with ≤4096 dimensions (most 1536/3072-dim models are safe) and re-embed the affected workspace.","If you must keep the large-dimension model, move off Chroma Cloud to self-hosted Chroma (VECTOR_DB=chroma) or another provider without the cap.","Check the Chroma Cloud quotas page for your account tier in case your plan raises the ceiling.","After changing embedders, clear and re-create the workspace vectors — mixed dimensions in one collection cause additional upsert failures."],"exampleFix":"# before: 8192-dim embedder on Chroma Cloud → upserts rejected\nVECTOR_DB=chromacloud\nEMBEDDING_MODEL_PROVIDER=... \nEMBEDDING_MODEL=... (8192 dimensions)\n\n# after: dimension within the 4096 quota\nVECTOR_DB=chromacloud\nEMBEDDING_MODEL=... (3072 dimensions)\n# then re-embed the workspace","handlingStrategy":"validation","validationCode":"const CHROMA_CLOUD_MAX_EMBEDDING_DIM = 4096;\n\nconst dim =\n  embedder?.dimensions ??\n  (await embedder.embedTextInput(\"dimension probe\")).length;\n\nif (process.env.VECTOR_DB === \"chromacloud\" && dim > CHROMA_CLOUD_MAX_EMBEDDING_DIM) {\n  throw new Error(\n    `Selected embedder produces ${dim}-dim vectors; Chroma Cloud allows at most ${CHROMA_CLOUD_MAX_EMBEDDING_DIM}. Choose a smaller model or self-host Chroma.`\n  );\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Before switching VECTOR_DB to chromacloud, probe your embedder's dimension and compare with the provider quotas page (embedding dim, document bytes, metadata bytes).","Keep one embedder per workspace and re-embed after any change — mixed dimensions break upserts independently of the quota.","Prefer mainstream 1024–3072-dim models for cloud vector DBs; the 4096 ceiling excludes several large models."],"tags":["chroma-cloud","embeddings","vector-db","quotas","payload-size"],"backgroundTag":"embedding-dimension-mismatch","analyzedSha":"3aec848f2885144aa8f1e53b9731a04310d5d558","analyzedAt":"2026-08-18T10:02:21.017Z","contentChangedAt":"2026-08-18T10:02:21.017Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}