docs: chroma client documentation (#248)

This commit is contained in:
cachho
2023-07-13 03:47:17 +02:00
committed by GitHub
parent 0187669f80
commit 17ff0b0b35
2 changed files with 15 additions and 0 deletions

View File

@@ -453,6 +453,17 @@ for query in queries:
# Response: We divorced due to living apart for five years.
```
**Client Mode**. By defining a (ChromaDB) server, you can run EmbedChain as a client only.
```python
from embedchain import App
config = InitConfig(host="localhost", port="8080")
app = App(config)
```
This is useful for scalability. Say you have EmbedChain behind an API with multiple workers. If you separate clients and server, all clients can connect to the server, which only has to keep one instance of the database in memory. You also don't have to worry about replication.
To run a chroma db server, run `git clone https://github.com/chroma-core/chroma.git`, navigate to the directory (`cd chroma`) and then start the server with `docker-compose up -d --build`.
### Configs
This section describes all possible config options.
@@ -464,6 +475,8 @@ This section describes all possible config options.
|log_level|log level|string|WARNING|
|ef|embedding function|chromadb.utils.embedding_functions|{text-embedding-ada-002}|
|db|vector database (experimental)|BaseVectorDB|ChromaDB|
|host|hostname for (Chroma) DB server|string|None|
|port|port number for (Chroma) DB server|string, int|None|
#### **Add Config**

View File

@@ -17,6 +17,8 @@ class InitConfig(BaseConfig):
['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'].
:param ef: Optional. Embedding function to use.
:param db: Optional. (Vector) database to use for embeddings.
:param host: Optional. Hostname for the database server.
:param port: Optional. Port for the database server.
"""
self._setup_logging(log_level)