{"id":25616676,"url":"https://github.com/monarch1108/ai_code_reviewer","last_synced_at":"2026-05-05T15:33:16.043Z","repository":{"id":278555203,"uuid":"936010114","full_name":"MONARCH1108/AI_code_reviewer","owner":"MONARCH1108","description":"GenAI - AI Code Reviewer analyzes Python code using Gemini AI, detects bugs, suggests fixes, and provides improved code snippets via Streamlit.","archived":false,"fork":false,"pushed_at":"2025-02-20T11:39:02.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-20T12:31:02.114Z","etag":null,"topics":["gemini-api","generative-ai","streamlit"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MONARCH1108.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-20T11:38:08.000Z","updated_at":"2025-02-20T11:40:29.000Z","dependencies_parsed_at":"2025-02-20T12:42:07.699Z","dependency_job_id":null,"html_url":"https://github.com/MONARCH1108/AI_code_reviewer","commit_stats":null,"previous_names":["monarch1108/ai_code_reviewer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MONARCH1108%2FAI_code_reviewer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MONARCH1108%2FAI_code_reviewer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MONARCH1108%2FAI_code_reviewer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MONARCH1108%2FAI_code_reviewer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MONARCH1108","download_url":"https://codeload.github.com/MONARCH1108/AI_code_reviewer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240122804,"owners_count":19751178,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gemini-api","generative-ai","streamlit"],"created_at":"2025-02-22T04:17:58.189Z","updated_at":"2026-05-05T15:33:16.038Z","avatar_url":"https://github.com/MONARCH1108.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 AI Code Reviewer\n\nA web-based AI-powered tool that reviews Python code, detects bugs, suggests improvements, and generates human-friendly documentation using language models.\n\n---\n### Documentation : https://medium.com/@abhayemani8/ai-code-reviewer-documentation-0a17280adcfd\n![image](https://github.com/user-attachments/assets/16ccb5e8-3fb7-43e8-8c26-77b91fc0cb5e)\n\n## 📌 Overview\n\nThis project demonstrates the evolution of a code reviewer app through two versions:\n\n- **Version 1**: Built with guidance from ChatGPT and tutorials. It uses Google's Gemini API and Streamlit for quick prototyping.\n- **Version 2**: Fully self-written using Flask and a local Ollama LLM (`llama3.2`) for offline, more customizable AI processing.\n\n---\n\n## 🧾 Table of Contents\n\n- [Project Structure](#file-structure)\n- [Version Highlights](#version-highlights)\n- [Tech Stack](#tech-stack)\n- [Setup \u0026 Installation](#setup--installation)\n- [How to Run](#how-to-run)\n- [Learnings \u0026 Evolution](#learnings--evolution)\n- [Screenshots](#screenshots) *(optional)*\n- [License](#license)\n\n---\n\n## 📁 File Structure\n\n```bash\n.\n├── version_1/                   # Streamlit + Gemini API version\n│   ├── app.py\n│   └── .env (Google API key)\n│\n├── version_2/                   # Flask + Ollama + Llama3.2 version\n│   ├── app.py\n│   ├── templates/\n│   │   └── index.html\n│   └── utils/\n│       └── functions.py\n│\n├── README.md\n└── requirements.txt             # Optional, depending on environment\n```\n\n## ✨ Version Highlights\n\n### 🔹 Version 1 (Assisted Build)\n\n- Built using **Streamlit** for fast UI.\n    \n- Uses **Google Gemini API** via `google.generativeai`.\n    \n- Offers simple input/output layout for quick feedback.\n    \n\n### 🔸 Version 2 (Self-Built)\n\n- Built using **Flask** from scratch.\n    \n- Implements **Ollama** with a **locally running `llama3.2` model**.\n    \n- Enhanced prompt engineering for better review quality.\n    \n- Beautiful **custom HTML/CSS UI** for better user experience.\n    \n- Contains robust instructions for context filtering (code-only reviews).\n\n|Area|Tools Used|\n|---|---|\n|Frontend|Streamlit (v1), HTML/CSS (v2)|\n|Backend|Python, Flask|\n|LLM|Google Gemini API (v1), Ollama LLM (`llama3.2`) (v2)|\n|Environment|dotenv (`.env`), virtualenv|\n\n## ⚙️ Setup \u0026 Installation\n\n### 🧪 Version 1\n```bash\ncd version_1\npython -m venv venv\nsource venv/bin/activate       # Windows: venv\\Scripts\\activate\npip install streamlit google.generativeai \n```\n\n# Set your Google API Key in .env\n```bash\necho GOOGLE_API_KEY=your_key_here \u003e .env\n\nstreamlit run app.py\n```\n\n### 🛠️ Version 2\n```bash\ncd version_2\npython -m venv venv\nsource venv/bin/activate\npip install flask ollama\n\n# Make sure Ollama is installed and running\nollama run llama3.2\n\npython app.py\n```\n\n## 🧠 Learnings \u0026 Evolution\n### Version 1 \n - taught me the basics of API calls, prompt structuring, and how to quickly prototype with Streamlit.\n\n### Version 2 \n - was my full-stack build using Flask, local LLMs, and custom UI — improving my understanding of backend routing, HTML templating, and deploying AI models locally.\n \n- Implemented stricter prompt rules and better error handling in v2.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonarch1108%2Fai_code_reviewer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonarch1108%2Fai_code_reviewer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonarch1108%2Fai_code_reviewer/lists"}