Skip to content
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

RAG, Langchain and Chromadb example #31

Merged
merged 5 commits into from
Jan 31, 2024

Conversation

MichaelClifford
Copy link
Collaborator

@MichaelClifford MichaelClifford commented Jan 30, 2024

This PR adds a new recipe rag-langchain to the repo. In this example we build only the ai-application code and rely on the existing playground image for our model service and the external chormaDB image for our vectorDB service.

rag-langchain/ai-studio.yaml Outdated Show resolved Hide resolved
rag-langchain/ai-studio.yaml Outdated Show resolved Hide resolved
@MichaelClifford MichaelClifford changed the title [WIP] RAG, Langchain and Chromadb example RAG, Langchain and Chromadb example Jan 30, 2024
rag-langchain/ai-studio.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@lstocchi lstocchi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with using the playground. My only concern is that we also need to have a playground-cuda if we're going to update the other samples

arch:
- arm64
- amd64
- name: chromadb-server
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a way to differentiate it from the sample app

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then idk how fast it is to start but if it's slow and the sample app fails to connect we need a way to listen to its port so when it's ready we can restart the sample app container. I need to test it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We talked with @jeffmaury earlier. Now we find the port to listen to by using the containerfile (we look at the EXPOSE). If we don't have it as we use an image, maybe it's better to specify the port inside the ai-studio.yaml. if you decompile the image you could see multiple ports (also some belonging to the parent image)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isen't it differentiated by the model-service=True parameter?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - any information you need to build the application will be best if included in the ai.yaml - so you only have to depend on that single file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't there be instances where you'd want the user to define the ports to use just before runtime?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so atm what we do is, if model_service=true we mount the volume/set he model_path else we set the model_endpoint env.
When running the chromadb service the model_endpoint is not really necessary, so it would be nice to know if the item we are handling is the sample app or the vector db.

Regarding the port, by reading the readme i see that we should run podman run -it -p 8000:8000 chroma but where do i take the port value i have to open if we do not add it in the ai-studio?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add a flag vectordb=true?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep in mind to be as much generic as we can. I don't see why we need to differentiate client app and vector db. If we need to pass the port to another container then we should do like what is done in Kubernetes ie have env var named CONTAINER_NAME_PORT

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffmaury i don't get your point. We need to know if we are working with a sample app or a vectorDB. When dealing with the sample app container we need to open its port into the pod so that it can be reached, nothing for the vectorDB. For the sample app we also need to fill the env variable so that it can connect to the model service, nothing for the vectorDB apparently. So there is a difference when adding a sample app or a vectorDB to the pod.

rag-langchain/rag_app.py Show resolved Hide resolved
rag-langchain/rag_app.py Show resolved Hide resolved
Copy link
Collaborator

@sallyom sallyom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@sallyom sallyom merged commit c248cc2 into containers:main Jan 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants