- Newest
- Most votes
- Most comments
Hi,
If my understanding is right, you are using the Lambda function as an API or an integration layer to broker the requests towards bedrock. In this case, you are using Python [in lambda] only to utilise the AWS Python SDK (boto3) and the Langchain python libaries. Technically speaking, you could use the AWS SDK for Java and Langchain Java libraries as well [which is a 1:1 replacement of what you have done in Python]. Also, Python here is not used in the context of it's AI/ML prowess i.e. you are not using it for data exploration, analysis, aggregation, cleaning, model training etc.
So, the question is really long-term maintainability v/s short-term agility. From a long-term pov, I would suggest you move to AWS Java SDK and Langachain for java and convert your lambda to Java as well, this will help harmonise the tech skills required to maintain the E2E stack.
Hope this answers your question!
Thanks
Relevant content
- asked 3 months ago
- asked 3 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a year ago
Hi!
I see, yeah for long-term maintainability I was thinking of Java at least for this RAG approach. So I will build it in Java then. If in the future we need to do data exploration, analysis, aggregation, cleaning, model training etc. I could create another service in Python focused on that side and communicate it with the one in Java if needed right?
Hi
For data exploration, analysis, aggregation, cleaning, model training building a service in AWS Lambda is not a good fit [it has a 15 min timeout- not suitable for long running jobs]. You may want to use python as your primary programming language with Glue, SageMaker, EMR, ECS etc. These are the services which offer the ability to handle data processing for ML at scale.
So, you can continue to use Lambda to form a backend for your web application, this can continue to be in Java. Lambda will then work with the data/ML outputs created by Glue, SageMaker, EMR, ECS etc.
You can look at a simple example on this blog https://aws.amazon.com/blogs/machine-learning/call-an-amazon-sagemaker-model-endpoint-using-amazon-api-gateway-and-aws-lambda/
Thanks
Thank you so much Rama! ;)