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

# Ollama

> Learn how to integrate Ollama with HoneyHive

export const integrationType_1 = "Ollama"

export const integrationType_0 = "Ollama"

Ollama is a fast, open-source, and lightweight model server for running large language models (LLMs) on commodity hardware.

With HoneyHive, you can trace all your {integrationType_0} operations using a single line of code. Find a list of all supported integrations [here](/introduction/troubleshooting#latest-package-versions-tested).

## HoneyHive Setup

Follow the [HoneyHive Installation Guide](/integrations/integration-prereqs) to get your API key and initialize the tracer.

## Ollama Setup

Go to [Ollama Quickstart](https://github.com/ollama/ollama/tree/main?tab=readme-ov-file#quickstart) to get your Ollama model up and running locally using `ollama run llama3.2:1b` for example.

Note: please use version `ollama==0.2.0` for Python.

## Example

Here is an example of how to trace your {integrationType_1} code in HoneyHive.

<CodeGroup>
  ```python Python    theme={null}
  import ollama
  from honeyhive import HoneyHiveTracer

  HoneyHiveTracer.init(
      api_key="MY_HONEYHIVE_API_KEY",
      project="MY_HONEYHIVE_PROJECT_NAME",
      session_name="ollama",
  )


  response = ollama.chat(
      model="llama3.2:1b",
      messages=[{"role": "user", "content": "Why is the sky blue? Respond in one sentence."}],
      options={"temperature": 1},
  )

  print(response["message"]["content"])
  ```

  ```typescript TypeScript theme={null}
  import ollama from 'ollama'
  import { HoneyHiveTracer } from 'honeyhive';

  const tracer = await HoneyHiveTracer.init({
      apiKey: "MY_HONEYHIVE_API_KEY",
      project: "MY_HONEYHIVE_PROJECT_NAME",
      sessionName: "ollama",
  });

  async function run(input: string): Promise<string> {
      const response = await ollama.chat({
          model: 'llama3.2:1b',
          messages: [{ role: 'user', content: input }],
      });

      const result = response.message.content;

      // Handle the result
      console.log(result);
      return result;
  }

  const tracedRun = tracer.traceFunction()(run);
  await tracedRun("Why is the sky blue? Respond in one short sentence.");

  ```
</CodeGroup>

## View your Traces

Once you run your code, you can view your execution trace in the HoneyHive UI by clicking the `Log Store` tab on the left sidebar.
