Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Configure PyRIT

After installing, you need to tell PyRIT where your AI endpoints are and how to initialize the framework.

Quickest Start

Set three environment variables and run three lines of Python — no files needed.

PowerShell
Bash / macOS
$env:OPENAI_CHAT_ENDPOINT = "https://api.openai.com/v1"
$env:OPENAI_CHAT_KEY = "sk-your-key-here"
$env:OPENAI_CHAT_MODEL = "gpt-4o"
from pyrit.setup import initialize_pyrit_async
from pyrit.setup.initializers import SimpleInitializer

await initialize_pyrit_async(memory_db_type="InMemory", initializers=[SimpleInitializer()])

This gives you an in-memory database and default converter/scorer config — enough to run most notebooks and examples. Replace the endpoint/key/model for your provider (Azure, Ollama, Groq, etc.).

For Persistent Setup

For anything beyond a quick test — especially pyrit_scan, scenarios, and repeated use — you’ll want to save your configuration to files in ~/.pyrit/:

What’s Next?

Once you’re configured, head to the User Guide to start using PyRIT.