🔎
garak
  • 👋Welcome to garak!
  • Overview
    • 💡What is garak?
    • ✨Our Features
  • LLM scanning basics
    • 🔐What is LLM security?
    • 🛠️Setting up
      • 😇Installing garak
      • 🐍Installing the source code
    • 🚀Your first scan
    • 🔮Reading the results
  • Examples
    • ☑️Basic test
    • 💉Prompt injection
    • ☢️Toxicity generation
    • 🗝️Jailbreaks
    • 💱Encoding-based bypass
    • 📼Data leaks & replay
    • 🤦False reasoning
    • 🛀Automatic soak test
  • garak components
    • 🕵️‍♀️Vulnerability probes
    • 🦜Using generators
    • 🔎Understanding detectors
    • 🏇Managing it: harnesses
    • 💯Scan evaluation
  • Automatic red-teaming
    • 🔴What is red-teaming?
    • 🤼Responsive auto-prompt
    • 🪖garak's auto red-team
    • 🏞️Red teaming in the wild
  • Going further
    • ❓FAQ
    • 💁Getting help
    • 🎯Reporting hits
    • 🧑‍🤝‍🧑Contributing to garak
Powered by GitBook
On this page
  1. LLM scanning basics
  2. Setting up

Installing garak

PreviousSetting upNextInstalling the source code

Last updated 1 year ago

So you'd like to install garak and scan some language models for vulnerabilities? Great! You're in the right place.

garak runs from the command line / terminal, and works best on Linux and Mac OSX. If you're on windows, please give it a try, and let us know how you get on!

The easiest way to install garak is using Python's pip package manager. You need at least Python 3.10 to use garak.

Easy install with pip

You can use this one-liner from a terminal and you should be good to go:

python -m pip install -U garak

Happy hunting!

I don't have pip!

No worries! You can still use garak. If you don't have pip, you can install it. There are guides for that here on ; here's a summary.

If you're on Mac, then installing and using to install pip is strongly recommended - it doesn't run super quickly the first time, but the experience is really good after. Try something like:

  1. Open terminal

  2. Install brew using the instructions on

  3. Run brew install python

  4. To finalize the pip install, run brew unlink python && brew link python

If you're on Linux, you probably want to start with a distribution package manager. Try:

  1. Install pip from package -

  2. Upgrade your pip installation, with python -m pip install -U pip

If you're on Windows, let us know how you get on!

pip install for python version 3.9 or lower

garak requires Python 3.10. If you don't have that, you can run garak in a conda container using a higher Python version, without disrupting everything else on your computer.

First, install conda - instructions are here,

Next, create a conda environment for garak; let's call it garak:

conda create --name garak "python>=3.10,<=3.12"
conda activate garak

Finally, install garak:

python -m pip install garak

When you're done, you can run conda deactivate to get back to where you were.

conda deactivate

Any time you'd like to run garak, just remember to activate the conda environment first:

If you get stuck, come chat with us on !

conda activate garak
Install the latest development version with pip

The standard pip version of garak is updated periodically. To get the freshest version possible, from , try:

python -m pip install -U git+https://github.com/leondz/garak.git@main
🛠️
😇
pypa.io
brew
brew.sh
https://linuxconfig.org/install-pip-on-linux
https://docs.conda.io/projects/conda/en/latest/user-guide/install/index.html#regular-installation
Discord
GitHub