Skip to main content

AI Red Teaming Tool and Framework

Project description

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.

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:

pip install dtx

dtx will use your existing torch installation.

Tip: Verify torch is installed:

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

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

Install dtx with full dependencies

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):
pip install dtx
  1. Use ddtx to run inside Docker:
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

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

2. Install Dependencies

Run the following command:

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:

eval $(poetry env activate)

Alternatively, you can run:

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:

dtx --help

5. Export Requirements (Optional)

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

make export

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dtx-0.23.0.tar.gz (744.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dtx-0.23.0-py3-none-any.whl (844.9 kB view details)

Uploaded Python 3

File details

Details for the file dtx-0.23.0.tar.gz.

File metadata

  • Download URL: dtx-0.23.0.tar.gz
  • Upload date:
  • Size: 744.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.8 Linux/6.11.0-1018-azure

File hashes

Hashes for dtx-0.23.0.tar.gz
Algorithm Hash digest
SHA256 aa30261b93bd41eed59f2e6cf76680758c8f20f568c9db2a4f94ef5b68b9c4a3
MD5 bc43537de744abc5500c803c03ff6ed1
BLAKE2b-256 d90edba0befb931aee841026c3213a1fe8ac459fd83f730f79f6cc3668ac7f11

See more details on using hashes here.

File details

Details for the file dtx-0.23.0-py3-none-any.whl.

File metadata

  • Download URL: dtx-0.23.0-py3-none-any.whl
  • Upload date:
  • Size: 844.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.11.8 Linux/6.11.0-1018-azure

File hashes

Hashes for dtx-0.23.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c20c358e18f800165fdbd26add8bb9c10cf280c262a13da6f1e51c529e0b0194
MD5 61d8f834f043a1641283f2e209f2048c
BLAKE2b-256 401de246c1fe883c5c653bca8cfed8e00f1ffda76e0d7336ed8bf4b262e95fe1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page