---
title: 'Monitor Ollama using OpenTelemetry'
sidebarTitle: 'Ollama'
---

<Frame>
  <img src="/images/docs-ollama-banner.gif" />
</Frame>

OpenLIT uses OpenTelemetry Auto-Instrumentation to help you monitor LLM applications built using models from Ollama. This includes tracking performance, token usage, and how users interact with the application.

Auto-instrumentation means you don't have to set up monitoring manually for different LLMs, frameworks, or databases. By simply adding OpenLIT in your application, all the necessary monitoring configurations are automatically set up.

The integration is compatible with  
- Ollama Python SDK client `>=0.2.0` 

## Get Started 

<Steps>
    <Step title="Install OpenLIT">
      Open your command line or terminal and run:
      ```shell
      pip install openlit
      ```
    </Step>
    <Step title="Initialize OpenLIT in your Application">
    You can set up OpenLIT in your application using either function arguments directly in your code or by using environment variables.
    <Tabs>
      <Tab title="Setup using function arguments">

      Add the following two lines to your application code:

      ```python
      import openlit

      openlit.init(
        otlp_endpoint="YOUR_OTEL_ENDPOINT", 
      )
      ```

      Replace:
      1. `YOUR_OTEL_ENDPOINT` with the URL of your OpenTelemetry backend, such as `http://127.0.0.1:4318` if you are using OpenLIT and a local OTel Collector.
      </Tab>
      <Tab title="Setup using Environment Variables">
      
      Add the following two lines to your application code:

      ```python
      import openlit

      openlit.init()
      ```

      Then, configure the your OTLP endpoint using environment variable:
      ```shell
      export OTEL_EXPORTER_OTLP_ENDPOINT = "YOUR_OTEL_ENDPOINT"
      ```

      Replace:
      1. `YOUR_OTEL_ENDPOINT` with the URL of your OpenTelemetry backend, such as `http://127.0.0.1:4318` if you are using OpenLIT and a local OTel Collector. 
      </Tab>
    </Tabs>
    To send metrics and traces to other Observability tools, refer to the [Connections Guide](/latest/connections/intro).

    For more advanced configurations and application use cases, visit the [OpenLIT Python repository](https://github.com/openlit/openlit/tree/main/sdk/python).
  </Step>
</Steps>

---

<CardGroup cols={2}>
<Card title="Connections" href="/latest/connections/intro" icon='link'>
Connect to your existing Observablity Stack
</Card>
<Card title="SDK configuration" href="/latest/sdk-configuration" icon='file-code'>
Documentation of the configuration options for the OpenLIT SDK.
</Card>
</CardGroup>