{"record":{"id":"7b63576167bc5c5d","repo":"chroma-core/chroma","slug":"fork-count-is-not-implemented-for-local-chroma","errorCode":null,"errorMessage":"Fork count is not implemented for Local Chroma","messagePattern":"Fork count is not implemented for Local Chroma","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"chromadb/api/rust.py","lineNumber":373,"sourceCode":"    def _fork(\n        self,\n        collection_id: UUID,\n        new_name: str,\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n    ) -> CollectionModel:\n        raise NotImplementedError(\n            \"Collection forking is not implemented for Local Chroma\"\n        )\n\n    @override\n    def _fork_count(\n        self,\n        collection_id: UUID,\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n    ) -> int:\n        raise NotImplementedError(\"Fork count is not implemented for Local Chroma\")\n\n    @override\n    def _get_indexing_status(\n        self,\n        collection_id: UUID,\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n    ) -> \"IndexingStatus\":\n        raise NotImplementedError(\"Indexing status is not implemented for Local Chroma\")\n\n    @override\n    def _search(\n        self,\n        collection_id: UUID,\n        searches: List[Search],\n        tenant: str = DEFAULT_TENANT,\n        database: str = DEFAULT_DATABASE,\n        read_level: ReadLevel = ReadLevel.INDEX_AND_WAL,","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/chroma-core/chroma/blob/aecdd12c8a891610db8653630b066b32ceb678b5/chromadb/api/rust.py#L355-L391","documentation":"RustBindingsAPI._fork_count (chromadb/api/rust.py:373) is a deliberate stub. Counting forks of a collection (Collection.fork_count) is a Chroma-server capability; in embedded mode with the Rust bindings there is no fork lineage to count, so the call always raises NotImplementedError.","triggerScenarios":"client = chromadb.RustClient(...); client.get_collection('docs').fork_count() - or the async equivalent. Any Collection.fork_count() call routed to the Rust bindings backend.","commonSituations":"Monitoring or lineage-audit code that worked against a Chroma server being run against an embedded Rust client; sharing utility code between server and embedded deployments.","solutions":["Point the code at a Chroma server via chromadb.HttpClient - the server tracks fork lineage and supports fork_count","Track fork relationships yourself in application metadata (e.g. store parent collection id in the forked collection's metadata)","Guard the call with a backend capability check and skip/return 0 when embedded"],"exampleFix":"# before (raises NotImplementedError)\ncount = client.get_collection('docs').fork_count()\n\n# after - only call on server-backed clients\nif type(client._server).__module__.startswith('chromadb.api.fastapi'):\n    count = client.get_collection('docs').fork_count()\nelse:\n    count = 0  # embedded mode has no fork lineage","handlingStrategy":"try-catch","validationCode":"def fork_count_safe(collection, default: int = 0) -> int:\n    try:\n        return collection.fork_count()\n    except NotImplementedError:\n        return default  # embedded backend has no fork lineage","typeGuard":null,"tryCatchPattern":"try:\n    count = collection.fork_count()\nexcept NotImplementedError as e:\n    # embedded mode: no fork support\n    count = 0","preventionTips":["Query fork lineage only from server-backed (HttpClient) deployments","Record parent/child collection relationships in collection metadata when you need lineage embedded","Centralize backend capability checks instead of scattering try/except at call sites"],"tags":["chroma","embedded-mode","rust-bindings","fork-count","not-implemented"],"backgroundTag":"feature-unsupported-in-embedded-mode","analyzedSha":"aecdd12c8a891610db8653630b066b32ceb678b5","analyzedAt":"2026-08-16T21:53:27.228Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}