openlit 1.26.0__py3-none-any.whl → 1.27.0__py3-none-any.whl
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.
- openlit/__init__.py +2 -0
- openlit/evals/__init__.py +12 -0
- openlit/evals/all.py +169 -0
- openlit/evals/bias_detection.py +173 -0
- openlit/evals/hallucination.py +170 -0
- openlit/evals/toxicity.py +168 -0
- openlit/evals/utils.py +272 -0
- openlit/guard/__init__.py +12 -0
- openlit/guard/all.py +200 -0
- openlit/guard/prompt_injection.py +118 -0
- openlit/guard/restrict_topic.py +152 -0
- openlit/guard/sensitive_topic.py +126 -0
- openlit/guard/utils.py +228 -0
- openlit/semcov/__init__.py +16 -0
- {openlit-1.26.0.dist-info → openlit-1.27.0.dist-info}/METADATA +74 -18
- {openlit-1.26.0.dist-info → openlit-1.27.0.dist-info}/RECORD +18 -6
- {openlit-1.26.0.dist-info → openlit-1.27.0.dist-info}/LICENSE +0 -0
- {openlit-1.26.0.dist-info → openlit-1.27.0.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: openlit
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.27.0
|
4
4
|
Summary: OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects
|
5
5
|
Home-page: https://github.com/openlit/openlit/tree/main/openlit/python
|
6
6
|
Keywords: OpenTelemetry,otel,otlp,llm,tracing,openai,anthropic,claude,cohere,llm monitoring,observability,monitoring,gpt,Generative AI,chatGPT,gpu
|
@@ -13,9 +13,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.11
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
15
15
|
Classifier: Programming Language :: Python :: 3.13
|
16
|
+
Requires-Dist: anthropic (>=0.21.0,<0.22.0)
|
16
17
|
Requires-Dist: boto3 (>=1.34.0,<2.0.0)
|
17
18
|
Requires-Dist: botocore (>=1.34.0,<2.0.0)
|
18
19
|
Requires-Dist: gpustat (>=1.1.1,<2.0.0)
|
20
|
+
Requires-Dist: openai (>=1.1.1,<2.0.0)
|
19
21
|
Requires-Dist: opentelemetry-api (>=1.27.0,<2.0.0)
|
20
22
|
Requires-Dist: opentelemetry-exporter-otlp (>=1.27.0,<2.0.0)
|
21
23
|
Requires-Dist: opentelemetry-instrumentation (>=0.48b0,<0.49)
|
@@ -27,10 +29,11 @@ Project-URL: Repository, https://github.com/openlit/openlit/tree/main/openlit/py
|
|
27
29
|
Description-Content-Type: text/markdown
|
28
30
|
|
29
31
|
<div align="center">
|
30
|
-
<img src="https://github.com/openlit/.github/blob/main/profile/assets/wide-logo-no-bg.png?raw=true" alt="OpenLIT Logo" width="30%"
|
31
|
-
OpenTelemetry
|
32
|
+
<img src="https://github.com/openlit/.github/blob/main/profile/assets/wide-logo-no-bg.png?raw=true" alt="OpenLIT Logo" width="30%">
|
33
|
+
<h3>OpenTelemetry-native</h3>
|
34
|
+
<h1>AI Observability, Evaluation and Guardrails Framework</h1>
|
32
35
|
|
33
|
-
**[Documentation](https://docs.openlit.io/) | [Quickstart](#-getting-started) | [
|
36
|
+
**[Documentation](https://docs.openlit.io/) | [Quickstart](#-getting-started-with-llm-observability) | [Roadmap](#️-roadmap) | [Feature Request](https://github.com/openlit/openlit/issues/new?assignees=&labels=%3Araised_hand%3A+Up+for+Grabs%2C+%3Arocket%3A+Feature&projects=&template=feature-request.md&title=%5BFeat%5D%3A) | [Report a Bug](https://github.com/openlit/openlit/issues/new?assignees=&labels=%3Abug%3A+Bug%2C+%3Araised_hand%3A+Up+for+Grabs&projects=&template=bug.md&title=%5BBug%5D%3A)**
|
34
37
|
|
35
38
|
[](https://github.com/openlit/openlit)
|
36
39
|
[](https://github.com/openlit/openlit/blob/main/LICENSE)
|
@@ -39,7 +42,6 @@ OpenTelemetry Auto-Instrumentation for GenAI & LLM Applications</h1>
|
|
39
42
|
[](https://github.com/openlit/openlit/graphs/contributors)
|
40
43
|
|
41
44
|
[](https://join.slack.com/t/openlit/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ)
|
42
|
-
[](https://discord.gg/CQnXwNT3)
|
43
45
|
[](https://twitter.com/openlit_io)
|
44
46
|
|
45
47
|

|
@@ -47,11 +49,16 @@ OpenTelemetry Auto-Instrumentation for GenAI & LLM Applications</h1>
|
|
47
49
|
|
48
50
|
</div>
|
49
51
|
|
50
|
-
OpenLIT
|
52
|
+
OpenLIT SDK is a monitoring framework built on top of **OpenTelemetry** that gives your complete Observability for your AI stack, from LLMs to vector databases and GPUs, with just one line of code with tracing and metrics. It also allows you to send the generated traces and metrics to your existing monitoring tools like Grafana, New Relic, and more.
|
51
53
|
|
52
|
-
|
54
|
+
This project proudly follows and maintains the [Semantic Conventions](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai) with the OpenTelemetry community, consistently updating to align with the latest standards in Observability.
|
53
55
|
|
54
|
-
|
56
|
+
## ⚡ Features
|
57
|
+
|
58
|
+
- 🔎 **Auto Instrumentation**: Works with 30+ LLM providers, vector databases, and GPUs with just one line of code.
|
59
|
+
- 🔭 **OpenTelemetry-Native Observability SDKs**: Vendor-neutral SDKs that can send traces and metrics to your existing observability tool like Prometheus and Jaeger.
|
60
|
+
- 💲 **Cost Tracking for Custom and Fine-Tuned Models**: Pass custom pricing files for accurate budgeting of custom and fine-tuned models.
|
61
|
+
- 🚀 **Suppport for OpenLIT Features**: Includes suppprt for prompt management and secrets management features available in OpenLIT.
|
55
62
|
|
56
63
|
## Auto Instrumentation Capabilities
|
57
64
|
|
@@ -97,9 +104,9 @@ This project adheres to the [Semantic Conventions](https://github.com/open-telem
|
|
97
104
|
pip install openlit
|
98
105
|
```
|
99
106
|
|
100
|
-
## 🚀 Getting Started
|
107
|
+
## 🚀 Getting Started with LLM Observability
|
101
108
|
|
102
|
-
### Step 1: Install OpenLIT
|
109
|
+
### Step 1: Install OpenLIT SDK
|
103
110
|
|
104
111
|
Open your command line or terminal and run:
|
105
112
|
|
@@ -108,7 +115,7 @@ pip install openlit
|
|
108
115
|
```
|
109
116
|
|
110
117
|
### Step 2: Initialize OpenLIT in your Application
|
111
|
-
|
118
|
+
Integrate OpenLIT into your AI applications by adding the following lines to your code.
|
112
119
|
|
113
120
|
```python
|
114
121
|
import openlit
|
@@ -116,11 +123,14 @@ import openlit
|
|
116
123
|
openlit.init()
|
117
124
|
```
|
118
125
|
|
119
|
-
|
126
|
+
Configure the telemetry data destination as follows:
|
120
127
|
|
121
|
-
|
128
|
+
| Purpose | Parameter/Environment Variable | For Sending to OpenLIT |
|
129
|
+
|-------------------------------------------|--------------------------------------------------|--------------------------------|
|
130
|
+
| Send data to an HTTP OTLP endpoint | `otlp_endpoint` or `OTEL_EXPORTER_OTLP_ENDPOINT` | `"http://127.0.0.1:4318"` |
|
131
|
+
| Authenticate telemetry backends | `otlp_headers` or `OTEL_EXPORTER_OTLP_HEADERS` | Not required by default |
|
122
132
|
|
123
|
-
|
133
|
+
> 💡 Info: If the `otlp_endpoint` or `OTEL_EXPORTER_OTLP_ENDPOINT` is not provided, the OpenLIT SDK will output traces directly to your console, which is recommended during the development phase.
|
124
134
|
|
125
135
|
#### Example
|
126
136
|
|
@@ -171,19 +181,22 @@ To send telemetry to OpenTelemetry backends requiring authentication, set the `o
|
|
171
181
|
---
|
172
182
|
|
173
183
|
### Step 3: Visualize and Optimize!
|
174
|
-
|
184
|
+
Now that your LLM observability data is being collected and sent to configured OpenTelemetry destination, the next step is to visualize and analyze this data. This will help you understand your LLM application's performance and behavior and identify where it can be improved.
|
175
185
|
|
176
|
-
|
186
|
+
If you want to use OpenLIT's Observability Dashboard to monitor LLM usage—like cost, tokens, and user interactions—please check out our [Quickstart Guide](https://docs.openlit.io/latest/quickstart).
|
177
187
|
|
178
|
-
If you
|
188
|
+
If you're sending metrics and traces to other observability tools, take a look at our [Connections Guide](https://docs.openlit.io/latest/connections/intro) to start using a pre-built dashboard we have created for these tools.
|
179
189
|
|
180
190
|

|
181
191
|
|
182
192
|
|
183
|
-
|
193
|
+
## Configuration
|
194
|
+
|
195
|
+
### Observability - `openlit.init()`
|
184
196
|
|
185
197
|
Below is a detailed overview of the configuration options available, allowing you to adjust OpenLIT's behavior and functionality to align with your specific observability needs:
|
186
198
|
|
199
|
+
|
187
200
|
| Argument | Description | Default Value | Required |
|
188
201
|
|-------------------------|-----------------------------------------------------------------------------------------------|----------------|----------|
|
189
202
|
| `environment` | The deployment environment of the application. | `"default"` | Yes |
|
@@ -199,6 +212,49 @@ Below is a detailed overview of the configuration options available, allowing yo
|
|
199
212
|
| `pricing_json` | URL or file path of the pricing JSON file. | `https://github.com/openlit/openlit/blob/main/assets/pricing.json` | No |
|
200
213
|
| `collect_gpu_stats` | Flag to enable or disable GPU metrics collection. | `False` | No |
|
201
214
|
|
215
|
+
### OpenLIT Prompt Hub - `openlit.get_prompt()`
|
216
|
+
|
217
|
+
Below are the parameters for use with the SDK for OpenLIT Prompt Hub for prompt management:
|
218
|
+
|
219
|
+
| Parameter | Description |
|
220
|
+
|-------------------|------------------------------------------------------------------------------------------------------------------------------------|
|
221
|
+
| `url` | Sets the OpenLIT URL. Defaults to the `OPENLIT_URL` environment variable. |
|
222
|
+
| `api_key` | Sets the OpenLIT API Key. Can also be provided via the `OPENLIT_API_KEY` environment variable. |
|
223
|
+
| `name` | Sets the name to fetch a unique prompt. Use this or `prompt_id`. |
|
224
|
+
| `prompt_id` | Sets the ID to fetch a unique prompt. Use this or `name`. Optional |
|
225
|
+
| `version` | Set to `True` to get the prompt with variable substitution.. Optional |
|
226
|
+
| `shouldCompile` | Boolean value that compiles the prompt using the provided variables. Optional |
|
227
|
+
| `variables` | Sets the variables for prompt compilation. Optional |
|
228
|
+
| `meta_properties` | Sets the meta-properties for storing in the prompt's access history metadata. Optional |
|
229
|
+
|
230
|
+
### OpenLIT Vault - `openlit.get_secrets()`
|
231
|
+
|
232
|
+
Below are the parameters for use with the SDK for OpenLIT Vault for secret management:
|
233
|
+
|
234
|
+
| Parameter | Description |
|
235
|
+
|-------------------|------------------------------------------------------------------------------------------------------------------------------------|
|
236
|
+
| `url` | Sets the Openlit URL. Defaults to the `OPENLIT_URL` environment variable. |
|
237
|
+
| `api_key` | Sets the OpenLIT API Key. Can also be provided via the `OPENLIT_API_KEY` environment variable. |
|
238
|
+
| `key` | Sets the key to fetch a specific secret. Optional |
|
239
|
+
| `should_set_env` | Boolean value that sets all the secrets as environment variables for the application. Optional |
|
240
|
+
| `tags` | Sets the tags for fetching only the secrets that have the mentioned tags assigned. Optional |
|
241
|
+
|
242
|
+
|
243
|
+
## 🛣️ Roadmap
|
244
|
+
|
245
|
+
We are dedicated to continuously improving OpenLIT SDKs. Here's a look at what's been accomplished and what's on the horizon:
|
246
|
+
|
247
|
+
| Feature | Status |
|
248
|
+
|----------------------------------------------------------------------------------------------|---------------|
|
249
|
+
| [OpenTelmetry auto-instrumentation for LLM Providers like OpenAI, Anthropic]() | ✅ Completed |
|
250
|
+
| [OpenTelmetry auto-instrumentation for Vector databases like Pinecone, Chroma]() | ✅ Completed |
|
251
|
+
| [OpenTelmetry auto-instrumentation for LLM Frameworks like LangChain, LlamaIndex]() | ✅ Completed |
|
252
|
+
| [OpenTelemetry-native auto-instrumentation for NVIDIA GPU Monitoring](https://docs.openlit.io/latest/features/gpu) | ✅ Completed |
|
253
|
+
| [Real-Time Guardrails Implementation](https://docs.openlit.io/latest/features/guardrails) | ✅ Completed |
|
254
|
+
| [Programmatic Evaluation for LLM Response](https://docs.openlit.io/latest/features/evaluations) | ✅ Completed |
|
255
|
+
| [OpenTelmetry auto-instrumentation for Agent Frameworks like CrewAI, DsPy]() | 🔜 Coming Soon |
|
256
|
+
|
257
|
+
|
202
258
|
## 🌱 Contributing
|
203
259
|
|
204
260
|
Whether it's big or small, we love contributions 💚. Check out our [Contribution guide](../../CONTRIBUTING.md) to get started
|
@@ -1,5 +1,17 @@
|
|
1
1
|
openlit/__helpers.py,sha256=H-8uJKs_CP9Y2HL4lz5n0AgN60wwZ675hlWHMDO143A,5936
|
2
|
-
openlit/__init__.py,sha256=
|
2
|
+
openlit/__init__.py,sha256=LbaoEj0c0mp_qvDwl3KmNsrYkMQfvS_1Ye-XN367P-g,19329
|
3
|
+
openlit/evals/__init__.py,sha256=nJe99nuLo1b5rf7pt9U9BCdSDedzbVi2Fj96cgl7msM,380
|
4
|
+
openlit/evals/all.py,sha256=oWrue3PotE-rB5WePG3MRYSA-ro6WivkclSHjYlAqGs,7154
|
5
|
+
openlit/evals/bias_detection.py,sha256=mCdsfK7x1vX7S3psC3g641IMlZ-7df3h-V6eiICj5N8,8154
|
6
|
+
openlit/evals/hallucination.py,sha256=Yn5OfWVJKynAiImV_aAqCvc0zqYjdJ3XUppCnMTy1pg,7507
|
7
|
+
openlit/evals/toxicity.py,sha256=Ii_kX2GToO9fDstDBuK4iN0tEQUkMoPWUBDMFFfeMC4,7000
|
8
|
+
openlit/evals/utils.py,sha256=XfSiD7IknWKl96NwmeMDgtVHYc39I49--R0I65DFivU,8346
|
9
|
+
openlit/guard/__init__.py,sha256=B-D7iPadGFn5i7nEsQfVbS6feL1ViRht3zWTQ45Jgkg,417
|
10
|
+
openlit/guard/all.py,sha256=VNHQERad-4qAMWsJJrpW9QNkhM7U8v_wy20KtDtQgzM,9755
|
11
|
+
openlit/guard/prompt_injection.py,sha256=3e4DKxB7QDzM-xPCpwEuureiH_2s_OTJ9BSckknPpzY,5784
|
12
|
+
openlit/guard/restrict_topic.py,sha256=KTuWa7XeMsV4oXxOrD1CYZV0wXWxTfA0H3p_6q_IOsk,6444
|
13
|
+
openlit/guard/sensitive_topic.py,sha256=RgVw_laFERv0nNdzBsAd2_3yLomMOK-gVq-P7oj1bTk,5552
|
14
|
+
openlit/guard/utils.py,sha256=0UcbNOTVu6Zv-LNY7480uqa-VrObCCOc41m-ZXRwpFI,7536
|
3
15
|
openlit/instrumentation/anthropic/__init__.py,sha256=oaU53BOPyfUKbEzYvLr1DPymDluurSnwo4Hernf2XdU,1955
|
4
16
|
openlit/instrumentation/anthropic/anthropic.py,sha256=y7CEGhKOGHWt8G_5Phr4qPJTfPGRJIAr9Yk6nM3CcvM,16775
|
5
17
|
openlit/instrumentation/anthropic/async_anthropic.py,sha256=Zz1KRKIG9wGn0quOoLvjORC-49IvHQpJ6GBdB-4PfCQ,16816
|
@@ -58,8 +70,8 @@ openlit/instrumentation/vllm/__init__.py,sha256=OVWalQ1dXvip1DUsjUGaHX4J-2FrSp-T
|
|
58
70
|
openlit/instrumentation/vllm/vllm.py,sha256=lDzM7F5pgxvh8nKL0dcKB4TD0Mc9wXOWeXOsOGN7Wd8,6527
|
59
71
|
openlit/otel/metrics.py,sha256=-PntPlH4xOBXgnDqgJp3iA7rh1TWxM7PudGnb0GxVDA,4298
|
60
72
|
openlit/otel/tracing.py,sha256=2kSj7n7uXSkRegcGFDC8IbnDOxqWTA8dGODs__Yn_yA,3719
|
61
|
-
openlit/semcov/__init__.py,sha256=
|
62
|
-
openlit-1.
|
63
|
-
openlit-1.
|
64
|
-
openlit-1.
|
65
|
-
openlit-1.
|
73
|
+
openlit/semcov/__init__.py,sha256=xPsw1aPonDSGYVuga-ZdoGt4yyA16wNFi5AEc7_xIrQ,8114
|
74
|
+
openlit-1.27.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
75
|
+
openlit-1.27.0.dist-info/METADATA,sha256=_Tiz8HXJ53yWZm4BGY8-em1n1H45OECLfekbQPgx7O8,20749
|
76
|
+
openlit-1.27.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
77
|
+
openlit-1.27.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|