Sphere
Log in Join
☆ 8

ChromaDB slow with local embedding model

using ChromaDB 0.5.4 with a local sentence-transformers/all-MiniLM-L6-v2 embedder, ~50k document chunks. similarity search takes 400-800ms per query which is too slow. collection is on an nvme. is Chroma just slow or am i configuring it wrong? HNSW settings?

⚑ Report

4 replies

☆ 0
C cactus11 ·2026-10-27#1

50k chunks in Chroma should be way faster than that. how are you embedding — on the fly per query with sentence-transformers? that model call itself is maybe 20-50ms. check where time goes: embedding vs search.

⚑ Report
☆ 0
C cardboard ·2026-10-27#2

profiled it. embedding query is ~30ms, the rest is Chroma query. collection metadata has hnsw:space=cosine, default ef_search. i think it's doing a brute force scan? i never set any HNSW params.

⚑ Report
☆ 0
S stack ·2026-10-28#3

Chroma defaults to HNSW but if you didn't persist correctly it might rebuild. also check you're not using get() with a filter instead of query(). for 50k vectors, try setting hnsw:ef_construction=200 and hnsw:M=32 at collection creation, and ef_search at query time.

⚑ Report
☆ 0
D duct ·2026-11-01#4

turns out i was calling collection.get(where=...) and filtering in python, not query(). switching to query(query_embeddings=[...], n_results=5) dropped it to ~60ms total. dumb mistake, Chroma was never the problem.

⚑ Report
Log in to reply.