An AI-powered CLI tool that reviews Python code for production readiness. It acts as a Production ML Engineering Assistant, analyzing your code for reliability, maintainability, and scalability gaps.
The agent reviews code through the lens of a Senior ML Engineer, checking for:
- Error Handling & Resilience: Try-catch blocks, OOM protection, timeouts.
- Observability & Monitoring: Logging standards, metrics tracking.
- Configuration Management: No hardcoded credentials/hyperparams.
- Resource Management: GPU memory cleanup, connection pooling.
- Testing & Validation: Unit tests, input validation.
- Code Quality: Type hints, docstrings, DRY validation.
- Security: Input sanitization, secrets management.
-
Clone the repository:
git clone git@github.com:shahjui2000/ProductionCodeChecker.git cd ProductionCodeChecker -
Set up a virtual environment (recommended):
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
- Get a free Hugging Face Token from here.
- Create a
.envfile in the root directory:cp .env.example .env
- Add your token to
.env:HF_TOKEN=hf_YourTokenHere
Run the agent on any Python file:
python3 main.py path/to/your/script.py| Flag | Description | Default |
|---|---|---|
--model |
Hugging Face Model ID to use | Qwen/Qwen2.5-Coder-32B-Instruct |
--api-key |
Pass HF Token directly (overrides .env) | None |
Analyze the included test file:
python3 main.py test_bad_code.pyOutput Snippet:
### 7. Security
- **Issue**: Hardcoded AWS credentials.
- **Severity**: Critical
- **Suggested Fix**: Use environment variables for AWS credentials.The agent has been verified against production-grade codebases, including:
- OpenAI Python SDK (
_base_client.py): Identified subtle improvement opportunities in error handling specificity and configuration validation, demonstrating value even for mature codebases.
MIT