> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openlayer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenLIT

> Learn how to export OpenLIT traces to Openlayer

<img width="700" style={{ borderRadius: "0.5rem" }} src="https://mintcdn.com/openlayer-44/zlWrng2mbxttdDP9/images/integrations/openlit_hero.png?fit=max&auto=format&n=zlWrng2mbxttdDP9&q=85&s=e7e4dd7d3b8ebdcbbc11b0a27fdd748a" alt="OpenLIT hero" data-path="images/integrations/openlit_hero.png" />

Openlayer can act as an [OpenTelemetry](/integrations/opentelemetry) backend,
enabling trace ingestion from any OpenTelemetry-compatible instrumentation library.

This guide shows how to use the [OpenLIT](https://docs.openlit.io/latest/features/tracing)
library to instrument an LLM framework or provider and send trace data to
Openlayer for monitoring and evaluation.

## Configuration

The integration works by sending trace data to Openlayer's [OpenTelemetry endpoint](/integrations/opentelemetry).

<Tip>
  The full code used in this guide is available
  [here](https://colab.research.google.com/github/openlayer-ai/openlayer-python/blob/main/examples/tracing/openlit/openlit_tracing.ipynb).
</Tip>

To set it up, you need to:

<Steps>
  <Step title="Set the environment variables">
    Set the following environment variables:

    ```bash theme={null}
    OTEL_EXPORTER_OTLP_ENDPOINT="https://api.openlayer.com/v1/otel"
    OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer YOUR_OPENLAYER_API_KEY_HERE, x-bt-parent=pipeline_id:YOUR_PIPELINE_ID_HERE"
    ```
  </Step>

  <Step title="Initialize OpenLIT instrumentation">
    Initialize OpenLIT instrumentation in your application.

    ```python theme={null}
    import openlit

    openlit.init(disable_batch=True)
    ```
  </Step>

  <Step title="Run LLMs and workflows as usual">
    Once instrumentation is set up, you can run your LLM calls as usual.
    Trace data will be automatically captured and exported to Openlayer, where
    you can begin testing and analyzing it.

    For example:

    ```python theme={null}
    from openai import OpenAI

    client = OpenAI()
    client.chat.completions.create(
      model="gpt-4o-mini",
      messages=[{"role": "user", "content": "How are you doing today?"}],
    )
    ```
  </Step>
</Steps>
