Catalog PyPI
Back to packageRELEASE DETAILS

1.0.0

PyPI

aegis-detect

AI Code Classifier Tool

Published11 Jul 2026
Direct dependencies16
Transitive dependenciesNot calculated

README

Version 1.0.0 documentation

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.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 16

Native requirements
16 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
huggingface-hub
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
huggingface-hub>=0.15.0runtime
numpy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
numpy>=1.21.0runtime
peft
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
peft>=0.4.0runtime
safetensors
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
safetensors>=0.3.0runtime
torch
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
torch>=2.0.0runtime
transformers
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
transformers>=4.30.0runtime
accelerate
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
accelerate>=0.20.0; extra == "dev"runtime
datasets
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
datasets>=2.0.0; extra == "dev"runtime
matplotlib
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
matplotlib>=3.5.0; extra == "dev"runtime
openai
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
openai>=1.0.0; extra == "dev"runtime
pandas
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
pandas>=1.5.0; extra == "dev"runtime
python-dotenv
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
python-dotenv>=0.19.0; extra == "dev"runtime
scikit-learn
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
scikit-learn>=1.0.0; extra == "dev"runtime
seaborn
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
seaborn>=0.13.2; extra == "dev"runtime
tqdm
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
tqdm>=4.60.0; extra == "dev"runtime
aegis-detect
Environment
{
  "extras": "dev",
  "marker": "extra == \"all\"",
  "requires_python": ">=3.10",
  "evaluation": "NOT_EVALUATED"
}
aegis-detect[dev]; extra == "all"runtime

Distribution files

2 collected
aegis_detect-1.0.0-py3-none-any.whl

bdist_wheel · 6.21 KB · Python py3

Source file
aegis_detect-1.0.0.tar.gz

sdist · 5.57 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:16 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:ebf5cfbd6d359d544b3e9731ee19acca6e9c930dd190689f8773650713ce23bf

Other collected versions

View all collected versions →