You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a CLI-based chatbot prototype using ChromaDB with SentenceTransformers and a persistent local database. To make it shareable with non-technical users, I attempted to package it using PyInstaller — but ran into significant issues due to dynamic imports and embedding function validation in ChromaDB (v0.4.16+).
This issue documents those findings and may be helpful to others attempting similar packaging strategies. Yes, AI helped me write this, and I hope it's helpful to you.
Embedding: Custom EmbeddingFunction using sentence-transformers
Packager: PyInstaller 6.5.0
App: CLI chatbot that queries multiple collections
Problem 1: EmbeddingFunction interface mismatch
Error:
ValueError: Expected EmbeddingFunction.__call__ to have the following signature: odict_keys(['self', 'input']), got odict_keys(['self', 'args', 'kwargs'])
📘 Documentation: It would be helpful to document Chroma’s reliance on dynamic imports and what embedding/segment modules are required for local use.
⚙️ Static mode?: Consider offering a “static embedding + sqlite” mode that avoids lazy loading or plugin discovery — ideal for CLI and embedded apps.
Final Notes
If helpful, I'm happy to share:
A working CLI demo script
The full .spec file
Repro steps and final packaged CLI tool
Thanks for the great work — ChromaDB is fantastic for local, lightweight AI apps. Just wanted to surface some of the rough edges when packaging for offline users.
What happened?
Summary
I'm building a CLI-based chatbot prototype using ChromaDB with SentenceTransformers and a persistent local database. To make it shareable with non-technical users, I attempted to package it using PyInstaller — but ran into significant issues due to dynamic imports and embedding function validation in ChromaDB (v0.4.16+).
This issue documents those findings and may be helpful to others attempting similar packaging strategies. Yes, AI helped me write this, and I hope it's helpful to you.
Environment
PersistentClient(path="./chroma_db")
(SQLite)EmbeddingFunction
usingsentence-transformers
Problem 1: EmbeddingFunction interface mismatch
Error:
🔧 Fix: Wrapped model like this:
Problem 2: Dynamic import errors in PyInstaller build
Each PyInstaller run failed with a new error. Examples:
ModuleNotFoundError: No module named 'chromadb.telemetry.product.posthog'
ModuleNotFoundError: No module named 'chromadb.segment.impl.metadata.sqlite'
ModuleNotFoundError: No module named 'chromadb.execution.executor.local'
🔧 Fix: Required a large list of
hiddenimports
in the.spec
file:Suggestions
Final Notes
If helpful, I'm happy to share:
.spec
fileThanks for the great work — ChromaDB is fantastic for local, lightweight AI apps. Just wanted to surface some of the rough edges when packaging for offline users.
Versions
PersistentClient(path="./chroma_db")
(SQLite)EmbeddingFunction
usingsentence-transformers
Relevant log output
The text was updated successfully, but these errors were encountered: