openlit


Nameopenlit JSON
Version 1.30.3 PyPI version JSON
download
home_pagehttps://github.com/openlit/openlit/tree/main/openlit/python
SummaryOpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects
upload_time2024-11-15 19:40:01
maintainerNone
docs_urlNone
authorOpenLIT
requires_python<4.0.0,>=3.7.1
licenseNone
keywords opentelemetry otel otlp llm tracing openai anthropic claude cohere llm monitoring observability monitoring gpt generative ai chatgpt gpu
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
<img src="https://github.com/openlit/.github/blob/main/profile/assets/wide-logo-no-bg.png?raw=true" alt="OpenLIT Logo" width="30%">
<h3>OpenTelemetry-native</h3>
<h1>AI Observability, Evaluation and Guardrails Framework</h1>

**[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)** 

[![OpenLIT](https://img.shields.io/badge/OpenLIT-orange)](https://github.com/openlit/openlit)
[![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)
[![Downloads](https://static.pepy.tech/badge/openlit/month)](https://pepy.tech/project/openlit)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/openlit/openlit)](https://github.com/openlit/openlit/pulse)
[![GitHub Contributors](https://img.shields.io/github/contributors/openlit/openlit)](https://github.com/openlit/openlit/graphs/contributors)

[![Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack&logoColor=white)](https://join.slack.com/t/openlit/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ)
[![X](https://img.shields.io/badge/follow-%40openlit__io-1DA1F2?logo=x&style=social)](https://twitter.com/openlit_io)

![OpenLIT Connections Banner](https://github.com/openlit/.github/blob/main/profile/assets/github-readme-connections-banner.png?raw=true)


</div>

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.

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.

## ⚑ Features

- πŸ”Ž **Auto Instrumentation**: Works with 30+ LLM providers, vector databases, and GPUs with just one line of code.
- πŸ”­ **OpenTelemetry-Native Observability SDKs**: Vendor-neutral SDKs that can send traces and metrics to your existing observability tool like Prometheus and Jaeger.
- πŸ’² **Cost Tracking for Custom and Fine-Tuned Models**: Pass custom pricing files for accurate budgeting of custom and fine-tuned models.
- πŸš€ **Suppport for OpenLIT Features**: Includes suppprt for prompt management and secrets management features available in OpenLIT.

## Auto Instrumentation Capabilities

| LLMs                                                                      | Vector DBs                                   | Frameworks                                      | GPUs          |
|--------------------------------------------------------------------------|----------------------------------------------|-------------------------------------------------|---------------|
| [βœ… OpenAI](https://docs.openlit.io/latest/integrations/openai)                      | [βœ… ChromaDB](https://docs.openlit.io/latest/integrations/chromadb)       | [βœ… Langchain](https://docs.openlit.io/latest/integrations/langchain)      | [βœ… NVIDIA](https://docs.openlit.io/latest/integrations/nvidia-gpu) |
| [βœ… Ollama](https://docs.openlit.io/latest/integrations/ollama)                      | [βœ… Pinecone](https://docs.openlit.io/latest/integrations/pinecone)       | [βœ… LiteLLM](https://docs.openlit.io/latest/integrations/litellm)          | [βœ… AMD](#)                   |
| [βœ… Anthropic](https://docs.openlit.io/latest/integrations/anthropic)                | [βœ… Qdrant](https://docs.openlit.io/latest/integrations/qdrant)           | [βœ… LlamaIndex](https://docs.openlit.io/latest/integrations/llama-index)   |               |
| [βœ… GPT4All](https://docs.openlit.io/latest/integrations/gpt4all)                    | [βœ… Milvus](https://docs.openlit.io/latest/integrations/milvus)           | [βœ… Haystack](https://docs.openlit.io/latest/integrations/haystack)        |               |
| [βœ… Cohere](https://docs.openlit.io/latest/integrations/cohere)                      |                                          | [βœ… EmbedChain](https://docs.openlit.io/latest/integrations/embedchain)    |               |                                       
| [βœ… Mistral](https://docs.openlit.io/latest/integrations/mistral)                    |                                                                          | [βœ… Guardrails](https://docs.openlit.io/latest/integrations/guardrails)    |               |
| [βœ… Azure OpenAI](https://docs.openlit.io/latest/integrations/azure-openai)          |                                                                          | [βœ… CrewAI](https://docs.openlit.io/latest/integrations/crewai)            |               |
| [βœ… Azure AI Inference](https://docs.openlit.io/latest/integrations/azure-ai-inference) |                                                                          | [βœ… DSPy](https://docs.openlit.io/latest/integrations/dspy)                                    |               |
| [βœ… GitHub AI Models](https://docs.openlit.io/latest/integrations/github-models)  |                                                                          |                                       |               |
| [βœ… HuggingFace Transformers](https://docs.openlit.io/latest/integrations/huggingface) |                                                                          |                                       |               |
| [βœ… Amazon Bedrock](https://docs.openlit.io/latest/integrations/bedrock)             |                                                                          |                                       |               |
| [βœ… Vertex AI](https://docs.openlit.io/latest/integrations/vertexai)                 |                                                                          |                                       |               |
| [βœ… Groq](https://docs.openlit.io/latest/integrations/groq)                          |                                                                          |                                       |               |
| [βœ… ElevenLabs](https://docs.openlit.io/latest/integrations/elevenlabs)              |                                                                          |                                       |               |
| [βœ… vLLM](https://docs.openlit.io/latest/integrations/vllm)                          |                                                                          |                                       |               |
| [βœ… OLA Krutrim](https://docs.openlit.io/latest/integrations/krutrim)                |                                                                          |                                       |               |
| [βœ… Google AI Studio](https://docs.openlit.io/latest/integrations/google-ai-studio)  |                                                                          |                                       |               |
| [βœ… NVIDIA NIM](https://docs.openlit.io/latest/integrations/nvidia-nim)              |                                                                          |                                       |               |


## Supported Destinations
- [βœ… OpenTelemetry Collector](https://docs.openlit.io/latest/connections/otelcol)
- [βœ… Prometheus + Tempo](https://docs.openlit.io/latest/connections/prometheus-tempo)
- [βœ… Prometheus + Jaeger](https://docs.openlit.io/latest/connections/prometheus-jaeger)
- [βœ… Grafana Cloud](https://docs.openlit.io/latest/connections/grafanacloud)
- [βœ… New Relic](https://docs.openlit.io/latest/connections/new-relic)
- [βœ… Elastic](https://docs.openlit.io/latest/connections/elastic)
- [βœ… HyperDX](https://docs.openlit.io/latest/connections/hyperdx)
- [βœ… DataDog](https://docs.openlit.io/latest/connections/datadog)
- [βœ… SigNoz](https://docs.openlit.io/latest/connections/signoz)
- [βœ… OneUptime](https://docs.openlit.io/latest/connections/oneuptime)
- [βœ… Dynatrace](https://docs.openlit.io/latest/connections/dynatrace)
- [βœ… OpenObserve](https://docs.openlit.io/latest/connections/openobserve)
- [βœ… Highlight.io](https://docs.openlit.io/latest/connections/highlight)

## πŸ’Ώ Installation

```bash
pip install openlit
```

## πŸš€ Getting Started with LLM Observability

### Step 1: Install OpenLIT SDK

Open your command line or terminal and run:

```bash
pip install openlit
```

### Step 2: Initialize OpenLIT in your Application
Integrate OpenLIT into your AI applications by adding the following lines to your code.

```python
import openlit

openlit.init()
```

Configure the telemetry data destination as follows:

| Purpose                                   | Parameter/Environment Variable                   | For Sending to OpenLIT         |
|-------------------------------------------|--------------------------------------------------|--------------------------------|
| Send data to an HTTP OTLP endpoint        | `otlp_endpoint` or `OTEL_EXPORTER_OTLP_ENDPOINT` | `"http://127.0.0.1:4318"`     |
| Authenticate telemetry backends           | `otlp_headers` or `OTEL_EXPORTER_OTLP_HEADERS`   | Not required by default       |

> πŸ’‘ 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.

#### Example

---

<details>
  <summary>Initialize using Function Arguments</summary>
  
  ---

  Add the following two lines to your application code:
  
  ```python
  import openlit
  
  openlit.init(
    otlp_endpoint="YOUR_OTEL_ENDPOINT", 
    otlp_headers ="YOUR_OTEL_ENDPOINT_AUTH"
  )
  ```

</details>

---

<details>

  <summary>Initialize using Environment Variables</summary>

  ---

  Add the following two lines to your application code:

  ```python
  import openlit

  openlit.init()
  ```
  
  Then, configure the your OTLP endpoint using environment variable:

  ```env
  export OTEL_EXPORTER_OTLP_ENDPOINT = "YOUR_OTEL_ENDPOINT"
  export OTEL_EXPORTER_OTLP_HEADERS = "YOUR_OTEL_ENDPOINT_AUTH"
  ```
</details>

---

### Step 3: Visualize and Optimize!
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.

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).

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.

![](https://github.com/openlit/.github/blob/main/profile/assets/openlit-client-1.png?raw=true)


## Configuration

### Observability - `openlit.init()`

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:


| Argument                | Description                                                                                   | Default Value  | Required |
|-------------------------|-----------------------------------------------------------------------------------------------|----------------|----------|
| `environment`           | The deployment environment of the application.                                                | `"default"`    |    Yes   |
| `application_name`      | Identifies the name of your application.                                                      | `"default"`    |    Yes   |
| `tracer`                | An instance of OpenTelemetry Tracer for tracing operations.                                   | `None`         |    No    |
| `meter`                 | An OpenTelemetry Metrics instance for capturing metrics.                                      | `None`         |    No    |
| `otlp_endpoint`         | Specifies the OTLP endpoint for transmitting telemetry data.                                  | `None`         |    No    |
| `otlp_headers`          | Defines headers for the OTLP exporter, useful for backends requiring authentication.          | `None`         |    No    |
| `disable_batch`         | A flag to disable batch span processing, favoring immediate dispatch.                         | `False`        |    No    |
| `trace_content`         | Enables tracing of content for deeper insights.                                               | `True`         |    No    |
| `disabled_instrumentors`| List of instrumentors to disable. | `None` |    No    |
| `disable_metrics`       | If set, disables the collection of metrics.                                                   | `False`        |    No    |
| `pricing_json`          | URL or file path of the pricing JSON file.                                             | `https://github.com/openlit/openlit/blob/main/assets/pricing.json`        |    No    |
| `collect_gpu_stats`          | Flag to enable or disable GPU metrics collection.                                         | `False`        |    No    |

### OpenLIT Prompt Hub - `openlit.get_prompt()`

Below are the parameters for use with the SDK for OpenLIT Prompt Hub for prompt management:

| Parameter         | Description                                                                                                                        |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------|
| `url`             | Sets the OpenLIT URL. Defaults to the `OPENLIT_URL` environment variable.                                                          |
| `api_key`         | Sets the OpenLIT API Key. Can also be provided via the `OPENLIT_API_KEY` environment variable.                                     |
| `name`            | Sets the name to fetch a unique prompt. Use this or `prompt_id`.                                                                    |
| `prompt_id`       | Sets the ID to fetch a unique prompt. Use this or `name`. Optional                                                                 |
| `version`         | Set to `True` to get the prompt with variable substitution.. Optional                                                              |
| `shouldCompile`        | Boolean value that compiles the prompt using the provided variables. Optional                                                      |
| `variables`       | Sets the variables for prompt compilation. Optional                                                                                |
| `meta_properties` | Sets the meta-properties for storing in the prompt's access history metadata. Optional                                             |

### OpenLIT Vault - `openlit.get_secrets()`

Below are the parameters for use with the SDK for OpenLIT Vault for secret management:

| Parameter         | Description                                                                                                                        |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------|
| `url`             | Sets the Openlit URL. Defaults to the `OPENLIT_URL` environment variable.                                                          |
| `api_key`         | Sets the OpenLIT API Key. Can also be provided via the `OPENLIT_API_KEY` environment variable.                                     |
| `key`            | Sets the key to fetch a specific secret.     Optional                                                   |
| `should_set_env`        | Boolean value that sets all the secrets as environment variables for the application. Optional                                                     |
| `tags`       | Sets the tags for fetching only the secrets that have the mentioned tags assigned. Optional                                                                                |


## πŸ›£οΈ Roadmap

We are dedicated to continuously improving OpenLIT SDKs. Here's a look at what's been accomplished and what's on the horizon:

| Feature                                                                                      | Status        |
|----------------------------------------------------------------------------------------------|---------------|
| [OpenTelmetry auto-instrumentation for LLM Providers like OpenAI, Anthropic]()               | βœ… Completed  |
| [OpenTelmetry auto-instrumentation for Vector databases like Pinecone, Chroma]()             | βœ… Completed  |
| [OpenTelmetry auto-instrumentation for LLM Frameworks like LangChain, LlamaIndex]()          | βœ… Completed  |
| [OpenTelemetry-native auto-instrumentation for NVIDIA GPU Monitoring](https://docs.openlit.io/latest/features/gpu)           | βœ… Completed  |
| [Real-Time Guardrails Implementation](https://docs.openlit.io/latest/features/guardrails)                                                      | βœ… Completed    |
| [Programmatic Evaluation for LLM Response](https://docs.openlit.io/latest/features/evaluations)                                                      | βœ… Completed    |
| [OpenTelmetry auto-instrumentation for Agent Frameworks like CrewAI, DsPy]()             | πŸ”œ Coming Soon  |


## 🌱 Contributing

Whether it's big or small, we love contributions πŸ’š. Check out our [Contribution guide](../../CONTRIBUTING.md) to get started

Unsure where to start? Here are a few ways to get involved:

- Join our [Slack](https://join.slack.com/t/openlit/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ) or [Discord](https://discord.gg/rjvTm6zd) community to discuss ideas, share feedback, and connect with both our team and the wider OpenLIT community.

Your input helps us grow and improve, and we're here to support you every step of the way.

## πŸ’š Community & Support

Connect with the OpenLIT community and maintainers for support, discussions, and updates:

- 🌟 If you like it, Leave a star on our [GitHub](https://github.com/openlit/openlit/)
- 🌍 Join our [Slack](https://join.slack.com/t/openlit/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ) or [Discord](https://discord.gg/CQnXwNT3) community for live interactions and questions.
- 🐞 Report bugs on our [GitHub Issues](https://github.com/openlit/openlit/issues) to help us improve OpenLIT.
- 𝕏 Follow us on [X](https://x.com/openlit_io) for the latest updates and news.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/openlit/openlit/tree/main/openlit/python",
    "name": "openlit",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0.0,>=3.7.1",
    "maintainer_email": null,
    "keywords": "OpenTelemetry, otel, otlp, llm, tracing, openai, anthropic, claude, cohere, llm monitoring, observability, monitoring, gpt, Generative AI, chatGPT, gpu",
    "author": "OpenLIT",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/fc/45/2e5c0e54fe559bc4e98311a71873cc90be98413c86595e6a21dbb9d19049/openlit-1.30.3.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n<img src=\"https://github.com/openlit/.github/blob/main/profile/assets/wide-logo-no-bg.png?raw=true\" alt=\"OpenLIT Logo\" width=\"30%\">\n<h3>OpenTelemetry-native</h3>\n<h1>AI Observability, Evaluation and Guardrails Framework</h1>\n\n**[Documentation](https://docs.openlit.io/) | [Quickstart](#-getting-started-with-llm-observability) | [Roadmap](#\ufe0f-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)** \n\n[![OpenLIT](https://img.shields.io/badge/OpenLIT-orange)](https://github.com/openlit/openlit)\n[![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)\n[![Downloads](https://static.pepy.tech/badge/openlit/month)](https://pepy.tech/project/openlit)\n[![GitHub Last Commit](https://img.shields.io/github/last-commit/openlit/openlit)](https://github.com/openlit/openlit/pulse)\n[![GitHub Contributors](https://img.shields.io/github/contributors/openlit/openlit)](https://github.com/openlit/openlit/graphs/contributors)\n\n[![Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack&logoColor=white)](https://join.slack.com/t/openlit/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ)\n[![X](https://img.shields.io/badge/follow-%40openlit__io-1DA1F2?logo=x&style=social)](https://twitter.com/openlit_io)\n\n![OpenLIT Connections Banner](https://github.com/openlit/.github/blob/main/profile/assets/github-readme-connections-banner.png?raw=true)\n\n\n</div>\n\nOpenLIT 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.\n\nThis 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.\n\n## \u26a1 Features\n\n- \ud83d\udd0e **Auto Instrumentation**: Works with 30+ LLM providers, vector databases, and GPUs with just one line of code.\n- \ud83d\udd2d **OpenTelemetry-Native Observability SDKs**: Vendor-neutral SDKs that can send traces and metrics to your existing observability tool like Prometheus and Jaeger.\n- \ud83d\udcb2 **Cost Tracking for Custom and Fine-Tuned Models**: Pass custom pricing files for accurate budgeting of custom and fine-tuned models.\n- \ud83d\ude80 **Suppport for OpenLIT Features**: Includes suppprt for prompt management and secrets management features available in OpenLIT.\n\n## Auto Instrumentation Capabilities\n\n| LLMs                                                                      | Vector DBs                                   | Frameworks                                      | GPUs          |\n|--------------------------------------------------------------------------|----------------------------------------------|-------------------------------------------------|---------------|\n| [\u2705 OpenAI](https://docs.openlit.io/latest/integrations/openai)                      | [\u2705 ChromaDB](https://docs.openlit.io/latest/integrations/chromadb)       | [\u2705 Langchain](https://docs.openlit.io/latest/integrations/langchain)      | [\u2705 NVIDIA](https://docs.openlit.io/latest/integrations/nvidia-gpu) |\n| [\u2705 Ollama](https://docs.openlit.io/latest/integrations/ollama)                      | [\u2705 Pinecone](https://docs.openlit.io/latest/integrations/pinecone)       | [\u2705 LiteLLM](https://docs.openlit.io/latest/integrations/litellm)          | [\u2705 AMD](#)                   |\n| [\u2705 Anthropic](https://docs.openlit.io/latest/integrations/anthropic)                | [\u2705 Qdrant](https://docs.openlit.io/latest/integrations/qdrant)           | [\u2705 LlamaIndex](https://docs.openlit.io/latest/integrations/llama-index)   |               |\n| [\u2705 GPT4All](https://docs.openlit.io/latest/integrations/gpt4all)                    | [\u2705 Milvus](https://docs.openlit.io/latest/integrations/milvus)           | [\u2705 Haystack](https://docs.openlit.io/latest/integrations/haystack)        |               |\n| [\u2705 Cohere](https://docs.openlit.io/latest/integrations/cohere)                      |                                          | [\u2705 EmbedChain](https://docs.openlit.io/latest/integrations/embedchain)    |               |                                       \n| [\u2705 Mistral](https://docs.openlit.io/latest/integrations/mistral)                    |                                                                          | [\u2705 Guardrails](https://docs.openlit.io/latest/integrations/guardrails)    |               |\n| [\u2705 Azure OpenAI](https://docs.openlit.io/latest/integrations/azure-openai)          |                                                                          | [\u2705 CrewAI](https://docs.openlit.io/latest/integrations/crewai)            |               |\n| [\u2705 Azure AI Inference](https://docs.openlit.io/latest/integrations/azure-ai-inference) |                                                                          | [\u2705 DSPy](https://docs.openlit.io/latest/integrations/dspy)                                    |               |\n| [\u2705 GitHub AI Models](https://docs.openlit.io/latest/integrations/github-models)  |                                                                          |                                       |               |\n| [\u2705 HuggingFace Transformers](https://docs.openlit.io/latest/integrations/huggingface) |                                                                          |                                       |               |\n| [\u2705 Amazon Bedrock](https://docs.openlit.io/latest/integrations/bedrock)             |                                                                          |                                       |               |\n| [\u2705 Vertex AI](https://docs.openlit.io/latest/integrations/vertexai)                 |                                                                          |                                       |               |\n| [\u2705 Groq](https://docs.openlit.io/latest/integrations/groq)                          |                                                                          |                                       |               |\n| [\u2705 ElevenLabs](https://docs.openlit.io/latest/integrations/elevenlabs)              |                                                                          |                                       |               |\n| [\u2705 vLLM](https://docs.openlit.io/latest/integrations/vllm)                          |                                                                          |                                       |               |\n| [\u2705 OLA Krutrim](https://docs.openlit.io/latest/integrations/krutrim)                |                                                                          |                                       |               |\n| [\u2705 Google AI Studio](https://docs.openlit.io/latest/integrations/google-ai-studio)  |                                                                          |                                       |               |\n| [\u2705 NVIDIA NIM](https://docs.openlit.io/latest/integrations/nvidia-nim)              |                                                                          |                                       |               |\n\n\n## Supported Destinations\n- [\u2705 OpenTelemetry Collector](https://docs.openlit.io/latest/connections/otelcol)\n- [\u2705 Prometheus + Tempo](https://docs.openlit.io/latest/connections/prometheus-tempo)\n- [\u2705 Prometheus + Jaeger](https://docs.openlit.io/latest/connections/prometheus-jaeger)\n- [\u2705 Grafana Cloud](https://docs.openlit.io/latest/connections/grafanacloud)\n- [\u2705 New Relic](https://docs.openlit.io/latest/connections/new-relic)\n- [\u2705 Elastic](https://docs.openlit.io/latest/connections/elastic)\n- [\u2705 HyperDX](https://docs.openlit.io/latest/connections/hyperdx)\n- [\u2705 DataDog](https://docs.openlit.io/latest/connections/datadog)\n- [\u2705 SigNoz](https://docs.openlit.io/latest/connections/signoz)\n- [\u2705 OneUptime](https://docs.openlit.io/latest/connections/oneuptime)\n- [\u2705 Dynatrace](https://docs.openlit.io/latest/connections/dynatrace)\n- [\u2705 OpenObserve](https://docs.openlit.io/latest/connections/openobserve)\n- [\u2705 Highlight.io](https://docs.openlit.io/latest/connections/highlight)\n\n## \ud83d\udcbf Installation\n\n```bash\npip install openlit\n```\n\n## \ud83d\ude80 Getting Started with LLM Observability\n\n### Step 1: Install OpenLIT SDK\n\nOpen your command line or terminal and run:\n\n```bash\npip install openlit\n```\n\n### Step 2: Initialize OpenLIT in your Application\nIntegrate OpenLIT into your AI applications by adding the following lines to your code.\n\n```python\nimport openlit\n\nopenlit.init()\n```\n\nConfigure the telemetry data destination as follows:\n\n| Purpose                                   | Parameter/Environment Variable                   | For Sending to OpenLIT         |\n|-------------------------------------------|--------------------------------------------------|--------------------------------|\n| Send data to an HTTP OTLP endpoint        | `otlp_endpoint` or `OTEL_EXPORTER_OTLP_ENDPOINT` | `\"http://127.0.0.1:4318\"`     |\n| Authenticate telemetry backends           | `otlp_headers` or `OTEL_EXPORTER_OTLP_HEADERS`   | Not required by default       |\n\n> \ud83d\udca1 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.\n\n#### Example\n\n---\n\n<details>\n  <summary>Initialize using Function Arguments</summary>\n  \n  ---\n\n  Add the following two lines to your application code:\n  \n  ```python\n  import openlit\n  \n  openlit.init(\n    otlp_endpoint=\"YOUR_OTEL_ENDPOINT\", \n    otlp_headers =\"YOUR_OTEL_ENDPOINT_AUTH\"\n  )\n  ```\n\n</details>\n\n---\n\n<details>\n\n  <summary>Initialize using Environment Variables</summary>\n\n  ---\n\n  Add the following two lines to your application code:\n\n  ```python\n  import openlit\n\n  openlit.init()\n  ```\n  \n  Then, configure the your OTLP endpoint using environment variable:\n\n  ```env\n  export OTEL_EXPORTER_OTLP_ENDPOINT = \"YOUR_OTEL_ENDPOINT\"\n  export OTEL_EXPORTER_OTLP_HEADERS = \"YOUR_OTEL_ENDPOINT_AUTH\"\n  ```\n</details>\n\n---\n\n### Step 3: Visualize and Optimize!\nNow 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.\n\nIf you want to use OpenLIT's Observability Dashboard to monitor LLM usage\u2014like cost, tokens, and user interactions\u2014please check out our [Quickstart Guide](https://docs.openlit.io/latest/quickstart).\n\nIf 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.\n\n![](https://github.com/openlit/.github/blob/main/profile/assets/openlit-client-1.png?raw=true)\n\n\n## Configuration\n\n### Observability - `openlit.init()`\n\nBelow 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:\n\n\n| Argument                | Description                                                                                   | Default Value  | Required |\n|-------------------------|-----------------------------------------------------------------------------------------------|----------------|----------|\n| `environment`           | The deployment environment of the application.                                                | `\"default\"`    |    Yes   |\n| `application_name`      | Identifies the name of your application.                                                      | `\"default\"`    |    Yes   |\n| `tracer`                | An instance of OpenTelemetry Tracer for tracing operations.                                   | `None`         |    No    |\n| `meter`                 | An OpenTelemetry Metrics instance for capturing metrics.                                      | `None`         |    No    |\n| `otlp_endpoint`         | Specifies the OTLP endpoint for transmitting telemetry data.                                  | `None`         |    No    |\n| `otlp_headers`          | Defines headers for the OTLP exporter, useful for backends requiring authentication.          | `None`         |    No    |\n| `disable_batch`         | A flag to disable batch span processing, favoring immediate dispatch.                         | `False`        |    No    |\n| `trace_content`         | Enables tracing of content for deeper insights.                                               | `True`         |    No    |\n| `disabled_instrumentors`| List of instrumentors to disable. | `None` |    No    |\n| `disable_metrics`       | If set, disables the collection of metrics.                                                   | `False`        |    No    |\n| `pricing_json`          | URL or file path of the pricing JSON file.                                             | `https://github.com/openlit/openlit/blob/main/assets/pricing.json`        |    No    |\n| `collect_gpu_stats`          | Flag to enable or disable GPU metrics collection.                                         | `False`        |    No    |\n\n### OpenLIT Prompt Hub - `openlit.get_prompt()`\n\nBelow are the parameters for use with the SDK for OpenLIT Prompt Hub for prompt management:\n\n| Parameter         | Description                                                                                                                        |\n|-------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `url`             | Sets the OpenLIT URL. Defaults to the `OPENLIT_URL` environment variable.                                                          |\n| `api_key`         | Sets the OpenLIT API Key. Can also be provided via the `OPENLIT_API_KEY` environment variable.                                     |\n| `name`            | Sets the name to fetch a unique prompt. Use this or `prompt_id`.                                                                    |\n| `prompt_id`       | Sets the ID to fetch a unique prompt. Use this or `name`. Optional                                                                 |\n| `version`         | Set to `True` to get the prompt with variable substitution.. Optional                                                              |\n| `shouldCompile`        | Boolean value that compiles the prompt using the provided variables. Optional                                                      |\n| `variables`       | Sets the variables for prompt compilation. Optional                                                                                |\n| `meta_properties` | Sets the meta-properties for storing in the prompt's access history metadata. Optional                                             |\n\n### OpenLIT Vault - `openlit.get_secrets()`\n\nBelow are the parameters for use with the SDK for OpenLIT Vault for secret management:\n\n| Parameter         | Description                                                                                                                        |\n|-------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| `url`             | Sets the Openlit URL. Defaults to the `OPENLIT_URL` environment variable.                                                          |\n| `api_key`         | Sets the OpenLIT API Key. Can also be provided via the `OPENLIT_API_KEY` environment variable.                                     |\n| `key`            | Sets the key to fetch a specific secret.     Optional                                                   |\n| `should_set_env`        | Boolean value that sets all the secrets as environment variables for the application. Optional                                                     |\n| `tags`       | Sets the tags for fetching only the secrets that have the mentioned tags assigned. Optional                                                                                |\n\n\n## \ud83d\udee3\ufe0f Roadmap\n\nWe are dedicated to continuously improving OpenLIT SDKs. Here's a look at what's been accomplished and what's on the horizon:\n\n| Feature                                                                                      | Status        |\n|----------------------------------------------------------------------------------------------|---------------|\n| [OpenTelmetry auto-instrumentation for LLM Providers like OpenAI, Anthropic]()               | \u2705 Completed  |\n| [OpenTelmetry auto-instrumentation for Vector databases like Pinecone, Chroma]()             | \u2705 Completed  |\n| [OpenTelmetry auto-instrumentation for LLM Frameworks like LangChain, LlamaIndex]()          | \u2705 Completed  |\n| [OpenTelemetry-native auto-instrumentation for NVIDIA GPU Monitoring](https://docs.openlit.io/latest/features/gpu)           | \u2705 Completed  |\n| [Real-Time Guardrails Implementation](https://docs.openlit.io/latest/features/guardrails)                                                      | \u2705 Completed    |\n| [Programmatic Evaluation for LLM Response](https://docs.openlit.io/latest/features/evaluations)                                                      | \u2705 Completed    |\n| [OpenTelmetry auto-instrumentation for Agent Frameworks like CrewAI, DsPy]()             | \ud83d\udd1c Coming Soon  |\n\n\n## \ud83c\udf31 Contributing\n\nWhether it's big or small, we love contributions \ud83d\udc9a. Check out our [Contribution guide](../../CONTRIBUTING.md) to get started\n\nUnsure where to start? Here are a few ways to get involved:\n\n- Join our [Slack](https://join.slack.com/t/openlit/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ) or [Discord](https://discord.gg/rjvTm6zd) community to discuss ideas, share feedback, and connect with both our team and the wider OpenLIT community.\n\nYour input helps us grow and improve, and we're here to support you every step of the way.\n\n## \ud83d\udc9a Community & Support\n\nConnect with the OpenLIT community and maintainers for support, discussions, and updates:\n\n- \ud83c\udf1f If you like it, Leave a star on our [GitHub](https://github.com/openlit/openlit/)\n- \ud83c\udf0d Join our [Slack](https://join.slack.com/t/openlit/shared_invite/zt-2etnfttwg-TjP_7BZXfYg84oAukY8QRQ) or [Discord](https://discord.gg/CQnXwNT3) community for live interactions and questions.\n- \ud83d\udc1e Report bugs on our [GitHub Issues](https://github.com/openlit/openlit/issues) to help us improve OpenLIT.\n- \ud835\udd4f Follow us on [X](https://x.com/openlit_io) for the latest updates and news.\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "OpenTelemetry-native Auto instrumentation library for monitoring LLM Applications and GPUs, facilitating the integration of observability into your GenAI-driven projects",
    "version": "1.30.3",
    "project_urls": {
        "Homepage": "https://github.com/openlit/openlit/tree/main/openlit/python",
        "Repository": "https://github.com/openlit/openlit/tree/main/openlit/python"
    },
    "split_keywords": [
        "opentelemetry",
        " otel",
        " otlp",
        " llm",
        " tracing",
        " openai",
        " anthropic",
        " claude",
        " cohere",
        " llm monitoring",
        " observability",
        " monitoring",
        " gpt",
        " generative ai",
        " chatgpt",
        " gpu"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "db971e5838af1327a9c8360be9142d5a403d0babe980fa5ba2e27f5056d87ce5",
                "md5": "fa9768b181bc216370bf43fb7dd53b7a",
                "sha256": "ecd443a41e52ba65a60462348a9b7d83b0e14d8b72e8f8b9a008acf03ba88476"
            },
            "downloads": -1,
            "filename": "openlit-1.30.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fa9768b181bc216370bf43fb7dd53b7a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0.0,>=3.7.1",
            "size": 184973,
            "upload_time": "2024-11-15T19:40:00",
            "upload_time_iso_8601": "2024-11-15T19:40:00.818926Z",
            "url": "https://files.pythonhosted.org/packages/db/97/1e5838af1327a9c8360be9142d5a403d0babe980fa5ba2e27f5056d87ce5/openlit-1.30.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fc452e5c0e54fe559bc4e98311a71873cc90be98413c86595e6a21dbb9d19049",
                "md5": "b4a741a80072e82d7cdec36505b801e8",
                "sha256": "71fa8596f0e26131853db5ed0a668026512051fb1aecd91ec764f018c1b2855f"
            },
            "downloads": -1,
            "filename": "openlit-1.30.3.tar.gz",
            "has_sig": false,
            "md5_digest": "b4a741a80072e82d7cdec36505b801e8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0.0,>=3.7.1",
            "size": 100918,
            "upload_time": "2024-11-15T19:40:01",
            "upload_time_iso_8601": "2024-11-15T19:40:01.902408Z",
            "url": "https://files.pythonhosted.org/packages/fc/45/2e5c0e54fe559bc4e98311a71873cc90be98413c86595e6a21dbb9d19049/openlit-1.30.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-15 19:40:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "openlit",
    "github_project": "openlit",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "openlit"
}
        
Elapsed time: 1.04993s