Local Installation (Python + pip)
This guide explains how to install dtx in your local Python environment.
Recommended if you plan to:
- Develop locally
- Run models like Tiny-LLM, GPT-2, or Hugging Face directly in your environment
- Avoid external tools like Docker
Prerequisitesβ
- Python
>= 3.8
- pip (Python package manager)
- Git (optional, if you plan to clone templates manually)
Check your Python and pip version:
python --version
pip --version
Step 1: Install dtxβ
π If you already have PyTorch installedβ
Install only dtx
:
pip install dtx
Use this if you have an existing PyTorch setup.
π If you do not have PyTorch installed (Recommended)β
Install dtx
with the [pytorch]
extras to include everything you need for local model execution:
pip install dtx[pytorch]
This installs:
torch
β Core deep learning librarytransformers
β Hugging Face models
Recommended if you plan to run models locally without cloud APIs.
Step 2: Verify Installationβ
Check if dtx
is installed and accessible:
dtx --help
You should see the list of available commands.
If you see an error, check your PATH
or virtual environment setup.
Optional: Create a Virtual Environment (Best Practice)β
To isolate your dependencies, itβs best to use a virtual environment.
Linux/macOS:β
python -m venv .venv
source .venv/bin/activate
pip install dtx[pytorch]
Windows:β
python -m venv .venv
.venv\Scripts\activate
pip install dtx[pytorch]
π§© Tip: This avoids dependency conflicts with other Python projects.
Summaryβ
Scenario | Command |
---|---|
Existing PyTorch installation | pip install dtx |
No PyTorch installed (recommended) | pip install dtx[pytorch] |
Verify installation | dtx --help |
Next Stepsβ
-
Check available datasets:
dtx datasets list
-
Test a local LLM:
dtx redteam run --agent hf_model --url arnir0/Tiny-LLM --dataset beaver --eval ibm38
-
Try dummy agent test (no model needed):
dtx redteam run --agent echo --dataset beaver --eval ibm38