# Observability for Gretel with Opik

> Start here to integrate Opik into your Gretel-based genai application for end-to-end LLM observability, unit testing, and optimization.

[Gretel (NVIDIA)](https://gretel.ai/) is a synthetic data platform that enables you to generate high-quality, privacy-safe datasets for AI model training and evaluation.

This guide explains how to integrate Opik with Gretel to create synthetic Q\&A datasets and import them into Opik for model evaluation and optimization.

## Account Setup

[Comet](https://www.comet.com/site?from=llm\&utm_source=opik\&utm_medium=colab\&utm_content=gretel\&utm_campaign=opik) provides a hosted version of the Opik platform, [simply create an account](https://www.comet.com/signup?from=llm\&utm_source=opik\&utm_medium=colab\&utm_content=gretel\&utm_campaign=opik) and grab your API Key.

> You can also run the Opik platform locally, see the [installation guide](https://www.comet.com/docs/opik/self-host/overview/?from=llm\&utm_source=opik\&utm_medium=colab\&utm_content=gretel\&utm_campaign=opik) for more information.

## Getting Started

### Installation

To use Gretel with Opik, you'll need to have both the `gretel-client` and `opik` packages installed:

```bash
pip install gretel-client opik pandas
```

### Configuring Opik

Configure the Opik Python SDK for your deployment type. See the [Python SDK Configuration guide](/tracing/sdk_configuration) for detailed instructions on:

* **CLI configuration**: `opik configure`
* **Code configuration**: `opik.configure()`
* **Self-hosted vs Cloud vs Enterprise** setup
* **Configuration files** and environment variables

### Configuring Gretel

In order to configure Gretel, you will need to have your Gretel API Key. You can create and manage your Gretel API Keys on [this page](https://console.gretel.ai/account/api-keys).

You can set it as an environment variable:

```bash
export GRETEL_API_KEY="YOUR_API_KEY"
```

Or set it programmatically:

```python
import os
import getpass

if "GRETEL_API_KEY" not in os.environ:
    os.environ["GRETEL_API_KEY"] = getpass.getpass("Enter your Gretel API key: ")