openlit 1.42.0


pip install openlit

  Latest version

Released: May 08, 2026


Meta
Author: OpenLIT
Requires Python: >=3.9.0,<4.0.0

Classifiers

License
  • OSI Approved :: Apache Software License

Programming Language
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13
  • Python :: 3.14
OpenLIT Logo

OpenTelemetry-native

AI Observability, Evaluation and Guardrails Framework

Documentation | Quickstart | Roadmap | Feature Request | Report a Bug

OpenLIT License Downloads GitHub Last Commit GitHub Contributors

Slack X

OpenLIT Connections Banner

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 with the OpenTelemetry community, consistently updating to align with the latest standards in Observability.

⚑ Features

  • πŸ”Ž Auto Instrumentation: Works with 50+ LLM providers, Agents, 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.
  • πŸš€ Support for OpenLIT Features: Includes support for prompt management and secrets management features available in OpenLIT.

Auto Instrumentation Capabilities

LLMs Vector DBs Frameworks GPUs
βœ… OpenAI βœ… ChromaDB βœ… Langchain βœ… NVIDIA
βœ… Ollama βœ… Pinecone βœ… LiteLLM βœ… AMD
βœ… Anthropic βœ… Qdrant βœ… LlamaIndex
βœ… GPT4All βœ… Milvus βœ… Haystack
βœ… Cohere βœ… AstraDB βœ… EmbedChain
βœ… Mistral βœ… Guardrails
βœ… Azure OpenAI βœ… CrewAI
βœ… Azure AI Inference βœ… DSPy
βœ… GitHub AI Models βœ… AG2
βœ… HuggingFace Transformers βœ… Dynamiq
βœ… Amazon Bedrock βœ… Phidata
βœ… AI21 βœ… mem0
βœ… Vertex AI βœ… MultiOn
βœ… Groq βœ… Julep AI
βœ… ElevenLabs βœ… ControlFlow
βœ… vLLM βœ… Crawl4AI
βœ… OLA Krutrim βœ… FireCrawl
βœ… Google AI Studio βœ… Letta
βœ… NVIDIA NIM βœ… SwarmZero
βœ… Titan ML
βœ… Reka AI
βœ… xAI
βœ… Prem AI
βœ… Assembly AI
βœ… Together
βœ… DeepSeek
βœ… DigitalOcean (pydo)
βœ… DigitalOcean Gradient

Supported Destinations

πŸ’Ώ Installation

pip install openlit

πŸš€ Getting Started with LLM Observability

Step 1: Install OpenLIT SDK

Open your command line or terminal and run:

pip install openlit

Step 2: Initialize OpenLIT in your Application

Integrate OpenLIT into your AI applications by adding the following lines to your code.

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


Initialize using Function Arguments

Add the following two lines to your application code:

import openlit

openlit.init(
  otlp_endpoint="YOUR_OTEL_ENDPOINT", 
  otlp_headers ="YOUR_OTEL_ENDPOINT_AUTH"
)

Initialize using Environment Variables

Add the following two lines to your application code:

import openlit

openlit.init()

Then, configure the your OTLP endpoint using environment variable:

export OTEL_EXPORTER_OTLP_ENDPOINT = "YOUR_OTEL_ENDPOINT"
export OTEL_EXPORTER_OTLP_HEADERS = "YOUR_OTEL_ENDPOINT_AUTH"

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.

If you're sending metrics and traces to other observability tools, take a look at our Connections Guide to start using a pre-built dashboard we have created for these tools.

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
capture_message_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
custom_metrics_attributes Custom key-value attributes applied to every metric recording. Useful for grouping metrics by custom tags (e.g., client ID, team, project). None 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

OpenLIT Rule Engine - openlit.evaluate_rule()

Evaluate trace attributes against the OpenLIT Rule Engine to retrieve matching rules and associated entities (contexts, prompts, evaluation configurations).

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.
entity_type Type of entity to match: "context", "prompt", or "evaluation".
fields Dictionary of trace attributes to evaluate against rules. e.g. {"gen_ai.system": "openai", "gen_ai.request.model": "gpt-4"}
include_entity_data If True, include full entity data in the response. Default: False. Optional
entity_inputs Optional dictionary of inputs for entity resolution (e.g. prompt variables, version).

Example

import openlit

# Evaluate rules to get matching contexts
result = openlit.evaluate_rule(
    entity_type="context",
    fields={
        "gen_ai.system": "openai",
        "gen_ai.request.model": "gpt-4",
        "service.name": "my-app",
    },
    include_entity_data=True,
)

