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

Add support for collecting usage data from plugin responses #613

Closed
willsmanley opened this issue Aug 11, 2024 · 5 comments
Closed

Add support for collecting usage data from plugin responses #613

willsmanley opened this issue Aug 11, 2024 · 5 comments

Comments

@willsmanley
Copy link

I need to track token usage on a per-user and per-session basis as I'm sure many others do as well.

It would be nice to configure llm like this:

def token_usage_callback(usage_data):
    print(usage_data)

llm = openai.llm(
   model="gpt-4o", 
   token_usage_callback=token_usage_callback
)

and then you can store all of that usage data as needed for analytics and attribution

@willsmanley
Copy link
Author

hi @theomonnom what do you think about enabling usage attribution1 from plugins like this? is this already on your roadmap?

@yuyuma
Copy link
Contributor

yuyuma commented Oct 16, 2024

On Slack https://livekit-users.slack.com/archives/C07FY8WHGPM/p1729050553562499 David pointed me to this issue.

I just wanted to add that I'm also looking for usage data from plugin responses, specifically for realtime agent framework. The information is being sent on the wire through OpenAI websockets but is just not currently exposed by LiveKit.

@davidzhao
Copy link
Member

feature added in #984, will be released in 0.11.0

@yuyuma
Copy link
Contributor

yuyuma commented Oct 30, 2024

@davidzhao perhaps I've missed something but I took a brief look through #984 and didn't see anything related to exposing token usage for openai realtime plugin. was this issue only intended to bring usage data for voice pipeline agents for now?

@davidzhao
Copy link
Member

realtime plugin isn't exposing it yet.. tracking this effort in #1010

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

No branches or pull requests

3 participants