Update README.md
Browse files
README.md
CHANGED
|
@@ -7,63 +7,159 @@ colorTo: purple
|
|
| 7 |
sdk: gradio
|
| 8 |
sdk_version: 5.49.1
|
| 9 |
---
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
Paste your code in the code editor
|
|
|
|
| 20 |
Select the programming language
|
| 21 |
-
Choose analysis type: Security Vulnerabilities, Code Quality, or Both
|
| 22 |
-
Click "Analyze Code" to get insights
|
| 23 |
-
Or load one of the pre-built vulnerable code examples
|
| 24 |
-
π§ Model
|
| 25 |
-
|
| 26 |
-
Powered by CodeAstra-7B, a state-of-the-art vulnerability detection model with 83% accuracy, fine-tuned on:
|
| 27 |
-
|
| 28 |
-
CVEFix dataset
|
| 29 |
-
YesWeHack vulnerable code repository
|
| 30 |
-
OWASP test cases
|
| 31 |
-
80+ programming languages from The Stack
|
| 32 |
-
π Performance
|
| 33 |
-
|
| 34 |
-
CodeAstra-7B achieves superior performance compared to other models:
|
| 35 |
-
|
| 36 |
-
Model Accuracy
|
| 37 |
-
GPT-4o 88.78%
|
| 38 |
-
CodeAstra-7B 83.00%
|
| 39 |
-
CodeBERT 62.08%
|
| 40 |
-
RoBERTa 61.05%
|
| 41 |
-
π§ Technical Stack
|
| 42 |
-
Frontend: Gradio 4.19.2
|
| 43 |
-
Model: CodeAstra-7B (Mistral-7B-Instruct fine-tuned)
|
| 44 |
-
Inference: PEFT with 4-bit quantization for efficient GPU usage
|
| 45 |
-
Backend: Transformers, PyTorch, BitsAndBytes
|
| 46 |
-
π¨βπ» About the Creator
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
Built with β€οΈ by Syed Tahir Hussan
|
| 49 |
|
| 50 |
-
|
| 51 |
-
π M.S. Software Engineering
|
| 52 |
-
π’ Founder, STH Research Center for Advanced Technologies
|
| 53 |
-
π§ LinkedIn | GitHub
|
| 54 |
-
β οΈ Limitations
|
| 55 |
-
Works best with code snippets under 2048 tokens
|
| 56 |
-
May not catch all vulnerabilities (use as part of comprehensive security review)
|
| 57 |
-
Performance varies with code complexity
|
| 58 |
-
Best results with English comments
|
| 59 |
-
π License
|
| 60 |
-
|
| 61 |
-
Apache 2.0 License - Free for commercial and non-commercial use
|
| 62 |
-
|
| 63 |
-
π Acknowledgements
|
| 64 |
-
Hugging Face for hosting infrastructure
|
| 65 |
-
CodeAstra-7B by Harish Santhanalakshmi Ganesan
|
| 66 |
-
Mistral AI for the base model
|
| 67 |
-
BigCode Initiative for The Stack dataset
|
| 68 |
-
|
| 69 |
-
Disclaimer: This tool is for educational and assistive purposes. Always conduct thorough manual security audits for production code.
|
|
|
|
| 7 |
sdk: gradio
|
| 8 |
sdk_version: 5.49.1
|
| 9 |
---
|
| 10 |
+
π STHASI Code Review Assistant
|
| 11 |
+
|
| 12 |
+
An AI-powered code review assistant that analyzes code quality, detects security vulnerabilities, and suggests improvements.
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
π Features
|
| 16 |
+
|
| 17 |
+
Code Quality Analysis: Evaluate code structure, readability, and best practices
|
| 18 |
+
|
| 19 |
+
Security Vulnerability Detection: Identify SQL injection, XSS, authentication flaws, and more
|
| 20 |
+
|
| 21 |
+
Improvement Suggestions: Get performance optimizations and refactoring recommendations
|
| 22 |
+
|
| 23 |
+
Bug Detection: Find logic errors, edge cases, and potential issues
|
| 24 |
+
|
| 25 |
+
Multi-Language Support: Python, JavaScript, Java, C++, Go, Rust, PHP, and more
|
| 26 |
+
|
| 27 |
+
π Technology Stack
|
| 28 |
+
|
| 29 |
+
Model: Qwen2.5-Coder-7B-Instruct (State-of-the-art code understanding)
|
| 30 |
+
|
| 31 |
+
Framework: Gradio 5.49.1
|
| 32 |
+
|
| 33 |
+
Platform: Hugging Face Spaces
|
| 34 |
+
|
| 35 |
+
π¦ Installation
|
| 36 |
+
For Hugging Face Spaces Deployment:
|
| 37 |
+
|
| 38 |
+
Create a new Space on Hugging Face
|
| 39 |
+
|
| 40 |
+
Choose "Gradio" as the SDK
|
| 41 |
+
|
| 42 |
+
Upload the following files:
|
| 43 |
+
|
| 44 |
+
app.py
|
| 45 |
+
|
| 46 |
+
requirements.txt
|
| 47 |
+
|
| 48 |
+
README.md
|
| 49 |
+
|
| 50 |
+
Set the Space to use GPU (recommended: T4 or A10G)
|
| 51 |
+
For Local Development:
|
| 52 |
+
# Clone the repository
|
| 53 |
+
git clone <your-repo-url>
|
| 54 |
+
cd sthasi-code-review-assistant
|
| 55 |
+
|
| 56 |
+
# Install dependencies
|
| 57 |
+
pip install -r requirements.txt
|
| 58 |
+
|
| 59 |
+
# Run the application
|
| 60 |
+
python app.py
|
| 61 |
+
|
| 62 |
+
π― Usage
|
| 63 |
+
|
| 64 |
Paste your code in the code editor
|
| 65 |
+
|
| 66 |
Select the programming language
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
+
Choose analysis type:
|
| 69 |
+
|
| 70 |
+
Full Analysis (Quality + Security + Improvements)
|
| 71 |
+
|
| 72 |
+
Security Vulnerabilities Only
|
| 73 |
+
|
| 74 |
+
Code Quality & Improvements
|
| 75 |
+
|
| 76 |
+
Bug Detection
|
| 77 |
+
|
| 78 |
+
Click "Analyze Code" and get comprehensive feedback
|
| 79 |
+
π Supported Languages
|
| 80 |
+
|
| 81 |
+
Python
|
| 82 |
+
|
| 83 |
+
JavaScript
|
| 84 |
+
|
| 85 |
+
Java
|
| 86 |
+
|
| 87 |
+
C/C++
|
| 88 |
+
|
| 89 |
+
C#
|
| 90 |
+
|
| 91 |
+
Go
|
| 92 |
+
|
| 93 |
+
Rust
|
| 94 |
+
|
| 95 |
+
PHP
|
| 96 |
+
|
| 97 |
+
Ruby
|
| 98 |
+
|
| 99 |
+
TypeScript
|
| 100 |
+
|
| 101 |
+
SQL
|
| 102 |
+
|
| 103 |
+
Bash
|
| 104 |
+
|
| 105 |
+
Kotlin
|
| 106 |
+
|
| 107 |
+
Swift
|
| 108 |
+
|
| 109 |
+
π§ Advanced Settings
|
| 110 |
+
|
| 111 |
+
Temperature: Control response creativity (0.1-1.0)
|
| 112 |
+
|
| 113 |
+
Max Tokens: Set maximum analysis length (512-4096)
|
| 114 |
+
|
| 115 |
+
π Analysis Types
|
| 116 |
+
π Full Analysis
|
| 117 |
+
|
| 118 |
+
Comprehensive review covering code quality, security, and improvements
|
| 119 |
+
|
| 120 |
+
π‘οΈ Security Vulnerabilities Only
|
| 121 |
+
|
| 122 |
+
Focused security analysis with severity ratings and CVE references
|
| 123 |
+
|
| 124 |
+
β¨ Code Quality & Improvements
|
| 125 |
+
|
| 126 |
+
Evaluation of code structure, performance, and best practices
|
| 127 |
+
|
| 128 |
+
π Bug Detection
|
| 129 |
+
|
| 130 |
+
Identification of syntax errors, logic errors, and edge case failures
|
| 131 |
+
|
| 132 |
+
β οΈ Important Notes
|
| 133 |
+
|
| 134 |
+
This is an AI-powered tool. Always verify critical security findings with manual review
|
| 135 |
+
|
| 136 |
+
The tool provides suggestions based on best practices and common vulnerabilities
|
| 137 |
+
|
| 138 |
+
For production systems, consult with security experts for comprehensive audits
|
| 139 |
+
|
| 140 |
+
π€ Contributing
|
| 141 |
+
|
| 142 |
+
Contributions are welcome! Please feel free to submit issues or pull requests.
|
| 143 |
+
|
| 144 |
+
π Contact
|
| 145 |
+
|
| 146 |
+
Syed Tahir Hussan
|
| 147 |
+
|
| 148 |
+
LinkedIn: syedtahirhussan
|
| 149 |
+
|
| 150 |
+
GitHub: SyedTahirHussan
|
| 151 |
+
|
| 152 |
+
π License
|
| 153 |
+
|
| 154 |
+
This project is open source and available under the MIT License.
|
| 155 |
+
|
| 156 |
+
π Acknowledgments
|
| 157 |
+
|
| 158 |
+
Powered by Qwen2.5-Coder-7B-Instruct
|
| 159 |
+
|
| 160 |
+
Built with Gradio
|
| 161 |
+
|
| 162 |
+
Hosted on Hugging Face Spaces
|
| 163 |
Built with β€οΈ by Syed Tahir Hussan
|
| 164 |
|
| 165 |
+
Made with β€οΈ for the developer community
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|