agenta icon indicating copy to clipboard operation
agenta copied to clipboard

[Enhancement]: add integration with litellm for observability

Open aybruhm opened this issue 1 year ago • 2 comments

Description

This PR allows litellm integration for observability.

Related Issue

Closes #1582

Additional Information

The example demonstrating LiteLLM integration for observability is titled "litellm_integration". This example is included in the pull request.

aybruhm avatar May 02 '24 12:05 aybruhm

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 6, 2024 2:13pm

vercel[bot] avatar May 02 '24 12:05 vercel[bot]

Closes #1569

mmabrouk avatar May 12 '24 18:05 mmabrouk

The input for this span is totally wrong. Let's look at how others process the data from litellm and copy it ( a note here, everyone seems to be using the response_obj while we are using kwargs, why?)

They're not. Check out this and this. The kwargs in log_pre_api_call contain the prepared data for the LLM provider. We only have access to response_obj after receiving a response from the LLM provider.

re: @mmabrouk

aybruhm avatar Jun 05 '24 09:06 aybruhm

The input for this span is totally wrong. Let's look at how others process the data from litellm and copy it ( a note here, everyone seems to be using the response_obj while we are using kwargs, why?)

They're not. Check out this and this. The kwargs in log_pre_api_call contain the prepared data for the LLM provider. We only have access to response_obj after receiving a response from the LLM provider.

re: @mmabrouk

You are right. Sorry for missing that. However, the input for the span in the screenshot were wrong. It could be that the format that we are logging then is wrong (related to the issue we discussed this morning).

mmabrouk avatar Jun 05 '24 09:06 mmabrouk

The input for this span is totally wrong. Let's look at how others process the data from litellm and copy it ( a note here, everyone seems to be using the response_obj while we are using kwargs, why?)

They're not. Check out this and this. The kwargs in log_pre_api_call contain the prepared data for the LLM provider. We only have access to response_obj after receiving a response from the LLM provider. re: @mmabrouk

You are right. Sorry for missing that. However, the input for the span in the screenshot were wrong. It could be that the format that we are logging then is wrong (related to the issue we discussed this morning).

Yup, correct. This has been resolved.

aybruhm avatar Jun 05 '24 11:06 aybruhm

Thanks @aybruhm ! Great work!

mmabrouk avatar Jun 06 '24 19:06 mmabrouk