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

# Installation

> Install Gaussia and its dependencies

# Installation

Gaussia uses a modular dependency system, allowing you to install only the components you need.

## Requirements

* Python 3.11 or higher
* [uv](https://docs.astral.sh/uv/) (recommended) or pip

## Basic Installation

<CodeGroup>
  ```bash uv (Recommended) theme={null}
  uv add gaussia
  ```

  ```bash pip theme={null}
  pip install gaussia
  ```

  ```bash poetry theme={null}
  poetry add gaussia
  ```
</CodeGroup>

## Optional Dependencies

Gaussia provides optional dependency groups for each metric and feature:

### Metrics

| Extra        | Description                         | Dependencies                                                    |
| ------------ | ----------------------------------- | --------------------------------------------------------------- |
| `toxicity`   | Toxicity metric with clustering     | sentence-transformers, hdbscan, umap-learn, nltk, numpy, pandas |
| `bias`       | Bias metric with guardian models    | torch                                                           |
| `vision`     | Vision similarity and hallucination | numpy, sentence-transformers, torch                             |
| `humanity`   | Humanity metric with NRC lexicon    | numpy, pandas                                                   |
| `regulatory` | Regulatory compliance metric        | torch, accelerate                                               |

### Features

| Extra              | Description                  | Dependencies                    |
| ------------------ | ---------------------------- | ------------------------------- |
| `generators`       | Synthetic dataset generation | langchain-core                  |
| `explainability`   | Token attribution analysis   | interpreto, torch, transformers |
| `prompt-optimizer` | Prompt optimization          | optuna                          |

### Combined Extras

| Extra     | Description                |
| --------- | -------------------------- |
| `metrics` | All metric extras combined |
| `all`     | All metrics and features   |

## Installation Examples

<CodeGroup>
  ```bash Single Metric theme={null}
  # Install with toxicity metric support
  uv add "gaussia[toxicity]"
  ```

  ```bash Multiple Metrics theme={null}
  # Install multiple metrics
  uv add "gaussia[toxicity,bias,vision]"
  ```

  ```bash Full Installation theme={null}
  # Install everything
  uv add "gaussia[all]"
  ```
</CodeGroup>

## LLM Provider Dependencies

Several metrics require LangChain-compatible chat models. Install your preferred provider:

<CodeGroup>
  ```bash OpenAI theme={null}
  uv add langchain-openai
  ```

  ```bash Groq (Fast & Free Tier) theme={null}
  uv add langchain-groq
  ```

  ```bash Google Gemini theme={null}
  uv add langchain-google-genai
  ```

  ```bash Anthropic theme={null}
  uv add langchain-anthropic
  ```

  ```bash Ollama (Local) theme={null}
  uv add langchain-ollama
  ```
</CodeGroup>

## Verifying Installation

```python theme={null}
import gaussia

# Check version
print(f"Gaussia version: {gaussia.__version__}")

# Verify imports
from gaussia.metrics.toxicity import Toxicity
from gaussia.core.retriever import Retriever
from gaussia.schemas.common import Dataset, Batch

print("Installation successful!")
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="ImportError: No module named 'sentence_transformers'">
    Install the toxicity extras:

    ```bash theme={null}
    uv add "gaussia[toxicity]"
    ```
  </Accordion>

  <Accordion title="ImportError: No module named 'langchain_openai'">
    Install your preferred LLM provider:

    ```bash theme={null}
    uv add langchain-openai
    ```
  </Accordion>

  <Accordion title="CUDA/GPU issues with sentence-transformers">
    For CPU-only installation:

    ```bash theme={null}
    uv add torch --index-url https://download.pytorch.org/whl/cpu
    uv add "gaussia[toxicity]"
    ```
  </Accordion>

  <Accordion title="Python version incompatibility">
    Ensure you're using Python 3.11+:

    ```bash theme={null}
    python --version
    # If needed, use pyenv to install a compatible version
    pyenv install 3.11.0
    pyenv local 3.11.0
    ```
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="quickstart">
    Run your first evaluation
  </Card>

  <Card title="Core Concepts" icon="lightbulb" href="concepts/architecture">
    Understand the architecture
  </Card>
</CardGroup>
