chroma-core/chroma · error · ChromaValueError

Model name cannot be updated

Error message

Model name cannot be updated

What it means

Raised by MistralEmbeddingFunction.validateConfigUpdate when an attempted configuration update includes a model value that differs from the function's current model. The embedding model is fixed at construction time because changing it would make existing stored embeddings incomparable, so any config update that alters it is rejected.

Solutions

  1. Keep `model` unchanged in the update config
  2. Create a new MistralEmbeddingFunction with the new model and a fresh collection
  3. Compare against getConfig().model first
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at clients/new-js/packages/ai-embeddings/mistral/src/index.ts:84 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/21f268fc9ff6468e. Report an issue: GitHub.

Appendix: source

Thrown at clients/new-js/packages/ai-embeddings/mistral/src/index.ts:84

  public static buildFromConfig(
    config: MistralConfig,
  ): MistralEmbeddingFunction {
    return new MistralEmbeddingFunction({
      model: config.model,
      apiKeyEnvVar: config.api_key_env_var,
    });
  }

  public getConfig(): MistralConfig {
    return {
      api_key_env_var: this.apiKeyEnvVar,
      model: this.model,
    };
  }

  public validateConfigUpdate(newConfig: Record<string, any>): void {
    if (this.getConfig().model !== newConfig.model) {
      throw new ChromaValueError("Model name cannot be updated");
    }
  }

  public static validateConfig(config: MistralConfig): void {
    validateConfigSchema(config, NAME);
  }
}

registerEmbeddingFunction(NAME, MistralEmbeddingFunction);

View on GitHub (pinned to aecdd12c8a)