AI Code Classifier Tool
Reason this release was yanked:
superseded by 0.1.7
Project description
Aegis: AI vs. Human Python Code Classifier
Overview
Aegis is a fine-tuned CodeBERT model designed to classify AI-generated and human Python code. While CodeBERT contains 125 million parameters, Aegis was efficiently trained locally using LoRA (Low-Rank Adaptation), updating only a subset of the original parameters.
This project investigates classifying code based on semantic differences. Consequently, the dataset (20K Python samples: 10K AI + 10K Human) was aggressively cleaned to ensure standard formatting and the removal of comments and docstrings. A confidence threshold of 0.7 was established to flag samples as AI-generated only when strong evidence exists. Aegis is not a definitive judge; predictions can be imperfect, particularly in tasks where semantic convergence between humans and AI is observed (e.g., LeetCode solutions).
Installation
pip install aegis-detect
CLI Usage
Supported commands:
# Predicting using a file
aegis --file path/to/code.py
# Predicting using text
aegis --text "def add(a, b):\n return a + b"
# JSON output
aegis --file path/to/code.py --json > result.json
# Setting a threshold for AI classification
aegis --file path/to/code.py --threshold 0.7
# Help
aegis --help
# Uninstall
aegis-cleanup
pip uninstall aegis-detect
Notes:
- On first run, the model adapter is downloaded from the Hugging Face repo anthonyq7/aegis and cached under
~/.aegis/models. - Internet access is required on the first run; subsequent runs use local cache.
- The CLI prints the predicted label and probabilities for human and AI.
Contact
Email: a.j.qin@wustl.edu
Email: ethanqin@bu.edu
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aegis_detect-0.1.6.tar.gz.
File metadata
- Download URL: aegis_detect-0.1.6.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac1b221fd13e9890c1f3cb0adaeaf0653ec59266fb21f0339c3a199c6788eec3
|
|
| MD5 |
88f0b1ac541041830cff3f4a69b9971b
|
|
| BLAKE2b-256 |
df206a1dee51975c3e2262540a50a6ce5d875149a90d50ef0c75be197956c5aa
|
File details
Details for the file aegis_detect-0.1.6-py3-none-any.whl.
File metadata
- Download URL: aegis_detect-0.1.6-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f838f55f8788beaf5ca6f4e1ba6f3cb29bc4f52971e794317f01c562ccbc1d1
|
|
| MD5 |
e81e5b7d41c6530a4ebf00d8c019fc78
|
|
| BLAKE2b-256 |
7b859297a281183174a4449cca0e5917efc6101be28b3582460f0190a7cbee49
|