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

# LLM Observability for LiteLLM

## Overview

[LiteLLM](https://www.litellm.ai/) is a framework/library for building LLM applications that simplifies accessing many models across different providers.

## Default configuration

<Steps>
  <Step title="Ensure you have the latest version of Laminar">
    ```sh theme={null}
    pip install -U lmnr[all]
    ```
  </Step>

  <Step title="Initialize Laminar and integrate the callback">
    You need to initialize Laminar **before** adding the callback to LiteLLM.

    ```python theme={null}
    import litellm
    from lmnr import Laminar, LaminarLiteLLMCallback

    # 1. Initialize Laminar
    Laminar.initialize(project_api_key="LMNR_PROJECT_API_KEY")

    # 2. Integrate the callback
    litellm.callbacks = [LaminarLiteLLMCallback()]
    ```
  </Step>

  <Step title="Run your code and see traces in Laminar">
    Example code:

    ```python theme={null}
    import litellm
    from lmnr import Laminar, LaminarLiteLLMCallback

    Laminar.initialize(project_api_key="LMNR_PROJECT_API_KEY")
    litellm.callbacks = [LaminarLiteLLMCallback()]

    response = litellm.completion(
        model="gpt-4.1-nano",
        messages=[
          {"role": "user", "content": "What is the capital of France?"}
        ],
    )
    ```

    <div style={{ border: '1px solid #2B2B30', borderRadius: '8px', overflow: 'hidden' }}>
      <img src="https://mintcdn.com/hipocap/_A6a-zBhVHj_KGJv/images/traces/litellm.png?fit=max&auto=format&n=_A6a-zBhVHj_KGJv&q=85&s=1409a4fff988a97b7e86b57d7bb9418b" alt="LiteLLM trace" style={{ margin: '0px' }} width="1854" height="580" data-path="images/traces/litellm.png" />
    </div>
  </Step>
</Steps>
