Metadata-Version: 2.3
Name: dtx
Version: 0.32.0
Summary: AI Red Teaming Tool and Framework
Author: developer
Author-email: research@detoxio.ai
Requires-Python: >=3.11,<3.14
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Provides-Extra: torch
Requires-Dist: aiofiles (>=24.1.0,<25.0.0)
Requires-Dist: base2048 (>=0.1.3,<0.2.0)
Requires-Dist: datasets (>=3.3.2,<4.0.0)
Requires-Dist: deprecated (>=1.2.18,<2.0.0)
Requires-Dist: deprecation (>=2.1.0,<3.0.0)
Requires-Dist: detoxify (>=0.5.2,<0.6.0) ; extra == "torch"
Requires-Dist: docker (>=7.1.0,<8.0.0)
Requires-Dist: dotenv (>=0.9.9,<0.10.0)
Requires-Dist: dtx-attacks (>=0.3.0,<0.4.0)
Requires-Dist: dtx-models (>=0.39.0,<0.40.0)
Requires-Dist: ecoji (>=0.1.1,<0.2.0)
Requires-Dist: faiss-cpu (>=1.11.0,<2.0.0)
Requires-Dist: gradio-client (>=1.8.0,<2.0.0)
Requires-Dist: haralyzer (>=2.4.0,<3.0.0)
Requires-Dist: httptools (>=0.6.4,<0.7.0)
Requires-Dist: huggingface-hub[hf-xet] (>=0.31.2,<0.32.0)
Requires-Dist: jinja2 (>=3.1.6,<4.0.0)
Requires-Dist: jq (>=1.8.0,<2.0.0)
Requires-Dist: langchain (>=0.3.18,<0.4.0)
Requires-Dist: langchain-openai (>=0.3.5,<0.4.0)
Requires-Dist: langgraph (>=0.3.30,<0.4.0)
Requires-Dist: litellm[proxy] (>=1.63.6,<2.0.0)
Requires-Dist: loguru (>=0.7.3,<0.8.0)
Requires-Dist: markitdown (>=0.0.2,<0.0.3)
Requires-Dist: numpy (>=2.2.5,<3.0.0)
Requires-Dist: ollama (>=0.5.1)
Requires-Dist: playwright (>=1.51.0,<2.0.0)
Requires-Dist: pydantic (>=2.10.6,<3.0.0)
Requires-Dist: pydantic-yaml (>=1.4.0,<2.0.0)
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
Requires-Dist: pyyaml (>=6.0.2,<7.0.0)
Requires-Dist: retry (>=0.9.2,<0.10.0)
Requires-Dist: rich (>=13.9.4,<14.0.0)
Requires-Dist: sentence-transformers (>=4.1.0,<5.0.0) ; extra == "torch"
Requires-Dist: tenacity (>=9.1.2,<10.0.0)
Requires-Dist: tiktoken (>=0.8.0,<0.9.0)
Requires-Dist: torch (>=2.6.0,<3.0.0) ; extra == "torch"
Requires-Dist: transformers (>=4.49.0,<5.0.0) ; extra == "torch"
Requires-Dist: validators (>=0.34.0,<0.35.0)
Requires-Dist: zalgolib (>=0.2.2,<0.3.0)
Description-Content-Type: text/markdown

# How to Install `dtx`

Before you begin, choose **how you want to run `dtx`** depending on your environment and requirements.

---

## Option 1: Install `dtx` locally **with full dependencies (torch etc.)**

This is recommended if you plan to run **local models** (e.g., Hugging Face, Ollama) on your machine.

```bash
pip install dtx[torch]
```

Includes:
- Core CLI
- `torch`, `transformers` for local LLM and classifier execution
- Supports all datasets and local execution

---

## Option 2: Install `dtx` if **torch is already installed**

If your environment already has `torch` installed (for example, in a GPU-accelerated ML environment), you can skip extras:

```bash
pip install dtx
```

`dtx` will use your existing `torch` installation.

> Tip: Verify torch is installed:
> ```bash
> python -c "import torch; print(torch.__version__)"
> ```

---

## Option 3: Use `uv` for fast installation in a clean environment

If you're creating a new environment and want **fast dependency resolution** with `uv`:

### Install uv

```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

### Install `dtx` with full dependencies

```bash
uv pip install dtx[torch]
```

---

## Option 4: Use Docker wrapper (`ddtx`)

If you prefer **Dockerized execution** (no local `torch` install required), you can use `ddtx`.

1. Install `dtx` (for the `ddtx` wrapper CLI):

```bash
pip install dtx
```

2. Use `ddtx` to run inside Docker:

```bash
ddtx redteam scope "Describe your agent" output.yml
```

Features:
- No need to install `torch` locally
- Fully containerized execution
- Automatically mounts `.env` and working directories
- Use Docker-managed templates and tools

---

## Summary of Options

| Method | Use case | Install command |
|--------|----------|----------------|
| Local, full dependencies | Full feature set, local models | `pip install dtx[torch]` |
| Local, existing torch | You already have `torch` installed | `pip install dtx` |
| New env, fast install | Clean, fast setup | `uv pip install dtx[torch]` |
| Docker (ddtx) | No local Python dependencies, isolated | `pip install dtx` + use `ddtx` CLI |


## How to Get Started (Development)

Follow these steps to set up `dtx` for local development.

---

### 1. Clone the Repository

```bash
git clone https://github.com/YOUR-ORG/dtx.git
cd dtx
```

---

### 2. Install Dependencies

Run the following command:

```bash
make install
```

This will:

* Ensure the `poetry-plugin-export` is installed
* Install all dependencies including `dev` and `torch` groups
* Set up the `dtx` package in editable mode

---

### 3. Activate the Virtual Environment

Run this in your shell to activate the Poetry-managed virtual environment:

```bash
eval $(poetry env activate)
```

Alternatively, you can run:

```bash
make venv
```

This will print the exact `eval` command you need to run manually. For example:

Note: `make` cannot modify your current shell environment, so you must run the `eval` command directly.

---

### 4. Run the CLI

Once the environment is active, you can use the CLI:

```bash
dtx --help
```

---

### 5. Export Requirements (Optional)

To export the current environment to a `requirements.txt` file (useful for `pip`-based tools or deployment):

```bash
make export
```

This will generate a `requirements.txt` file including development and optional dependencies like `torch`.




