openlit 1.26.0__py3-none-any.whl → 1.27.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: openlit
3
- Version: 1.26.0
3
+ Version: 1.27.1
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,13 +13,16 @@ 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)
22
24
  Requires-Dist: opentelemetry-sdk (>=1.27.0,<2.0.0)
25
+ Requires-Dist: pydantic (>=2.0.0,<3.0.0)
23
26
  Requires-Dist: requests (>=2.26.0,<3.0.0)
24
27
  Requires-Dist: schedule (>=1.2.2,<2.0.0)
25
28
  Requires-Dist: tiktoken (>=0.7.0,<0.8.0)
@@ -27,10 +30,11 @@ Project-URL: Repository, https://github.com/openlit/openlit/tree/main/openlit/py
27
30
  Description-Content-Type: text/markdown
28
31
 
29
32
  <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%"><h1>
31
- OpenTelemetry Auto-Instrumentation for GenAI & LLM Applications</h1>
33
+ <img src="https://github.com/openlit/.github/blob/main/profile/assets/wide-logo-no-bg.png?raw=true" alt="OpenLIT Logo" width="30%">
34
+ <h3>OpenTelemetry-native</h3>
35
+ <h1>AI Observability, Evaluation and Guardrails Framework</h1>
32
36
 
33
- **[Documentation](https://docs.openlit.io/) | [Quickstart](#-getting-started) | [Python SDK](https://github.com/openlit/openlit/tree/main/sdk/python)**
37
+ **[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
38
 
35
39
  [![OpenLIT](https://img.shields.io/badge/OpenLIT-orange)](https://github.com/openlit/openlit)
36
40
  [![License](https://img.shields.io/github/license/openlit/openlit?label=License&logo=github&color=f80&logoColor=white)](https://github.com/openlit/openlit/blob/main/LICENSE)
@@ -39,7 +43,6 @@ OpenTelemetry Auto-Instrumentation for GenAI & LLM Applications</h1>
39
43
  [![GitHub Contributors](https://img.shields.io/github/contributors/openlit/openlit)](https://github.com/openlit/openlit/graphs/contributors)
40
44
 
41
45
  [![Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack&logoColor=white)](https://join.slack.com/t/openlit/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ)
42
- [![Discord](https://img.shields.io/badge/Discord-7289DA?logo=discord&logoColor=white)](https://discord.gg/CQnXwNT3)
43
46
  [![X](https://img.shields.io/badge/follow-%40openlit__io-1DA1F2?logo=x&style=social)](https://twitter.com/openlit_io)
44
47
 
45
48
  ![OpenLIT Connections Banner](https://github.com/openlit/.github/blob/main/profile/assets/github-readme-connections-banner.png?raw=true)
@@ -47,11 +50,16 @@ OpenTelemetry Auto-Instrumentation for GenAI & LLM Applications</h1>
47
50
 
48
51
  </div>
49
52
 
50
- OpenLIT Python SDK is an **OpenTelemetry-native** Auto instrumentation library for monitoring LLM Applications, facilitating the integration of observability into your GenAI-driven projects. Designed with simplicity and efficiency, OpenLIT offers the ability to embed observability into your GenAI-driven projects effortlessly using just **a single line of code**.
53
+ 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
54
 
52
- Whether you're directly using LLM Libraries like OpenAI, Anthropic or building complex RAG Agents using Langchain, OpenLIT seamlessly integrates observability into your applications, ensuring enhanced performance and reliability across diverse scenarios.
55
+ 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
56
 
54
- This project adheres to the [Semantic Conventions](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/gen-ai) proposed by the OpenTelemetry community. You can check out the current definitions [here](src/openlit/semcov/__init__.py).
57
+ ## Features
58
+
59
+ - 🔎 **Auto Instrumentation**: Works with 30+ LLM providers, vector databases, and GPUs with just one line of code.
60
+ - 🔭 **OpenTelemetry-Native Observability SDKs**: Vendor-neutral SDKs that can send traces and metrics to your existing observability tool like Prometheus and Jaeger.
61
+ - 💲 **Cost Tracking for Custom and Fine-Tuned Models**: Pass custom pricing files for accurate budgeting of custom and fine-tuned models.
62
+ - 🚀 **Suppport for OpenLIT Features**: Includes suppprt for prompt management and secrets management features available in OpenLIT.
55
63
 
56
64
  ## Auto Instrumentation Capabilities
57
65
 
@@ -97,9 +105,9 @@ This project adheres to the [Semantic Conventions](https://github.com/open-telem
97
105
  pip install openlit
98
106
  ```
99
107
 
100
- ## 🚀 Getting Started
108
+ ## 🚀 Getting Started with LLM Observability
101
109
 
102
- ### Step 1: Install OpenLIT
110
+ ### Step 1: Install OpenLIT SDK
103
111
 
104
112
  Open your command line or terminal and run:
105
113
 
@@ -108,7 +116,7 @@ pip install openlit
108
116
  ```
109
117
 
110
118
  ### Step 2: Initialize OpenLIT in your Application
111
- Integrating the OpenLIT into LLM applications is straightforward. Start monitoring for your LLM Application with just **two lines of code**:
119
+ Integrate OpenLIT into your AI applications by adding the following lines to your code.
112
120
 
113
121
  ```python
114
122
  import openlit
@@ -116,11 +124,14 @@ import openlit
116
124
  openlit.init()
117
125
  ```
118
126
 
119
- To forward telemetry data to an HTTP OTLP endpoint, such as the OpenTelemetry Collector, set the `otlp_endpoint` parameter with the desired endpoint. Alternatively, you can configure the endpoint by setting the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable as recommended in the OpenTelemetry documentation.
127
+ Configure the telemetry data destination as follows:
120
128
 
121
- > 💡 Info: If you dont provide `otlp_endpoint` function argument or set the `OTEL_EXPORTER_OTLP_ENDPOINT` environment variable, OpenLIT directs the trace directly to your console, which can be useful during development.
129
+ | Purpose | Parameter/Environment Variable | For Sending to OpenLIT |
130
+ |-------------------------------------------|--------------------------------------------------|--------------------------------|
131
+ | Send data to an HTTP OTLP endpoint | `otlp_endpoint` or `OTEL_EXPORTER_OTLP_ENDPOINT` | `"http://127.0.0.1:4318"` |
132
+ | Authenticate telemetry backends | `otlp_headers` or `OTEL_EXPORTER_OTLP_HEADERS` | Not required by default |
122
133
 
123
- To send telemetry to OpenTelemetry backends requiring authentication, set the `otlp_headers` parameter with its desired value. Alternatively, you can configure the endpoint by setting the `OTEL_EXPORTER_OTLP_HEADERS` environment variable as recommended in the OpenTelemetry documentation.
134
+ > 💡 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
135
 
125
136
  #### Example
126
137
 
@@ -171,19 +182,22 @@ To send telemetry to OpenTelemetry backends requiring authentication, set the `o
171
182
  ---
172
183
 
173
184
  ### Step 3: Visualize and Optimize!
174
- With the LLM Observability data now being collected and sent to OpenLIT, the next step is to visualize and analyze this data to get insights into your LLM applications performance, behavior, and identify areas of improvement.
185
+ 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
186
 
176
- To begin exploring your LLM Application's performance data within the OpenLIT, please see the [Quickstart Guide](https://docs.openlit.io/latest/quickstart).
187
+ 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
188
 
178
- If you want to integrate and send metrics and traces to your existing observability tools, refer to our [Connections Guide](https://docs.openlit.io/latest/connections/intro) for detailed instructions.
189
+ 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
190
 
180
191
  ![](https://github.com/openlit/.github/blob/main/profile/assets/openlit-client-1.png?raw=true)
181
192
 
182
193
 
183
- ### Configuration
194
+ ## Configuration
195
+
196
+ ### Observability - `openlit.init()`
184
197
 
185
198
  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
199
 
200
+
187
201
  | Argument | Description | Default Value | Required |
188
202
  |-------------------------|-----------------------------------------------------------------------------------------------|----------------|----------|
189
203
  | `environment` | The deployment environment of the application. | `"default"` | Yes |
@@ -199,6 +213,49 @@ Below is a detailed overview of the configuration options available, allowing yo
199
213
  | `pricing_json` | URL or file path of the pricing JSON file. | `https://github.com/openlit/openlit/blob/main/assets/pricing.json` | No |
200
214
  | `collect_gpu_stats` | Flag to enable or disable GPU metrics collection. | `False` | No |
201
215
 
216
+ ### OpenLIT Prompt Hub - `openlit.get_prompt()`
217
+
218
+ Below are the parameters for use with the SDK for OpenLIT Prompt Hub for prompt management:
219
+
220
+ | Parameter | Description |
221
+ |-------------------|------------------------------------------------------------------------------------------------------------------------------------|
222
+ | `url` | Sets the OpenLIT URL. Defaults to the `OPENLIT_URL` environment variable. |
223
+ | `api_key` | Sets the OpenLIT API Key. Can also be provided via the `OPENLIT_API_KEY` environment variable. |
224
+ | `name` | Sets the name to fetch a unique prompt. Use this or `prompt_id`. |
225
+ | `prompt_id` | Sets the ID to fetch a unique prompt. Use this or `name`. Optional |
226
+ | `version` | Set to `True` to get the prompt with variable substitution.. Optional |
227
+ | `shouldCompile` | Boolean value that compiles the prompt using the provided variables. Optional |
228
+ | `variables` | Sets the variables for prompt compilation. Optional |
229
+ | `meta_properties` | Sets the meta-properties for storing in the prompt's access history metadata. Optional |
230
+
231
+ ### OpenLIT Vault - `openlit.get_secrets()`
232
+
233
+ Below are the parameters for use with the SDK for OpenLIT Vault for secret management:
234
+
235
+ | Parameter | Description |
236
+ |-------------------|------------------------------------------------------------------------------------------------------------------------------------|
237
+ | `url` | Sets the Openlit URL. Defaults to the `OPENLIT_URL` environment variable. |
238
+ | `api_key` | Sets the OpenLIT API Key. Can also be provided via the `OPENLIT_API_KEY` environment variable. |
239
+ | `key` | Sets the key to fetch a specific secret. Optional |
240
+ | `should_set_env` | Boolean value that sets all the secrets as environment variables for the application. Optional |
241
+ | `tags` | Sets the tags for fetching only the secrets that have the mentioned tags assigned. Optional |
242
+
243
+
244
+ ## 🛣️ Roadmap
245
+
246
+ We are dedicated to continuously improving OpenLIT SDKs. Here's a look at what's been accomplished and what's on the horizon:
247
+
248
+ | Feature | Status |
249
+ |----------------------------------------------------------------------------------------------|---------------|
250
+ | [OpenTelmetry auto-instrumentation for LLM Providers like OpenAI, Anthropic]() | ✅ Completed |
251
+ | [OpenTelmetry auto-instrumentation for Vector databases like Pinecone, Chroma]() | ✅ Completed |
252
+ | [OpenTelmetry auto-instrumentation for LLM Frameworks like LangChain, LlamaIndex]() | ✅ Completed |
253
+ | [OpenTelemetry-native auto-instrumentation for NVIDIA GPU Monitoring](https://docs.openlit.io/latest/features/gpu) | ✅ Completed |
254
+ | [Real-Time Guardrails Implementation](https://docs.openlit.io/latest/features/guardrails) | ✅ Completed |
255
+ | [Programmatic Evaluation for LLM Response](https://docs.openlit.io/latest/features/evaluations) | ✅ Completed |
256
+ | [OpenTelmetry auto-instrumentation for Agent Frameworks like CrewAI, DsPy]() | 🔜 Coming Soon |
257
+
258
+
202
259
  ## 🌱 Contributing
203
260
 
204
261
  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=MMQriKcROfw0DBBC3FdHbOKI--9tq-ZM0pY6UsQvjGk,19287
2
+ openlit/__init__.py,sha256=dboS_trymEQ2zubonTuMSRqiFIhy0A9tK0PAktEHc08,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
@@ -56,10 +68,10 @@ openlit/instrumentation/vertexai/async_vertexai.py,sha256=8JwSwLPPA4lAatf4w_5kJ5
56
68
  openlit/instrumentation/vertexai/vertexai.py,sha256=R6dDQfC3YFoZDygxU2fkflcMsqIv8AVoU3XOwWSvpwA,54951
57
69
  openlit/instrumentation/vllm/__init__.py,sha256=OVWalQ1dXvip1DUsjUGaHX4J-2FrSp-T-qCVOfw7OZo,1495
58
70
  openlit/instrumentation/vllm/vllm.py,sha256=lDzM7F5pgxvh8nKL0dcKB4TD0Mc9wXOWeXOsOGN7Wd8,6527
59
- openlit/otel/metrics.py,sha256=-PntPlH4xOBXgnDqgJp3iA7rh1TWxM7PudGnb0GxVDA,4298
71
+ openlit/otel/metrics.py,sha256=FYAk4eBAmNtFKUIp4hbRbpdq4LME6MapyCQOIeuhmEg,4337
60
72
  openlit/otel/tracing.py,sha256=2kSj7n7uXSkRegcGFDC8IbnDOxqWTA8dGODs__Yn_yA,3719
61
- openlit/semcov/__init__.py,sha256=wpAarrnkndbgvP8VSudi8IRInYtD02hkewqjyiC0dMk,7614
62
- openlit-1.26.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
63
- openlit-1.26.0.dist-info/METADATA,sha256=YRmexsUEdSEe5MBZu8IR6u6s4XMzi2TSJGw1Z7CMCgQ,15758
64
- openlit-1.26.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
65
- openlit-1.26.0.dist-info/RECORD,,
73
+ openlit/semcov/__init__.py,sha256=xPsw1aPonDSGYVuga-ZdoGt4yyA16wNFi5AEc7_xIrQ,8114
74
+ openlit-1.27.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
75
+ openlit-1.27.1.dist-info/METADATA,sha256=A5el-uDDg_yZPRFEuYiNrpl1vTJX7tT2ETY6rio1GEA,20790
76
+ openlit-1.27.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
77
+ openlit-1.27.1.dist-info/RECORD,,