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,transformersfor 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.
- Install
dtx(for theddtxwrapper CLI):
pip install dtx
- Use
ddtxto run inside Docker:
ddtx redteam scope "Describe your agent" output.yml
Features:
- No need to install
torchlocally - Fully containerized execution
- Automatically mounts
.envand 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-exportis installed - Install all dependencies including
devandtorchgroups - Set up the
dtxpackage 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.
Metadata
Release files for dtx 0.34.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dtx-0.34.0.tar.gz | 788.0 kB | Without provenance | Details for dtx-0.34.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dtx-0.34.0-py3-none-any.whl | Python 3 | none | any | Details for dtx-0.34.0-py3-none-any.whl |
Total release size: 1.7 MB
Release files / dtx-0.34.0.tar.gz
| Download URL | dtx-0.34.0.tar.gz |
|---|---|
| Size | 788.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7691ebe5749b38a593a494be5570d15483d9d5442cf53aab886d2e36e71eeadf
|
|
BLAKE2b-256 checksum How to use checksums |
d5e82a7d195dac822e858e112a13ca5fc33e856813c2360f2df92034b8626658
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.11.8 Linux/6.11.0-1018-azure
|
Release files / dtx-0.34.0-py3-none-any.whl
| Download URL | dtx-0.34.0-py3-none-any.whl |
|---|---|
| Size | 896.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7cecbdc1e36ed22476ed658d4992a93d211977f91684325cf285e2aae6062d50
|
|
BLAKE2b-256 checksum How to use checksums |
eae4b0031b18e6ada5e54ee7e3c8219fed303d966bdbbee88bb55fb061870f8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.4 CPython/3.11.8 Linux/6.11.0-1018-azure
|
Security for dtx 0.34.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.