chroma-core/chroma · error · ChromaValueError

model_name, device, and normalize_embeddings are required

Error message

model_name, device, and normalize_embeddings are required

What it means

buildFromConfig() guard: the persisted SentenceTransformers config is missing one of model_name, device, or normalize_embeddings (all treated as required when rebuilding), so the function cannot be faithfully reconstructed from config alone.

Solutions

  1. Regenerate/fix the stored config so it includes model_name, device, and normalize_embeddings
  2. Provide explicit values when rebuilding from config
  3. Treat missing optional kwargs as {} but ensure the three required fields are present
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at clients/new-js/packages/ai-embeddings/sentence-transformer/src/index.ts:147 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of chroma-core/chroma@aecdd12c8a (2026-08-16). Data as JSON: /api/errors/22b95260e350a3bd. Report an issue: GitHub.

Appendix: source

Thrown at clients/new-js/packages/ai-embeddings/sentence-transformer/src/index.ts:147

            // This error will be handled by callers of generate(), so we can ignore it here.
        }
    }

    public defaultSpace(): EmbeddingFunctionSpace {
        return "cosine";
    }

    public supportedSpaces(): EmbeddingFunctionSpace[] {
        return ["cosine", "l2", "ip"];
    }

    public static buildFromConfig(
        config: SentenceTransformersConfig,
    ): SentenceTransformersEmbeddingFunction {
        const { model_name, device, normalize_embeddings, kwargs } = config;

        if (model_name === undefined || device === undefined || normalize_embeddings === undefined) {
            throw new ChromaValueError("model_name, device, and normalize_embeddings are required");
        }

        return new SentenceTransformersEmbeddingFunction({
            modelName: model_name,
            device,
            normalizeEmbeddings: normalize_embeddings,
            kwargs: kwargs || {},
        });
    }

    public getConfig(): SentenceTransformersConfig {
        return {
            model_name: this.modelName,
            device: this.device,
            normalize_embeddings: this.normalizeEmbeddings,
            kwargs: this.kwargs,
        };
    }

View on GitHub (pinned to aecdd12c8a)