telemetry-dev-litellm 0.1.2__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: telemetry-dev-litellm
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: LiteLLM integration for telemetry.dev Python SDK
5
5
  Keywords: telemetry,opentelemetry,llm,genai,litellm,tracing
6
6
  Author: telemetry.dev
@@ -14,9 +14,9 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Typing :: Typed
17
- Requires-Dist: telemetry-dev>=0.2.0
17
+ Requires-Dist: telemetry-dev>=0.2.6
18
18
  Requires-Dist: litellm>=1.90.2,<2.0
19
- Requires-Dist: opentelemetry-api>=1.35.0,<2
19
+ Requires-Dist: opentelemetry-api>=1.39.0,<2
20
20
  Requires-Python: >=3.10, <3.14
21
21
  Project-URL: Homepage, https://telemetry.dev
22
22
  Project-URL: Repository, https://github.com/telemetry-dev/telemetry
@@ -24,7 +24,7 @@ Description-Content-Type: text/markdown
24
24
 
25
25
  # telemetry-dev-litellm
26
26
 
27
- LiteLLM integration for the telemetry.dev Python SDK. It instruments `litellm.completion`, `litellm.acompletion`, `litellm.embedding`, `litellm.aembedding`, streaming `CustomStreamWrapper` responses, and `litellm.Router` calls by emitting spans through the public `telemetry_dev.start_span` API.
27
+ LiteLLM integration for the telemetry.dev Python SDK. It instruments LiteLLM completion, Responses, embedding, and rerank APIs, including their async and streaming variants, and `litellm.Router` methods when available.
28
28
 
29
29
  ## Install
30
30
 
@@ -61,7 +61,7 @@ response = completion(
61
61
  )
62
62
  ```
63
63
 
64
- Available drop-ins: `completion`, `acompletion`, `embedding`, `aembedding`. Each resolves the current `litellm.<function>` at call time. If global instrumentation is already active, it delegates to the globally wrapped function so the call produces exactly one span.
64
+ Available drop-ins: `completion`, `acompletion`, `responses`, `aresponses`, `embedding`, `aembedding`, `rerank`, `arerank`. Each resolves the current `litellm.<function>` at call time. If global instrumentation is already active, it delegates to the globally wrapped function so the call produces exactly one span.
65
65
 
66
66
  ## Global instrumentation
67
67
 
@@ -74,12 +74,16 @@ response = litellm.completion(model="gpt-4o-mini", messages=[...])
74
74
  uninstrument_litellm()
75
75
  ```
76
76
 
77
- `instrument_litellm()` patches exactly four package attributes:
77
+ `instrument_litellm()` patches these package attributes when LiteLLM provides them:
78
78
 
79
79
  - `litellm.completion`
80
80
  - `litellm.acompletion`
81
81
  - `litellm.embedding`
82
82
  - `litellm.aembedding`
83
+ - `litellm.rerank`
84
+ - `litellm.arerank`
85
+ - `litellm.responses`
86
+ - `litellm.aresponses`
83
87
 
84
88
  It is thread-safe and idempotent. `uninstrument_litellm()` restores the original objects and is also idempotent.
85
89
 
@@ -129,7 +133,14 @@ Embedding spans use `type="embedding"` and emit `gen_ai.operation.name="embeddin
129
133
  - response model, usage, cost when available
130
134
  - no embedding vectors as output
131
135
 
132
- Usage keys follow the core SDK contract: `input_tokens`, `output_tokens`, `total_tokens`, `cache_read_input_tokens`, `cache_creation_input_tokens`, and `reasoning_output_tokens`.
136
+ Rerank spans emit `gen_ai.operation.name="rerank"`:
137
+
138
+ - request model, provider, query, documents, ranking options, and metadata
139
+ - response id, ranked results and scores, result count, provider search units, token usage, and cost when available
140
+
141
+ Responses spans emit `gen_ai.operation.name="chat"` and capture request input, instructions, sampling options, metadata, response output/status/id, usage, cost, and provider. Streaming Responses events are handled separately from chat chunks; terminal failure and error events mark the span as failed, and early close records the partial output collected so far.
142
+
143
+ Aggregate usage keys are `input_tokens`, `output_tokens`, `total_tokens`, `cache_read_input_tokens`, `cache_creation_input_tokens`, and `reasoning_output_tokens`. The core contract also includes modality fields; Responses usage emits text, image, and audio input/output token details when LiteLLM exposes them.
133
144
 
134
145
  ## Streaming
135
146
 
@@ -166,7 +177,7 @@ LiteLLM's synchronous response metadata is used when available: `_hidden_params.
166
177
 
167
178
  ## Limitations
168
179
 
169
- - Instrumented surfaces are limited to `completion`, `acompletion`, `embedding`, `aembedding`, and the same four methods on `Router` via `wrap_router`. `text_completion`, `litellm.responses`, image/audio/rerank/batch APIs, and provider-specific APIs are out of scope for this package version.
180
+ - Instrumented surfaces are limited to `completion`, `acompletion`, `responses`, `aresponses`, `embedding`, `aembedding`, `rerank`, `arerank`, and the corresponding methods available on `Router` via `wrap_router`. `text_completion`, image/audio/batch APIs, and provider-specific APIs are out of scope for this package version.
170
181
  - References imported from LiteLLM before `instrument_litellm()` are not patched.
171
182
  - Internal `num_retries` retries are not separate spans; Router deployment attempts are.
172
183
  - OTel's built-in-tools scenario is not portable across LiteLLM providers and is not covered by the examples.
@@ -1,6 +1,6 @@
1
1
  # telemetry-dev-litellm
2
2
 
