chroma icon indicating copy to clipboard operation
chroma copied to clipboard

[Install issue]:

Open Ponkkkkk opened this issue 2 years ago • 10 comments

Chromadb keeps being in client mode

I tried to install chromadb following the tutorial and it works at first, then it suddenly have this error

Chroma is running in http-only client mode, and can only be run with 'chromadb.api.fastapi.FastAPI' as the chroma_api_impl. see https://docs.trychroma.com/usage-guide?lang=py#using-the-python-http-only-client for more information.

After using client = chromadb.HttpClient(host='localhost', port=8000) like the tutorial, it still have an error

raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=8000): Max retries exceeded with url: /api/v1 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x14fdf6fd0>: Failed to establish a new connection: [Errno 61] Connection refused'))

I tried docker compose up -d but it does not work.

Versions

python 3.10, mac OS Big Sur

Relevant log output

No response

Ponkkkkk avatar Aug 08 '23 07:08 Ponkkkkk

@Ponkkkkk can you share your docker-compose (unless it is the default), then run docker-compose up (without the -d flag, and share the logs).

As a debugging step once you have your docker compose up you can test connectivity with curl or nc:

  • curl -v http://localhost:8000/api/v1/
  • nc -zv localhost 8000

tazarov avatar Aug 08 '23 15:08 tazarov

Also are you pip installing chromadb or chromadb-client?

HammadB avatar Aug 08 '23 21:08 HammadB

It works again somehow. I used chromadb but it says it is running on http mode all of a sudden, so i used chromadb-client and it still didn’t work. I just let it be and at night when I tried it again, it runs.

Ponkkkkk avatar Aug 09 '23 09:08 Ponkkkkk

does chromadb allows different indexing like ivf? I know I can use hnsw but I could not find any documentation on it and don’t know if we are able to tune the hnw params.

Ponkkkkk avatar Aug 09 '23 09:08 Ponkkkkk

@Ponkkkkk, only hnsw is currently supported. You can see the params in the code here: https://github.com/chroma-core/chroma/blob/main/chromadb/segment/impl/vector/hnsw_params.py

tazarov avatar Aug 09 '23 11:08 tazarov

Is this the correct way to update the collection metadata after creating it? I tried collection.modify( name=’Test’, metadata={ "hnsw:construction_ef": 128, "hnsw:search_ef": 30, } )

and then running get_collection(‘Test’) returns this,

before modify() name='Test' id=UUID('57cecf99-6ce2-44f3-887b-4e15e1366f57') metadata={'hnsw:M': 64, 'hnsw:construction_ef': 64, 'hnsw:search_ef': 4, 'hnsw:space': 'cosine'}

after modify() name='Test' id=UUID('57cecf99-6ce2-44f3-887b-4e15e1366f57') metadata={'hnsw:construction_ef': 128, 'hnsw:search_ef': 30}

which delete my M and distance metric medatata. Furthermore I am also able to change the construction_ef which is normally immutable in other vector DBs.

Ponkkkkk avatar Aug 11 '23 08:08 Ponkkkkk

@Ponkkkkk at the moment changing hyper parameters is not supported using collection.modify. Might I suggest you try to create a new collection with your new hyper parameters and then transfer your doc/embeddings/ids/metadata to the new collection.

tazarov avatar Aug 11 '23 09:08 tazarov

How do you transfer the embeddings to another collection? Do you mean just create a new one and then reinsert all data? How about for exact search or brute force? does chroma supports it?

Ponkkkkk avatar Aug 14 '23 13:08 Ponkkkkk

I face the same problems, but I can't still work up to now

dandan950 avatar Apr 29 '24 08:04 dandan950

@Ponkkkkk, here is an example of this - https://cookbook.chromadb.dev/core/collections/#cloning-a-collection

tazarov avatar Apr 29 '24 16:04 tazarov