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.0.tar.gz (27.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.0-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: opencomplai_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 27.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.0.tar.gz
Algorithm Hash digest
SHA256 63cf3402068e5f7b46a5cd55a44e75d5982d4264c6901801dbb40566a68b78d1
MD5 e0119047d45e3257f24700b12f5e5930
BLAKE2b-256 47a4e519d2744a83ced33858da68ad6ea66828afd76a8d8d827ca3ae32d2d022

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opencomplai_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 29.9 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ed36962e2963e2b68ce8fa5038850ec8d853103794e6894362f1360b37d225bc
MD5 af753893d94f327deec8301c13035118
BLAKE2b-256 6c9b2a030e9cc2a4994167c9e89aa040857e4039c46a3e5273b1a4e486835e68

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