Codect is a free and open-source tool designed to detect whether a piece of code was written by an AI or a human. It supports multiple programming languages and provides detailed insights based on various code features such as entropy, comment ratio, AST complexity, and more.
To install Codect and run it locally, follow these steps:
# Clone the repository
git clone https://github.com/GustyCube/Codect.git
cd Codect
# Install dependencies
pip install -r requirements.txt
# Run the Flask API
python main.py
Codect provides two main API endpoints:
/basic
)code
key.{ "result": 1 }
for AI-generated code, { "result": 0 }
for human-written code.Example:
curl -X POST "http://localhost:5000/basic" -H "Content-Type: application/json" -d '{"code": "def add(x, y): return x + y"}'
/premium
)code
key.Example:
curl -X POST "http://localhost:5000/premium" -H "Content-Type: application/json" -d '{"code": "def add(x, y): return x + y"}'
We welcome contributions! Feel free to:
Codect is licensed under the GNU General Public v3.0 license. You are free to modify and distribute the project as needed.
For questions or contributions, open an issue on GitHub or reach out to [email protected]
.
Let us know if you have any suggestions! 🚀