avidtools

raw JSON →
0.3.2 verified Fri May 01 auth: no python

Developer tools for the AVID (Artificial Intelligence Vulnerability Database) ecosystem. Version 0.3.2 requires Python >=3.12. Provides connectors to transform evaluation and compliance outputs into AVID reports, with integrations for Garak, Inspect, and other evaluation frameworks. Actively maintained.

pip install avidtools
error AttributeError: module 'avidtools.connectors' has no attribute 'inspect'
cause Trying to import the 'inspect' connector directly from the connectors package which is a namespace package; individual submodules must be imported explicitly.
fix
Use from avidtools.connectors import inspect or import avidtools.connectors.inspect.
error ModuleNotFoundError: No module named 'avidtools.connectors.inspect'
cause The 'inspect' connector may not be installed if using an older version (<0.2.0) or if the installation was incomplete.
fix
Upgrade avidtools to version >=0.2.0: pip install --upgrade avidtools
breaking In version 0.3.0, the 'enrich' terminology was renamed to 'normalize' across connectors. Code using old attribute names like `enrich()` will break.
fix Replace all `connector.enrich(...)` calls with `connector.normalize(...)`.
deprecated The `typing-extensions` dependency is only required for Python <3.13. In future versions it may become optional; avoid relying on it for projects targeting Python 3.12+.
fix Use `import typing; typing.Protocol` etc. directly if on Python 3.13+.
gotcha Connectors for Garak and Inspect require specific log file formats. Using mismatched input will silently produce empty reports.
fix Ensure input files are valid JSON/YAML from the respective evaluation framework. Refer to `avidtools.connectors` docs for schema expectations.
gotcha The `avidtools.client` module requires setting an API key via `set_api_key()` or environment variable `AVID_API_KEY`. Missing API key causes authentication errors with AVID Cloud features.
fix Set `AVID_API_KEY` environment variable or call `avidtools.client.set_api_key('your-key')` before using cloud features.

Basic usage: import avidtools, use a connector (e.g., garak) to convert evaluation output into an AVID report, then access report fields.

import avidtools
from avidtools.connectors import garak

# Create an AVID report from a Garak run
report = garak.from_output('path/to/garak/log.json')
print(report.title)
print(report.vulnerability[0].description)

# Optional: set AVID API key via environment variable
# import os; avidtools.client.set_api_key(os.environ.get('AVID_API_KEY', ''))