Spaces:
Sleeping
Sleeping
arun3676 commited on
Commit Β·
74dbaef
1
Parent(s): 0a4790d
Remove Google Gemini support - keep only 3 models (OpenAI, Anthropic, DeepSeek)
Browse files- README.md +22 -26
- analyzer/llm_clients.py +0 -15
- app.py +0 -1
- render.yaml +1 -3
- requirements.txt +0 -1
README.md
CHANGED
|
@@ -8,14 +8,14 @@ A professional code analysis tool that leverages multiple Large Language Models
|
|
| 8 |
|
| 9 |
## β¨ Features
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
|
| 20 |
## π Live Demo
|
| 21 |
|
|
@@ -32,12 +32,11 @@ A professional code analysis tool that leverages multiple Large Language Models
|
|
| 32 |
|
| 33 |
### Prerequisites
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
- DeepSeek API Key
|
| 41 |
|
| 42 |
### Installation
|
| 43 |
|
|
@@ -70,7 +69,6 @@ Edit `.env.local` with your actual API keys:
|
|
| 70 |
# API Keys - Replace with your actual API keys
|
| 71 |
OPENAI_API_KEY=your_openai_api_key_here
|
| 72 |
ANTHROPIC_API_KEY=your_anthropic_api_key_here
|
| 73 |
-
GEMINI_API_KEY=your_google_api_key_here
|
| 74 |
DEEPSEEK_API_KEY=your_deepseek_api_key_here
|
| 75 |
```
|
| 76 |
|
|
@@ -120,12 +118,11 @@ llm-code-analyzer/
|
|
| 120 |
|
| 121 |
### Supported LLM Providers
|
| 122 |
|
| 123 |
-
| Provider
|
| 124 |
-
|---------
|
| 125 |
-
| OpenAI
|
| 126 |
-
| Anthropic | Claude 3 Haiku |
|
| 127 |
-
|
|
| 128 |
-
| DeepSeek | DeepSeek Chat | `DEEPSEEK_API_KEY` |
|
| 129 |
|
| 130 |
### Supported Programming Languages
|
| 131 |
|
|
@@ -215,11 +212,10 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
|
|
| 215 |
|
| 216 |
## π Acknowledgments
|
| 217 |
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
- [DeepSeek](https://www.deepseek.com/) for DeepSeek Coder
|
| 223 |
|
| 224 |
## π Support
|
| 225 |
|
|
|
|
| 8 |
|
| 9 |
## β¨ Features
|
| 10 |
|
| 11 |
+
* **π€ Multi-Model Analysis**: Compare insights from OpenAI GPT-4, Anthropic Claude, and DeepSeek
|
| 12 |
+
* **π Comprehensive Code Review**: Get quality scores, identify bugs, security issues, and performance concerns
|
| 13 |
+
* **π Language Auto-Detection**: Automatically detects programming language or manually specify
|
| 14 |
+
* **π¨ Clean Professional UI**: Built with Streamlit for a modern, responsive interface
|
| 15 |
+
* **β‘ Lightweight & Fast**: Optimized for deployment on platforms like Render
|
| 16 |
+
* **π Secure**: API keys are securely managed through environment variables
|
| 17 |
+
* **π Real-time Metrics**: Track analysis time, quality scores, and model comparisons
|
| 18 |
+
* **π€ Consensus Analysis**: Identify issues that multiple models agree on
|
| 19 |
|
| 20 |
## π Live Demo
|
| 21 |
|
|
|
|
| 32 |
|
| 33 |
### Prerequisites
|
| 34 |
|
| 35 |
+
* Python 3.11 or higher
|
| 36 |
+
* API keys for at least one LLM provider:
|
| 37 |
+
* OpenAI API Key
|
| 38 |
+
* Anthropic API Key
|
| 39 |
+
* DeepSeek API Key
|
|
|
|
| 40 |
|
| 41 |
### Installation
|
| 42 |
|
|
|
|
| 69 |
# API Keys - Replace with your actual API keys
|
| 70 |
OPENAI_API_KEY=your_openai_api_key_here
|
| 71 |
ANTHROPIC_API_KEY=your_anthropic_api_key_here
|
|
|
|
| 72 |
DEEPSEEK_API_KEY=your_deepseek_api_key_here
|
| 73 |
```
|
| 74 |
|
|
|
|
| 118 |
|
| 119 |
### Supported LLM Providers
|
| 120 |
|
| 121 |
+
| Provider | Model | API Key Environment Variable |
|
| 122 |
+
| --------- | -------------- | ---------------------------- |
|
| 123 |
+
| OpenAI | GPT-4o-mini | OPENAI\_API\_KEY |
|
| 124 |
+
| Anthropic | Claude 3 Haiku | ANTHROPIC\_API\_KEY |
|
| 125 |
+
| DeepSeek | DeepSeek Chat | DEEPSEEK\_API\_KEY |
|
|
|
|
| 126 |
|
| 127 |
### Supported Programming Languages
|
| 128 |
|
|
|
|
| 212 |
|
| 213 |
## π Acknowledgments
|
| 214 |
|
| 215 |
+
* Streamlit for the amazing framework
|
| 216 |
+
* OpenAI for GPT models
|
| 217 |
+
* Anthropic for Claude
|
| 218 |
+
* DeepSeek for DeepSeek Coder
|
|
|
|
| 219 |
|
| 220 |
## π Support
|
| 221 |
|
analyzer/llm_clients.py
CHANGED
|
@@ -32,11 +32,6 @@ class LLMClientManager:
|
|
| 32 |
if os.getenv("ANTHROPIC_API_KEY"):
|
| 33 |
self.clients["anthropic"] = anthropic.Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))
|
| 34 |
|
| 35 |
-
# Google Gemini
|
| 36 |
-
if os.getenv("GEMINI_API_KEY"):
|
| 37 |
-
genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
| 38 |
-
self.clients["gemini"] = genai.GenerativeModel('gemini-pro')
|
| 39 |
-
|
| 40 |
# DeepSeek (uses OpenAI-compatible API)
|
| 41 |
if os.getenv("DEEPSEEK_API_KEY"):
|
| 42 |
self.clients["deepseek"] = openai.OpenAI(
|
|
@@ -51,8 +46,6 @@ class LLMClientManager:
|
|
| 51 |
models["openai"] = "OpenAI GPT-4"
|
| 52 |
if "anthropic" in self.clients:
|
| 53 |
models["anthropic"] = "Claude 3"
|
| 54 |
-
if "gemini" in self.clients:
|
| 55 |
-
models["gemini"] = "Google Gemini"
|
| 56 |
if "deepseek" in self.clients:
|
| 57 |
models["deepseek"] = "DeepSeek Coder"
|
| 58 |
return models
|
|
@@ -85,14 +78,6 @@ class LLMClientManager:
|
|
| 85 |
success=True
|
| 86 |
)
|
| 87 |
|
| 88 |
-
elif model == "gemini" and "gemini" in self.clients:
|
| 89 |
-
response = self.clients["gemini"].generate_content(prompt)
|
| 90 |
-
return LLMResponse(
|
| 91 |
-
content=response.text,
|
| 92 |
-
model="Google Gemini",
|
| 93 |
-
success=True
|
| 94 |
-
)
|
| 95 |
-
|
| 96 |
elif model == "deepseek" and "deepseek" in self.clients:
|
| 97 |
try:
|
| 98 |
response = self.clients["deepseek"].chat.completions.create(
|
|
|
|
| 32 |
if os.getenv("ANTHROPIC_API_KEY"):
|
| 33 |
self.clients["anthropic"] = anthropic.Anthropic(api_key=os.getenv("ANTHROPIC_API_KEY"))
|
| 34 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
# DeepSeek (uses OpenAI-compatible API)
|
| 36 |
if os.getenv("DEEPSEEK_API_KEY"):
|
| 37 |
self.clients["deepseek"] = openai.OpenAI(
|
|
|
|
| 46 |
models["openai"] = "OpenAI GPT-4"
|
| 47 |
if "anthropic" in self.clients:
|
| 48 |
models["anthropic"] = "Claude 3"
|
|
|
|
|
|
|
| 49 |
if "deepseek" in self.clients:
|
| 50 |
models["deepseek"] = "DeepSeek Coder"
|
| 51 |
return models
|
|
|
|
| 78 |
success=True
|
| 79 |
)
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
elif model == "deepseek" and "deepseek" in self.clients:
|
| 82 |
try:
|
| 83 |
response = self.clients["deepseek"].chat.completions.create(
|
app.py
CHANGED
|
@@ -100,7 +100,6 @@ if analyzer is None:
|
|
| 100 |
**Required Environment Variables:**
|
| 101 |
- `OPENAI_API_KEY` - For OpenAI GPT-4 analysis
|
| 102 |
- `ANTHROPIC_API_KEY` - For Claude analysis
|
| 103 |
-
- `GEMINI_API_KEY` - For Google Gemini analysis
|
| 104 |
- `DEEPSEEK_API_KEY` - For DeepSeek analysis
|
| 105 |
|
| 106 |
At least one API key is required for the application to work.
|
|
|
|
| 100 |
**Required Environment Variables:**
|
| 101 |
- `OPENAI_API_KEY` - For OpenAI GPT-4 analysis
|
| 102 |
- `ANTHROPIC_API_KEY` - For Claude analysis
|
|
|
|
| 103 |
- `DEEPSEEK_API_KEY` - For DeepSeek analysis
|
| 104 |
|
| 105 |
At least one API key is required for the application to work.
|
render.yaml
CHANGED
|
@@ -5,7 +5,7 @@ services:
|
|
| 5 |
repo: https://github.com/arun3676/ai-code-analyzer.git
|
| 6 |
branch: master
|
| 7 |
buildCommand: pip install -r requirements.txt
|
| 8 |
-
startCommand: streamlit run
|
| 9 |
plan: free
|
| 10 |
healthCheckPath: /?health=true
|
| 11 |
envVars:
|
|
@@ -13,7 +13,5 @@ services:
|
|
| 13 |
sync: false
|
| 14 |
- key: ANTHROPIC_API_KEY
|
| 15 |
sync: false
|
| 16 |
-
- key: GEMINI_API_KEY
|
| 17 |
-
sync: false
|
| 18 |
- key: DEEPSEEK_API_KEY
|
| 19 |
sync: false
|
|
|
|
| 5 |
repo: https://github.com/arun3676/ai-code-analyzer.git
|
| 6 |
branch: master
|
| 7 |
buildCommand: pip install -r requirements.txt
|
| 8 |
+
startCommand: streamlit run matrix_final.py --server.port=$PORT --server.address=0.0.0.0 --server.headless=true --server.enableCORS=false
|
| 9 |
plan: free
|
| 10 |
healthCheckPath: /?health=true
|
| 11 |
envVars:
|
|
|
|
| 13 |
sync: false
|
| 14 |
- key: ANTHROPIC_API_KEY
|
| 15 |
sync: false
|
|
|
|
|
|
|
| 16 |
- key: DEEPSEEK_API_KEY
|
| 17 |
sync: false
|
requirements.txt
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
streamlit>=1.36.0
|
| 2 |
openai>=1.0.0
|
| 3 |
anthropic>=0.25.0
|
| 4 |
-
google-generativeai>=0.6.0
|
| 5 |
python-dotenv>=1.0.0
|
| 6 |
requests>=2.32.0
|
| 7 |
typing-extensions>=4.0.0
|
|
|
|
| 1 |
streamlit>=1.36.0
|
| 2 |
openai>=1.0.0
|
| 3 |
anthropic>=0.25.0
|
|
|
|
| 4 |
python-dotenv>=1.0.0
|
| 5 |
requests>=2.32.0
|
| 6 |
typing-extensions>=4.0.0
|