Getting Started
This guide walks you through installing AIGuard, initialising a project, and running your first adversarial and hallucination evaluations.
Prerequisites
- Python ≥ 3.10
- An API key for the LLM provider you want to test (OpenAI, Anthropic, etc.)
1. Install
$
pip install aiguard-safetySee Installation for optional extras (monitoring, review, huggingface).
2. Initialise a project
$
aiguard project init --project my-projectThis writes an aiguard.yaml file to the current directory with safe defaults. Open it and configure your target model — see Configuration.
3. Run your first evaluation
$
aiguard evaluate --mode quickAIGuard runs the enabled modules from aiguard.yaml against the configured target model and writes results to .aiguard/aiguard.db (SQLite).
4. Wrap LLM calls with the SDK
Replace direct LLM calls with aiguard.chat(). It's a drop-in wrapper around LiteLLM and emits a non-blocking trace event for every call.
app.pypython
import aiguard
# Optional — auto-reads aiguard.yaml otherwise
aiguard.configure(sampling_rate=1.0)
response = aiguard.chat(
model="gpt-4o",
messages=[{"role": "user", "content": "Explain transformers"}],
)
print(response.choices[0].message.content)5. Start the dev environment
Run the full local stack (pipeline + monitoring API + React UI) in one command:
$
aiguard dev- Monitoring API on
http://localhost:8080 - Monitoring UI on
http://localhost:3000