Skip to main content

AI-powered intent classification plugin for Opencomplai (EU AI Act)

Project description

opencomplai-ai

License: AGPL-3.0 PyPI Python

The optional AI intent classification plugin for Opencomplai. It adds the --ai-intent flag to opencomplai scan, classifying how each AI callsite in your code is actually used — its decision autonomy, the subjects it acts on, and which EU AI Act risk tier and Annex III area it maps to.

All inference runs locally — models execute on your machine via ONNX Runtime or llama.cpp. No code or prompts leave your environment.

Prerequisites

opencomplai-ai is a plugin. Install the core engine first:

pip install opencomplai-core   # or the opencomplai / opencomplai-cli suite

Install

# Base install — CodeBERT (ONNX) classification, no extra build deps
pip install opencomplai-ai

# Deep install — adds llama.cpp for generative GGUF models
pip install "opencomplai-ai[deep]"

Usage

Once installed alongside the CLI, the --ai-intent flag becomes available on the scan command:

opencomplai scan --ai-intent

By default only callsites in files with lexical findings are annotated (fast). To analyze every callsite in the repository:

opencomplai scan --ai-intent --ai-deep

Useful flags:

Flag Effect
--ai-intent Enable AI intent classification
--ai-model <id> Choose a model (see catalog below)
--ai-deep Annotate every callsite, not just those near lexical findings
--ai-verbose Show all callsite annotations (default: top 10 by risk tier)

Supported models

The default model (codebert-onnx) runs on the base install. The generative GGUF models require the [deep] extra. Models are downloaded from the Hugging Face Hub on first use and cached locally under ~/.opencomplai/.

Model ID Runtime Size Needs [deep]
codebert-onnx (default) ONNX Runtime ~440 MB no
qwen2.5-coder-0.5b llama.cpp ~400 MB yes
qwen2.5-coder-1.5b (recommended) llama.cpp ~1.0 GB yes
smollm2-1.7b llama.cpp ~1.1 GB yes
phi-3.5-mini llama.cpp ~2.2 GB yes
mistral-7b llama.cpp ~4.1 GB yes
opencomplai scan --ai-intent --ai-model qwen2.5-coder-1.5b

Model download flow

On first use of a model, the plugin prompts before downloading and shows a progress bar. The CodeBERT model has no prebuilt ONNX artifact on the Hub, so it is exported from the official PyTorch checkpoint on first run and then cached. Subsequent scans reuse the cached model with no network access.

Documentation

Full AI-intent guide and the model reference at docs.opencomplai.com.

License

AGPL-3.0-only. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencomplai_ai-0.1.2.tar.gz (31.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencomplai_ai-0.1.2-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file opencomplai_ai-0.1.2.tar.gz.

File metadata

  • Download URL: opencomplai_ai-0.1.2.tar.gz
  • Upload date:
  • Size: 31.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opencomplai_ai-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c553a9ede63b7a87fcbd35b6672c394b5f1656cea36bfbb2a5bddd130e95e598
MD5 adf1bb0efd612968ad49828d7fe10368
BLAKE2b-256 2507fe5a5b85559c7a57d999805217c0839fae1309058b794c57a51b7218443b

See more details on using hashes here.

File details

Details for the file opencomplai_ai-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: opencomplai_ai-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for opencomplai_ai-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 355da5a7a861016e033487c317ef0a26c32e2e74a614ddaf2dc6e7459dd09ec9
MD5 4abf257e7622938e45621e196a5de653
BLAKE2b-256 d1acba7c5eb7d3140feaca3db4d994513dee49dee8ea5db4f764ed7fa65a327a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page