Skip to content

feat: add LiteLLM Responses API attribute extraction and test canary#1413

Closed
icohangar-ops wants to merge 1 commit into
AgentOps-AI:mainfrom
icohangar-ops:feat/litellm-responses-api
Closed

feat: add LiteLLM Responses API attribute extraction and test canary#1413
icohangar-ops wants to merge 1 commit into
AgentOps-AI:mainfrom
icohangar-ops:feat/litellm-responses-api

Conversation

@icohangar-ops

Copy link
Copy Markdown

Partially addresses #1028

Summary

Adds the LiteLLM instrumentation provider with attribute extraction for the Responses API endpoint (litellm.responses()). The handler normalizes ResponsesAPIResponse fields to standard OTel span attributes.

Changes

  • agentops/instrumentation/providers/litellm/__init__.py — LiteLLM instrumentation provider package marker
  • agentops/instrumentation/providers/litellm/wrappers/ — wrapper modules
  • agentops/instrumentation/providers/litellm/wrappers/responses.py — attribute extraction from ResponsesAPIResponse objects (input_tokens/output_tokens → prompt_tokens/completion_tokens mapping)
  • tests/core_manual_tests/providers/litellm_canary.py — integration test for chat completion, streaming, and async paths

Notes

This is the attribute extraction layer. Full wiring into LiteLLM's callback pipeline (success_callback = ["agentops"]) requires additional changes in the LiteLLM callback integration modules.

Adds a LiteLLM instrumentation provider directory with attribute
extraction for the LiteLLM Responses API endpoint. The handler
normalizes ResponsesAPIResponse fields (input_tokens/output_tokens)
to the standard OTel span attribute format.

Partially addresses #1028
@icohangar-ops icohangar-ops closed this by deleting the head repository Jun 20, 2026
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

Successfully merging this pull request may close these issues.

1 participant