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

# OpenLIT

> Send SDK telemetry to the native OpenLIT platform for AI observability, cost tracking, and evaluation out of the box

To send OpenTelemetry metrics and traces generated by OpenLIT from your AI Application to the OpenLIT Platform, follow the below steps.

### 1. Get your Credentials

If you haven't deployed the OpenLIT Platform yet, follow the [Installation Guide](/latest/openlit/installation) to set it up.

**Common OpenLIT Platform endpoints:**

* **Kubernetes cluster**: `http://openlit.openlit.svc.cluster.local:4318`
* **Local development**: `http://localhost:4318` (using port-forward)
* **External/Ingress**: Your configured external endpoint

### 2. Instrument your application

<Tabs>
  <Tab title="SDK">
    **For direct integration into your Python applications:**

    <Tabs>
      <Tab title="Function Arguments">
        ```python theme={null}
        import openlit

        openlit.init(
          otlp_endpoint="http://localhost:4318"
        )
        ```

        Replace `http://localhost:4318` with your OpenLIT Platform endpoint:

        * **Local development**: `http://localhost:4318`
        * **Kubernetes cluster**: `http://openlit.openlit.svc.cluster.local:4318`
        * **External**: Your configured external endpoint
      </Tab>

      <Tab title="Environment Variables">
        ```python theme={null}
        import openlit

        openlit.init()
        ```

        Set these environment variables:

        ```shell theme={null}
        export OTEL_EXPORTER_OTLP_ENDPOINT="http://localhost:4318"
        export OTEL_SERVICE_NAME="my-ai-service"
        export OTEL_DEPLOYMENT_ENVIRONMENT="production"
        ```

        Replace `http://localhost:4318` with your OpenLIT Platform endpoint.
      </Tab>
    </Tabs>

    Refer to the OpenLIT [Python SDK repository](https://github.com/openlit/openlit/tree/main/sdk/python) for more advanced configurations and use cases.
  </Tab>

  <Tab title="CLI">
    **For zero-code auto-instrumentation via command line:**

    <Tabs>
      <Tab title="CLI Arguments">
        ```shell theme={null}
        # Using CLI arguments
        openlit-instrument \
          --otlp-endpoint "YOUR_OPENLIT_PLATFORM_ENDPOINT" \
          --service-name "my-ai-service" \
          --deployment-environment "production" \
          python app.py
        ```

        Replace:

        1. `YOUR_OPENLIT_PLATFORM_ENDPOINT` with your OpenLIT Platform endpoint from Step 1.
      </Tab>

      <Tab title="Environment Variables">
        ```shell theme={null}
        # Set environment variables (takes precedence over CLI args)
        export OTEL_EXPORTER_OTLP_ENDPOINT="YOUR_OPENLIT_PLATFORM_ENDPOINT"
        export OTEL_SERVICE_NAME="my-ai-service"
        export OTEL_DEPLOYMENT_ENVIRONMENT="production"

        # Run your application
        openlit-instrument python app.py
        ```

        Replace:

        1. `YOUR_OPENLIT_PLATFORM_ENDPOINT` with your OpenLIT Platform endpoint from Step 1.
      </Tab>
    </Tabs>

    Refer to the OpenLIT [Python SDK repository](https://github.com/openlit/openlit/tree/main/sdk/python) for more advanced configurations and use cases.
  </Tab>
</Tabs>

### 3. Access OpenLIT Platform Dashboard

Once your LLM application is instrumented, you can explore the comprehensive observability data in the OpenLIT Platform:

**Access the Dashboard**:

```bash theme={null}
# Get the external service details
kubectl get svc -n openlit openlit

# For local access via port-forwarding:
kubectl port-forward -n openlit svc/openlit 3000:3000
# Then visit: http://localhost:3000
```

**What You'll See**:

1. **LLM Observability Dashboard**: Comprehensive view of your AI applications including:
   * **Real-time Metrics**: Request rates, latency, and error rates
   * **Cost Tracking**: Token usage and cost breakdown by model and application
   * **Performance Analytics**: Response times, throughput, and model performance
   * **Trace Visualization**: Detailed execution flow with full request/response context
2. **Vector Database Analytics**: Monitor your vector database operations and performance
3. **GPU Monitoring**: Track GPU utilization and performance metrics (if enabled)
4. **Custom Dashboards**: Create tailored views for your specific monitoring needs

Your OpenLIT-instrumented AI applications will appear automatically in the OpenLIT Platform with comprehensive observability including LLM costs, token usage, model performance, distributed tracing, and business intelligence - all in a single, self-hosted platform designed specifically for AI workloads.