if result:
    print("Matching rules:", result["matchingRuleIds"])
    print("Entities:", result["entities"])
    # Use with evaluations:
    # contexts = result.get("entity_data", {})

πŸ›£οΈ 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 βœ… Completed
Real-Time Guardrails Implementation βœ… Completed
Programmatic Evaluation for LLM Response βœ… Completed
OpenTelemetry-native AI Agent Observability βœ… Completed

🌱 Contributing

Whether it's big or small, we love contributions πŸ’š. Check out our Contribution guide to get started

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

  • Join our Slack or Discord 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
  • 🌍 Join our Slack or Discord community for live interactions and questions.
  • 🐞 Report bugs on our GitHub Issues to help us improve OpenLIT.
  • 𝕏 Follow us on X for the latest updates and news.
1.42.0 May 08, 2026
1.41.2 Apr 27, 2026
1.41.1 Apr 19, 2026
1.41.0 Apr 17, 2026
1.40.3 Apr 08, 2026
1.40.2 Apr 06, 2026
1.40.1 Apr 02, 2026
1.40.0 Mar 31, 2026
1.39.0 Mar 25, 2026
1.38.2 Mar 24, 2026
1.38.1 Mar 18, 2026
1.38.0 Mar 15, 2026
1.37.5 Mar 13, 2026
1.37.4 Feb 27, 2026
1.37.2 Feb 26, 2026
1.37.1 Feb 25, 2026
1.37.0 Feb 24, 2026
1.36.9 Feb 19, 2026
1.36.8 Feb 06, 2026
1.36.7 Jan 27, 2026
1.36.6 Jan 27, 2026
1.36.3 Dec 12, 2025
1.36.2 Dec 08, 2025
1.36.1 Nov 12, 2025
1.36.0 Nov 11, 2025
1.35.9 Oct 27, 2025
1.35.8 Oct 16, 2025
1.35.7 Oct 16, 2025
1.35.6 Oct 15, 2025
1.35.5 Oct 01, 2025
1.35.4 Sep 23, 2025
1.35.3 Sep 19, 2025
1.35.1 Aug 24, 2025
1.35.0 Aug 04, 2025
1.34.43 Aug 01, 2025
1.34.42 Jul 31, 2025
1.34.41 Jul 31, 2025
1.34.40 Jul 30, 2025
1.34.39 Jul 30, 2025
1.34.38 Jul 30, 2025
1.34.37 Jul 29, 2025
1.34.36 Jul 28, 2025
1.34.35 Jul 21, 2025
1.34.34 Jul 21, 2025
1.34.33 Jul 18, 2025
1.34.32 Jul 17, 2025
1.34.31 Jul 17, 2025
1.34.30 Jul 17, 2025
1.34.29 Jul 16, 2025
1.34.28 Jul 16, 2025
1.34.27 Jul 15, 2025
1.34.26 Jul 14, 2025
1.34.25 Jul 14, 2025
1.34.24 Jul 11, 2025
1.34.23 Jul 01, 2025
1.34.22 Jun 28, 2025
1.34.20 Jun 28, 2025
1.34.19 Jun 27, 2025
1.34.18 Jun 27, 2025
1.34.17 Jun 27, 2025
1.34.16 Jun 27, 2025
1.34.15 Jun 27, 2025
1.34.14 Jun 27, 2025
1.34.13 Jun 27, 2025
1.34.12 Jun 27, 2025
1.34.11 Jun 26, 2025
1.34.10 Jun 26, 2025
1.34.8 Jun 26, 2025
1.34.7 Jun 26, 2025
1.34.5 Jun 26, 2025
1.34.4 Jun 24, 2025
1.34.3 Jun 23, 2025
1.34.2 Jun 17, 2025
1.34.1 Jun 17, 2025
1.34.0 Jun 17, 2025
1.33.23 May 28, 2025
1.33.22 May 24, 2025
1.33.21 May 15, 2025
1.33.20 Apr 24, 2025
1.33.19 Mar 17, 2025
1.33.18 Mar 16, 2025
1.33.17 Mar 16, 2025
1.33.16 Mar 13, 2025
1.33.15 Mar 11, 2025
1.33.14 Mar 09, 2025
1.33.13 Mar 09, 2025
1.33.12 Mar 09, 2025
1.33.11 Mar 07, 2025
1.33.10 Mar 04, 2025
1.33.9 Mar 03, 2025
1.33.8 Jan 30, 2025
1.33.7 Jan 29, 2025
1.33.6 Jan 28, 2025
1.33.5 Jan 28, 2025
1.33.4 Jan 12, 2025
1.33.2 Dec 31, 2024
1.33.1 Dec 20, 2024
1.33.0 Dec 10, 2024
1.32.12 Dec 10, 2024
1.32.11 Dec 10, 2024
1.32.10 Dec 09, 2024
1.32.9 Dec 09, 2024
1.32.8 Dec 05, 2024
1.32.7 Dec 03, 2024
1.32.6 Dec 02, 2024
1.32.5 Nov 26, 2024
1.32.4 Nov 24, 2024
1.32.3 Nov 24, 2024
1.32.2 Nov 23, 2024
1.32.1 Nov 23, 2024
1.32.0 Nov 22, 2024
1.31.1 Nov 22, 2024
1.31.0 Nov 21, 2024
1.30.5 Nov 19, 2024
1.30.4 Nov 19, 2024
1.30.3 Nov 15, 2024
1.30.2 Nov 15, 2024
1.30.1 Nov 15, 2024
1.30.0 Nov 15, 2024
1.29.4 Nov 14, 2024
1.29.3 Nov 12, 2024
1.29.2 Nov 12, 2024
1.29.1 Nov 12, 2024
1.29.0 Nov 10, 2024
1.28.0 Nov 10, 2024
1.27.1 Nov 07, 2024
1.27.0 Oct 31, 2024
1.26.0 Oct 24, 2024
1.25.0 Oct 15, 2024
1.24.1 Oct 08, 2024
1.24.0 Oct 06, 2024
1.23.0 Oct 04, 2024
1.22.5 Sep 18, 2024
1.22.4 Sep 16, 2024
1.22.3 Sep 14, 2024
1.22.2 Sep 13, 2024
1.22.1 Sep 05, 2024
1.22.0 Sep 04, 2024
1.21.0 Sep 04, 2024
1.20.0 Sep 04, 2024
1.19.0 Aug 26, 2024
1.18.2 Aug 18, 2024
1.18.1 Aug 13, 2024
1.18.0 Aug 07, 2024
1.17.0 Aug 01, 2024
1.16.2 Jul 31, 2024
1.16.1 Jul 30, 2024
1.16.0 Jul 10, 2024
1.15.0 Jul 10, 2024
1.14.2 Jul 01, 2024
1.14.1 Jun 14, 2024
1.14.0 Jun 13, 2024
1.13.0 Jun 12, 2024
1.12.0 Jun 03, 2024
1.11.0 May 27, 2024
1.10.0 May 27, 2024
1.9.0 May 24, 2024
1.8.0 May 23, 2024
1.7.0 May 17, 2024
1.6.0 May 17, 2024
1.5.0 May 16, 2024
1.4.0 May 16, 2024
1.3.0 May 15, 2024
1.2.0 May 09, 2024
1.1.3 May 02, 2024
1.1.2 May 02, 2024
1.1.1 May 02, 2024
1.1.0 May 01, 2024
1.0.0 Apr 26, 2024
0.0.3 Apr 19, 2024
0.0.2 Apr 18, 2024
0.0.1 Apr 18, 2024

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras: None
Dependencies:
anthropic (<1.0.0,>=0.42.0)
boto3 (<2.0.0,>=1.34.0)
botocore (<2.0.0,>=1.34.0)
openai (<3.0.0,>=1.92.0)
opentelemetry-api (<2.0.0,>=1.38.0)
opentelemetry-exporter-otlp (<2.0.0,>=1.38.0)
opentelemetry-instrumentation (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-aiohttp-client (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-asgi (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-django (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-falcon (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-fastapi (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-flask (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-httpx (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-pyramid (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-requests (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-starlette (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-tornado (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-urllib (<1.0.0,>=0.52b0)
opentelemetry-instrumentation-urllib3 (<1.0.0,>=0.52b0)
opentelemetry-sdk (<2.0.0,>=1.38.0)
opentelemetry-semantic-conventions (<1.0.0,>=0.59b0)
pydantic (<3.0.0,>=2.0.0)
requests (<3.0.0,>=2.26.0)
schedule (<2.0.0,>=1.2.2)
xmltodict (<1.0.0,>=0.13.0)