-
Notifications
You must be signed in to change notification settings - Fork 726
🚀 Feature: Callback Hooks for LLM Instrumentation Libraries #2813
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
Comments
@kujjwal02 sounds good - I would just add it directly in the instrumentation :) |
Hi @nirga |
Ah I mean just implement it directly without the hooks - we're happy to support it quickly :) |
Awesome, Thanks. Any thoughts on hooks though? |
I'm fine with adding hooks but would love for an upstream contributiion to the prompt caching + cost tracking feature you mentioned :) |
I can take up both prompt caching + cost tracking and hook and submit a PR asap (separately). Let me know if that works |
Which component is this feature for?
Bedrock Instrumentation
🔖 Feature description
Ability to pass a callback hook to the instrumentors which takes in the span aditiona attibutes line request and response.
The callback function can update the spans with new additiona attributes
🎤 Why is this feature needed ?
It will allow us to record more metrics and add more attributes which are not already implemeted.
This will allow us to extend the functionaly of the instrumentor using custom logic without waiting the functionality to be implemented in the core library.
Eg, I want the below 2 features asap
Would love to contribute and implement these features directly, but having a callback hook will allow us to not wait for it (or any other custom attributes which does not make sense to core library, eg org_id, etc..) to be part of the core library
✌️ How do you aim to achieve this?
Not fully sure yet.
Maybe something like how Django Instrumentor does it.
Request and Response hooks
🔄️ Additional Information
No response
👀 Have you spent some time to check if this feature request has been raised before?
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered: