chroma-core / chroma

the AI-native open-source embedding database
https://www.trychroma.com/
Apache License 2.0
15.07k stars 1.27k forks source link

[Feature Request]: Cache model download in Docker image #792

Open l0rinc opened 1 year ago

l0rinc commented 1 year ago

Describe the problem

I would like to avoid the redownload of the all-MiniLM-L6-v2 dependency

Describe the proposed solution

The following seems to work for me, but maybe there's a simpler solution by calling the appropriate Python method instead:

# https://github.com/chroma-core/chroma/blob/main/chromadb/utils/embedding_functions.py#L208
RUN MODEL_DIR="/root/.cache/chroma/onnx_models/all-MiniLM-L6-v2" &&\
    ARCHIVE_NAME="onnx.tar.gz" &&\
    mkdir -p $MODEL_DIR &&\
    cd $MODEL_DIR &&\
    wget -O $ARCHIVE_NAME "https://chroma-onnx-models.s3.amazonaws.com/all-MiniLM-L6-v2/$ARCHIVE_NAME" &&\
    tar -xzf $ARCHIVE_NAME

Alternatives considered

If this is good-enough, feel free to add it to the documentation. Alternatively, maybe

VOLUME /root/.cache/chroma

would be enough, but couldn't get it to work properly with IntelliJ runs...

Importance

nice to have

Additional Information

No response

einelson commented 1 year ago

I am having the same issue when deploying a python script that uses the chroma library.

I am deploying to docker and kubernetes, however loading the all-MiniLM-L6-v2 dependency is causing the container to break. I tried loading the library as suggested above, however the container is still breaking. Using chromadb==0.4.5.

If there are any suggestions on how to fix this that would be much appreciated

jeffchuber commented 1 year ago

high order bit - make sure you can deploy an airgapped container.

tjbck commented 9 months ago

Looking for an elegant way to handle this issue, maybe having a configurable CACHE_DIR could be a solution?