chroma-core/chroma · error · ValueError

Embedding function name not found in config: {ef_config}

Error message

Embedding function name not found in config: {ef_config}

What it means

While deserializing a collection's persisted configuration, the embedding_function block exists and its 'type' is not 'legacy', but the block has no 'name' key — the lookup ef_config['name'] raises KeyError, re-raised as this ValueError. The stored embedding-function config is structurally incomplete, so Chroma cannot tell which registered function to rebuild.

Source

Thrown at chromadb/api/collection_configuration.py:92

        hnsw_config = cast(HNSWConfiguration, config_json_map["hnsw"])
    if config_json_map.get("spann") is not None:
        spann_config = cast(SpannConfiguration, config_json_map["spann"])

    # Process embedding function configuration
    if config_json_map.get("embedding_function") is not None:
        ef_config = config_json_map["embedding_function"]
        if ef_config["type"] == "legacy":
            warnings.warn(
                "legacy embedding function config",
                DeprecationWarning,
                stacklevel=2,
            )
            ef = None
        else:
            try:
                ef_name = ef_config["name"]
            except KeyError:
                raise ValueError(
                    f"Embedding function name not found in config: {ef_config}"
                )
            try:
                ef = known_embedding_functions[ef_name]
            except KeyError:
                raise ValueError(
                    f"Embedding function {ef_name} not found. Add @register_embedding_function decorator to the class definition."
                )
            try:
                validate_embedding_function_config_is_safe(ef_name, ef_config["config"])
                ef = ef.build_from_config(ef_config["config"])  # type: ignore
            except Exception as e:
                raise ValueError(
                    f"Could not build embedding function {ef_config['name']} from config {ef_config['config']}: {e}"
                )
    else:
        ef = None

View on GitHub (pinned to aecdd12c8a)

Solutions

  1. Recreate the collection with a proper embedding function so a complete config is persisted.
  2. Repair the stored configuration JSON to include the correct name field.
  3. If the collection data matters, export the documents/embeddings first, then recreate and reimport.
Defensive patterns

Strategy: validation

Validate before calling

def ef_config_complete(config_json: dict) -> bool:
    ef = config_json.get("embedding_function")
    return ef is None or ef.get("type") == "legacy" or "name" in ef

assert ef_config_complete({"embedding_function": {"type": "known", "name": "onnx MiniLM-L6-v2", "config": {}}})

Try / catch

try:
    col = client.get_collection("docs")
except ValueError as e:
    if "name not found in config" in str(e):
        raise RuntimeError("stored embedding-function config is incomplete; recreate the collection") from e
    raise

Prevention

When it happens

Trigger: Stored config like {"embedding_function": {"type": "known"}} without "name"; collection metadata corrupted by manual edits or a partial migration; a test fixture writing hand-crafted configuration JSON.

Common situations: Upgrades that wrote incomplete configs; direct SQLite manipulation; importing data from another Chroma instance with a schema mismatch.

Related errors


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