-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Install issue]: Packaging and Deployment Issue with chromadb-client in AWS Lambda #2231
Comments
Note: also getting the following message when trying to install chromadb-client in the linux env. although when installing those manually, system responds that the requirement is already satisfied
|
@marichkazb, thanks for reaching out. Let me start by saying that your approach to Lambda is correct and is how many Chroma users are deploying/using Chroma in AWS. Your original error does not seem to be an actual Chroma issue. From the trace, it appears to be related to pydantic models in the OpenAI package. Regarding the second error, this appears to be some library version conflicts, which is a frequent thing in the fast-moving GenAI ecosystem. What are your system dependencies e.g. packages you have installed - Regarding your more specific question on the AWS Lambda. While I'll admit I am not expert in AWS stack, my personal preference would be a docker image over zipped dependencies. Have a look here for an example (https://github.com/erenyasarkurt/OpenAI-AWS-Lambda-Layer/blob/main/build/build.sh). I understand that you can easily bake a docker image, upload it to ECR, and use it as the basis for your Lambda. If you're interested, I'll happily provide you with a more detailed example. |
@tazarov thank you for your time!! I’ve created a docker image and currently use it as a basis for the Lambda function, it indeed resolved all dependency conflicts, thank you! 🙌🏻 Also, I was wondering if chroma uses any temporary files when quering the collection?
I’m using the following function I tried setting the home environment to /tmp in the Dockerfile using ENV HOME=/tmp, but it didn’t help. If you have any ideas on how to possibly fix this, I'd really appreciate it!
|
Did you figure out the /tmp folder issue @marichkazb or @tazarov ? |
What happened?
I am developing an application using the OpenAI API, combined with ChromaDB as a tool for Retrieval-Augmented Generation (RAG) to build a custom responsive chatbot powered with business data. Currently, I am deploying my application on AWS. The ChromaDB instance is running on CloudFormation, and my backend Python function is deployed as a Lambda function.
In my Lambda function, I need to connect to the ChromaDB instance to query the collection and retrieve data, which will later be embedded as context in a call to the OpenAI API.
In a lambda function I need to connect to chromadb instance to query collection and retrieve data to later embed it as context in a call to the OpenAI.
chroma_client = chromadb.HttpClient(host='11.111.111.11’, port=8000)
One way to include dependencies in Lambda functions is by uploading .zip packages to Lambda layers. I successfully packaged all dependencies, but encountered some issues with ChromaDB.
The original ChromaDB distribution is 107 MB when zipped, which exceeds the storage limits for both Lambda layers (50 MB max) and S3 buckets. I then discovered the smaller chromadb-client library, which can be uploaded to AWS. However, after including it, I encountered the following error, likely related to packaging. I tried both zipping on MacOS and Virtual Linux machine
My questions are:
1) Is the way I am handling ChromaDB in this example optimal? Am I on the right path for deploying the app on AWS?
2) Is there an official distribution of a zipped chromadb-client or chromadb that is compatible with Lambda Layers? How would you recommend to handle this issue?
Any help will be greatly appreciated! Thanks! 🙌🏻✨
Versions
chromadb-client 0.4.25.dev0
Python 3.10.12
MacOS 13.1/VM Linux Ubuntu
Relevant log output
The text was updated successfully, but these errors were encountered: