chromadb-zerodb
Chroma-compatible API backed by ZeroDB cloud. No Docker, no server, instant vector DB.
Drop-in replacement for chromadb — same Collection API, but vectors are stored in ZeroDB cloud. Auto-provisions on first use. Free tier included.
Why?
| chromadb | chromadb-zerodb | |
|---|---|---|
| Setup | Docker server or in-memory (lost on restart) | pip install and go |
| Persistence | Requires server config | Cloud-persisted automatically |
| Embeddings | Bring your own | Free BAAI BGE models included |
| Scaling | Self-managed | Managed infrastructure |
| Cost | Server hosting | Free tier, pay as you grow |
Install
pip install chromadb-zerodb
Quick Start
import chromadb_zerodb as chromadb
# Auto-provisions a free project on first use
client = chromadb.Client()
# Create a collection
collection = client.create_collection("my_docs")
# Add documents (auto-embedded with free BGE models)
collection.add(
documents=[
"Python is a great programming language",
"JavaScript powers the web",
"Rust is fast and memory-safe",
],
ids=["doc1", "doc2", "doc3"],
metadatas=[
{"topic": "python"},
{"topic": "javascript"},
{"topic": "rust"},
],
)
# Query by text
results = collection.query(
query_texts=["best language for beginners"],
n_results=2,
)
print(results["documents"]) # [["Python is a great...", "JavaScript powers..."]]
print(results["distances"]) # [[0.05, 0.12]]
Migration from chromadb
Change one import:
# Before
import chromadb
client = chromadb.Client()
# After
import chromadb_zerodb as chromadb
client = chromadb.Client()
Everything else stays the same.
Authentication
Three ways to authenticate (checked in order):
-
Constructor arguments:
client = chromadb.Client(api_key="zdb_...", project_id="proj_...")
-
Environment variables:
export ZERODB_API_KEY=zdb_... export ZERODB_PROJECT_ID=proj_...
-
Auto-provision: If neither is set, a free project is created automatically. Credentials are cached in
~/.zerodb/credentials.json.
API Reference
Client
client = chromadb.Client(api_key=None, project_id=None, base_url=None)
client.create_collection(name, metadata=None) # -> Collection
client.get_collection(name) # -> Collection
client.get_or_create_collection(name, metadata=None) # -> Collection
client.list_collections() # -> List[str]
client.delete_collection(name) # -> None
client.heartbeat() # -> int (nanosecond timestamp)
Collection
collection.add(
ids=None, # auto-generated if omitted
documents=None, # auto-embedded if provided
embeddings=None, # or pass pre-computed vectors
metadatas=None,
)
collection.query(
query_texts=None,
query_embeddings=None,
n_results=10,
where=None, # metadata filter
)
# Returns: {"ids": [[...]], "documents": [[...]], "metadatas": [[...]], "distances": [[...]]}
collection.get(ids=None, where=None)
# Returns: {"ids": [...], "documents": [...], "metadatas": [...]}
collection.update(ids, documents=None, embeddings=None, metadatas=None)
collection.upsert(ids, documents=None, embeddings=None, metadatas=None)
collection.delete(ids=None, where=None)
collection.count() # -> int
Bring Your Own Embeddings
collection.add(
ids=["id1"],
embeddings=[[0.1, 0.2, 0.3, ...]], # your vectors
documents=["the original text"],
metadatas=[{"source": "my_model"}],
)
collection.query(
query_embeddings=[[0.1, 0.2, 0.3, ...]],
n_results=5,
)
Metadata Filtering
results = collection.query(
query_texts=["search term"],
where={"topic": "python"},
n_results=5,
)
How It Works
- Collections are namespaced via ID prefixes (
collection_name::doc_id) - Auto-embedding uses ZeroDB's free BAAI BGE-M3 model
- Storage is ZeroDB's managed vector database (same infra as ZeroDB MCP)
- Credentials are cached at
~/.zerodb/credentials.json
Links
License
MIT
Metadata
Release files for chromadb-zerodb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| chromadb_zerodb-0.1.0.tar.gz | 10.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| chromadb_zerodb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.3 kB
Release files / chromadb_zerodb-0.1.0.tar.gz
| Download URL | chromadb_zerodb-0.1.0.tar.gz |
|---|---|
| Size | 10.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ae8e1dcfb5ea3bd0efde90378cfc5d67b7d534b7e24d5778060255ca52e1f02
|
|
BLAKE2b-256 checksum How to use checksums |
cb7a4beb33443892c35d760852597d13c8903d5de27a8b671011632ec17b983a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / chromadb_zerodb-0.1.0-py3-none-any.whl
| Download URL | chromadb_zerodb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ec8b3968fda7d890c681f8eff8a8e6bca29b4bc794242eddb52655434f839bdd
|
|
BLAKE2b-256 checksum How to use checksums |
64cbc3b7b7d98d536fdad81f45ae4a6cf54e20aa1bd93a9076e497b1b03be0e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for chromadb-zerodb 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.