Feature request: Instrumentation for popular GenAI frameworks #2625
Labels
feature-request
This item refers to a feature request for an existing or new utility
need-customer-feedback
Requires more customers feedback before making or revisiting a decision
need-more-information
Requires more information before making any calls
revisit-in-3-months
Blocked issues/PRs that need to be revisited
Use case
With the rise in popularity of GenAI, there are many developers and businesses building new GenAI workloads on AWS Lambda.
Frameworks like Langchain and LlamaIndex make it easy to build GenAI applications. When using these frameworks, it is useful to know what's happening inside of the framework to debug latency issues, quickly identify inputs and outputs from LLM calls, and create alarms when issues arise.
To implement this level of observability, the frameworks rely on Callback mechanisms (e.g. LangChain callbacks, LlamaIndex callbacks).
I am proposing a new module/feature for Powertools that enables Powertools users to simply import a library, and have automatic Traces generated from code that runs within these frameworks.
By providing this feature in Powertools, developers can have Traces directly in AWS X-Ray without the need of implementing their custom callbacks handlers, and without the need of write and maintain additional code.
I would suggest implementing this feature for LangChain initially, and to cover the Traces aspect to begin with.
Later on it may also be useful to have additional features such creating relevant metrics, and automatic instrumentation.
Solution/User Experience
The experience could look like this:
Alternative solutions
Today, possible solutions are 2:
build a Callback handler, and leverage Powertools for AWS Lambda to send Traces to AWS X-Ray
use OTEL-compatible libraries like OpenLLMetry and OpenInference to collect the execution data, and configure the AWS Distro for OpenTelemetry
Acknowledgment
Future readers
Please react with 👍 and your use case to help us understand customer demand.
The text was updated successfully, but these errors were encountered: