This course assumes some basic knowledge of Python and Unix like systems (e.g., Linux and MacOS). Most of the setup and configurations instructions have been designed for Linux, although they should work on a MacOS/Windows environment provided access to a console.
Python is often pre-installed on Linux. However, a better solution is either to have it managed via PyEnv or uv. For this course you are required Python version >= 3.12.
Pyenv is a Python environment manager, that allows you to have multiple Python versions installed in your system (even locally as a user) without conflicts.
You can check the installation instructions on the different OS available in the official documentation. After that you can install the required Python version and set it up locally on this same directory:
$ pyenv install 3.12
$ pyenv local 3.12uv is an extremely fast Python package installer and resolver, written in Rust. It is designed to be a drop-in replacement for pip and pip-tools.
While you can install uv using pip, the recommended way to install command-line applications like uv is using pipx. pipx installs applications in isolated environments, preventing conflicts with your project dependencies. There are other ways to install uv as well, you can check the official documentation
To install uv using pipx, run the following command in your terminal:
pipx install uvIf you don't have pipx installed, you'll need to install it first (e.g., pip install pipx or using your system's package manager).
After installation, you can verify that uv is installed correctly by checking its version:
uv --versionThis command should display the installed version of uv.
uv makes setting up a project and installing dependencies straightforward and fast.
To create and sync the virtual environment for your project using uv, from the root directory run:
$ uv syncBy default, this command creates a directory named .venv in your current directory and install all main dependencies on it.
If you want to run the examples in the notebooks you need to add the extra:
$ uv sync --extra examplesYou can activate the virtual environment via source:
source .venv/bin/activateHowever this is not necessary as the preferred way is to run everything in your environment via uv or running tools in an isolated environment via uvx (like pipx):
$ uv run -- jupyter labPromptMe is a vulnerable LLM application designed for educational purposes to demonstrate the OWASP Top 10 for LLM Applications. It provides a series of CTF (Capture The Flag) challenges. I have forked and modified the original version so it can be set up with Docker and docker-compose. Until I manage to make a PR to the original repo we'll be using my version for the training.
This is the easiest method as it handles all dependencies, including the Ollama server and required models.
- Clone the repository:
git clone https://github.com/crscardellino/PromptMe.git cd PromptMe - Build and run:
docker-compose up --build
- Access the application:
Open your browser to
http://127.0.0.1:5000.
Gandalf is an interactive game created by Lakera to challenge and enhance your prompt injection skills. The primary goal is to cleverly trick the AI into revealing a secret password. The game features 8 levels of progressively increasing difficulty, along with special "Adventures" that focus on specific prompt injection techniques.