3
- LiteLLM integration for the telemetry.dev Python SDK. It instruments `litellm.completion`, `litellm.acompletion`, `litellm.embedding`, `litellm.aembedding`, streaming `CustomStreamWrapper` responses, and `litellm.Router` calls by emitting spans through the public `telemetry_dev.start_span` API.
3
+ LiteLLM integration for the telemetry.dev Python SDK. It instruments LiteLLM completion, Responses, embedding, and rerank APIs, including their async and streaming variants, and `litellm.Router` methods when available.
4
4
 
5
5
  ## Install
6
6
 
@@ -37,7 +37,7 @@ response = completion(
37
37
  )
38
38
  ```
39
39
 
40
- Available drop-ins: `completion`, `acompletion`, `embedding`, `aembedding`. Each resolves the current `litellm.<function>` at call time. If global instrumentation is already active, it delegates to the globally wrapped function so the call produces exactly one span.
40
+ Available drop-ins: `completion`, `acompletion`, `responses`, `aresponses`, `embedding`, `aembedding`, `rerank`, `arerank`. Each resolves the current `litellm.<function>` at call time. If global instrumentation is already active, it delegates to the globally wrapped function so the call produces exactly one span.
41
41
 
42
42
  ## Global instrumentation
43
43
 
@@ -50,12 +50,16 @@ response = litellm.completion(model="gpt-4o-mini", messages=[...])
50
50
  uninstrument_litellm()
51
51
  ```
52
52
 
53
- `instrument_litellm()` patches exactly four package attributes:
53
+ `instrument_litellm()` patches these package attributes when LiteLLM provides them:
54
54
 
55
55
  - `litellm.completion`
56
56
  - `litellm.acompletion`
57
57
  - `litellm.embedding`
58
58
  - `litellm.aembedding`
59
+ - `litellm.rerank`
60
+ - `litellm.arerank`
61
+ - `litellm.responses`
62
+ - `litellm.aresponses`
59
63
 
60
64
  It is thread-safe and idempotent. `uninstrument_litellm()` restores the original objects and is also idempotent.
61
65
 
@@ -105,7 +109,14 @@ Embedding spans use `type="embedding"` and emit `gen_ai.operation.name="embeddin
105
109
  - response model, usage, cost when available
106
110
  - no embedding vectors as output
107
111
 
108
- Usage keys follow the core SDK contract: `input_tokens`, `output_tokens`, `total_tokens`, `cache_read_input_tokens`, `cache_creation_input_tokens`, and `reasoning_output_tokens`.
112
+ Rerank spans emit `gen_ai.operation.name="rerank"`:
113
+
114
+ - request model, provider, query, documents, ranking options, and metadata
115
+ - response id, ranked results and scores, result count, provider search units, token usage, and cost when available
116
+
117
+ Responses spans emit `gen_ai.operation.name="chat"` and capture request input, instructions, sampling options, metadata, response output/status/id, usage, cost, and provider. Streaming Responses events are handled separately from chat chunks; terminal failure and error events mark the span as failed, and early close records the partial output collected so far.
118
+
119
+ Aggregate usage keys are `input_tokens`, `output_tokens`, `total_tokens`, `cache_read_input_tokens`, `cache_creation_input_tokens`, and `reasoning_output_tokens`. The core contract also includes modality fields; Responses usage emits text, image, and audio input/output token details when LiteLLM exposes them.
109
120
 
110
121
  ## Streaming
111
122
 
@@ -142,7 +153,7 @@ LiteLLM's synchronous response metadata is used when available: `_hidden_params.
142
153
 
143
154
  ## Limitations
144
155
 
145
- - Instrumented surfaces are limited to `completion`, `acompletion`, `embedding`, `aembedding`, and the same four methods on `Router` via `wrap_router`. `text_completion`, `litellm.responses`, image/audio/rerank/batch APIs, and provider-specific APIs are out of scope for this package version.
156
+ - Instrumented surfaces are limited to `completion`, `acompletion`, `responses`, `aresponses`, `embedding`, `aembedding`, `rerank`, `arerank`, and the corresponding methods available on `Router` via `wrap_router`. `text_completion`, image/audio/batch APIs, and provider-specific APIs are out of scope for this package version.
146
157
  - References imported from LiteLLM before `instrument_litellm()` are not patched.
147
158
  - Internal `num_retries` retries are not separate spans; Router deployment attempts are.
148
159
  - OTel's built-in-tools scenario is not portable across LiteLLM providers and is not covered by the examples.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "telemetry-dev-litellm"
3
- version = "0.1.2"
3
+ version = "0.1.4"
4
4
  description = "LiteLLM integration for telemetry.dev Python SDK"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -25,9 +25,9 @@ classifiers = [
25
25
  "Typing :: Typed",
26
26
  ]
27
27
  dependencies = [
28
- "telemetry-dev>=0.2.0",
28
+ "telemetry-dev>=0.2.6",
29
29
  "litellm>=1.90.2,<2.0",
30
- "opentelemetry-api>=1.35.0,<2",
30
+ "opentelemetry-api>=1.39.0,<2",
31
31
  ]
32
32
 
33
33
  [[project.authors]]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "telemetry-dev-litellm"
3
- version = "0.1.2"
3
+ version = "0.1.4"
4
4
  description = "LiteLLM integration for telemetry.dev Python SDK"
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -19,9 +19,9 @@ classifiers = [
19
19
  "Typing :: Typed",
20
20
  ]
21
21
  dependencies = [
22
- "telemetry-dev>=0.2.0",
22
+ "telemetry-dev>=0.2.6",
23
23
  "litellm>=1.90.2,<2.0",
24
- "opentelemetry-api>=1.35.0,<2",
24
+ "opentelemetry-api>=1.39.0,<2",
25
25
  ]
26
26
 
27
27
  [project.urls]