chroma icon indicating copy to clipboard operation
chroma copied to clipboard

Simplify Client init for Local or Rest

Open jeffchuber opened this issue 2 years ago • 2 comments

Currently users need to remember specific syntax to use chroma in local mode with persistence or API mode.

# init persistance
from chromadb.config import Settings
client = chromadb.Client(Settings(
    chroma_db_impl="duckdb+parquet",
    persist_directory="/path/to/persist/directory"
))

# init rest client
import chromadb
from chromadb.config import Settings
chroma_client = chromadb.Client(Settings(chroma_api_impl="rest",
                                        chroma_server_host="localhost",
                                        chroma_server_http_port="8000"
                                    ))

What do we think about simplifying the API (in a backwards compatible way)? Something like this

# init persistance
client = chromadb.LocalClient(persist_directory="/path/to/persist/directory")

# init rest client
chroma_client = chromadb.RestClient(url="localhost:8000")

The javascript client doesn't have this "problem" because we currently do not support in-memory for JS, but it may be a good idea to mirror the APIs none-the-less for future-proofing.

jeffchuber avatar Apr 03 '23 00:04 jeffchuber

I think #214 is supposed to introduce a simplified settings? cc @levand

HammadB avatar Apr 03 '23 16:04 HammadB

awesome! apologies if i missed this.

jeffchuber avatar Apr 03 '23 17:04 jeffchuber

closed in favor of https://github.com/chroma-core/chroma/issues/714

jeffchuber avatar Jun 23 '23 16:06 jeffchuber