{"id":26543766,"url":"https://github.com/mimo-x/code-review-gpt-gitlab","last_synced_at":"2025-05-15T13:05:35.637Z","repository":{"id":202590546,"uuid":"707248455","full_name":"mimo-x/Code-Review-GPT-Gitlab","owner":"mimo-x","description":"🤖 GPT（ Deepseek and more ） Code Review for Gitlab （针对于 Gitlab 的 LLM 辅助 Code Review 工具）项目详细文档 👇🏻","archived":false,"fork":false,"pushed_at":"2025-04-08T06:15:57.000Z","size":5546,"stargazers_count":636,"open_issues_count":22,"forks_count":65,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-15T13:05:35.111Z","etag":null,"topics":["bot","codeanalysis","codereview","gitlab","gpt","llm"],"latest_commit_sha":null,"homepage":"https://tqz0rsrhsvf.feishu.cn/docx/FlgzdMrj0oYOg2xXY7EcrsZZnjb?from=from_copylink","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/mimo-x.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,"zenodo":null}},"created_at":"2023-10-19T14:10:10.000Z","updated_at":"2025-05-15T05:55:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"1816dfdf-573d-4c6c-8b9d-abf0daf328db","html_url":"https://github.com/mimo-x/Code-Review-GPT-Gitlab","commit_stats":null,"previous_names":["mimo-x/code-review-gpt-gitlab"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimo-x%2FCode-Review-GPT-Gitlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimo-x%2FCode-Review-GPT-Gitlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimo-x%2FCode-Review-GPT-Gitlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mimo-x%2FCode-Review-GPT-Gitlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mimo-x","download_url":"https://codeload.github.com/mimo-x/Code-Review-GPT-Gitlab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"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":["bot","codeanalysis","codereview","gitlab","gpt","llm"],"created_at":"2025-03-22T03:15:11.887Z","updated_at":"2025-05-15T13:05:35.618Z","avatar_url":"https://github.com/mimo-x.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/img/log.png\" style=\"width:500px;\"/\u003e\n\u003c/p\u003e\n\n\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"./README_EN.md\"\u003eEnglish README\u003c/a\u003e | \u003ca href=\"./README.md\"\u003e中文 README\u003c/a\u003e\n\u003c/h4\u003e\n\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"https://tqz0rsrhsvf.feishu.cn/docx/FlgzdMrj0oYOg2xXY7EcrsZZnjb?from=from_copylink\"\u003e📚 官方文档\u003c/a\u003e\n\u003c/h4\u003e\n\u003ch4 align=\"center\"\u003e\n  \u003ca href=\"#项目描述-\"\u003e🔍 项目描述\u003c/a\u003e •\n  \u003ca href=\"#功能预览-\"\u003e🍭 功能预览\u003c/a\u003e •\n  \u003ca href=\"#部署-\"\u003e🔧 部署安装\u003c/a\u003e •\n  \u003ca href=\"#待办清单-\"\u003e📌 待办清单\u003c/a\u003e\n  \u003ca href=\"#交流-\"\u003e🚗 联系我们 \u003c/a\u003e\n\u003c/h4\u003e\n\n\u003ch5 align=\"center\"\u003e\n  \u003ca href=\"#powered-by-mobvista---汇量科技\"\u003ePowered By Mobvista 汇量科技 - 技术团队\u003c/a\u003e\n\u003c/h5\u003e\n\n# 项目描述 📚\n\n\u003e 一个利用大模型帮助我们在 Gitlab 上进行 Code Review 提升研发效能的项目 💪🏻 (( 包括但不限于 GPT 、DeepSeek 等🎁))\n\n**这个项目有什么特点? ✨** \n\n🐶 针对于 **\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e Gitlab \u003c/span\u003e** 定制 (计划支持 Github 、Gitlab 、Gitee 、Bitbucket 等)\n\n🤖 我们正在开发 **\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e Multi-Agent \u003c/span\u003e** 的插件，多个 **\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e Agent \u003c/span\u003e** 协同工作，共同完成评审\n\n🐱 结合了 **\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e 多种大模型对接 \u003c/span\u003e** 的能力  🚀\n\n🦊 能够接入私有化 LLM  **\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e 代码安全问题 \u003c/span\u003e** \n\n🦁 我们将一直关注效能研发 **\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e 最新的Coder Review动态 \u003c/span\u003e** 融入这个项目\n\n\n\n\n# 项目架构 🚗\n### 前期架构\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/img/old-architecture.png\" style=\"width:500px;\"/\u003e\n\u003c/p\u003e\n\n### 🚀 **全新架构升级：更强大、更灵活、更高效！** 🌈\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/img/project_framework.png\" style=\"width:500px;\"/\u003e\n\u003c/p\u003e\n\n🌟 **丰富的模型接入**　支持轻松接入\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e更多的模型\u003c/span\u003e，无论是经典模型还是最新的 AI 模型，都能轻松集成！  \n\n🔧 **高度定制化**　　　开发者可以\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e便捷地自定义处理逻辑和回复机制\u003c/span\u003e，打造专属于你的解决方案！  \n\n🔗 **扩展性强**　　　　模块化设计使得功能扩展更加方便，未来可以\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003e轻松添加新功能\u003c/span\u003e，满足不断变化的需求！  \n\n🛠️ **高可维护性**　　　代码结构清晰，注释详细，便于维护和二次开发，减少开发者的负担！  \n\n\n**快来体验我们的新架构吧，享受前所未有的强大功能和极致体验！✨**\n\n\n\n\n\n\n# 功能预览 🌈\n\n### 1. Gitlab Merge Request 触发评论\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/img/gpt_code_review_gitlab.png\" style=\"width:500px;\"/\u003e\n\u003c/p\u003e\n\n### 2. 钉钉消息通知\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/img/img.png\" style=\"width:500px;\"/\u003e\n\u003c/p\u003e\n\n### 3. 更多种大模型接入\n1. 可通过实现项目接口快速接入自定义模型，具体配置方式参见[config.md](doc/config.md)。\n2. 项目通过[UnionLLM](https://github.com/EvalsOne/UnionLLM/)进行多模型支持，\n兼容[LiteLLM](https://docs.litellm.ai/docs)，默认支持模型如下表所示。\n\n\u003ctable style=\"width:100%; text-align:center; border-collapse:collapse;\"\u003e\n  \u003ctr\u003e\n    \u003ctd style=\"color:rgb(0, 64, 255); font-weight: bold;\"\u003eOpenAI 🔥\u003c/td\u003e\n    \u003ctd\u003eAzure\u003c/td\u003e\n    \u003ctd\u003eAWS - SageMaker\u003c/td\u003e\n    \u003ctd\u003eAWS - Bedrock\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eGoogle - Vertex_AI\u003c/td\u003e\n    \u003ctd\u003eGoogle - Palm\u003c/td\u003e\n    \u003ctd\u003eGoogle AI Studio - Gemini\u003c/td\u003e\n    \u003ctd\u003eMistral AI API\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eCloudflare AI Workers\u003c/td\u003e\n    \u003ctd\u003eCohere\u003c/td\u003e\n    \u003ctd\u003eAnthropic\u003c/td\u003e\n    \u003ctd\u003eEmpower\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eHuggingface\u003c/td\u003e\n    \u003ctd\u003eReplicate\u003c/td\u003e\n    \u003ctd\u003eTogether_AI\u003c/td\u003e\n    \u003ctd\u003eOpenRouter\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eAI21\u003c/td\u003e\n    \u003ctd\u003eBaseten\u003c/td\u003e\n    \u003ctd\u003eVllm\u003c/td\u003e\n    \u003ctd\u003eNLP_Cloud\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eAleph Alpha\u003c/td\u003e\n    \u003ctd\u003ePetals\u003c/td\u003e\n    \u003ctd\u003eOllama\u003c/td\u003e\n    \u003ctd\u003eDeepinfra\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003ePerplexity-AI\u003c/td\u003e\n    \u003ctd\u003eGroq AI\u003c/td\u003e\n    \u003ctd\u003eDeepSeek\u003c/td\u003e\n    \u003ctd\u003eAnyscale\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eIBM - Watsonx.ai\u003c/td\u003e\n    \u003ctd\u003eVoyage AI\u003c/td\u003e\n    \u003ctd\u003eXinference [Xorbits Inference]\u003c/td\u003e\n    \u003ctd\u003eFriendliAI\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003eGaladriel\u003c/td\u003e\n    \u003ctd\u003e智谱AI\u003c/td\u003e\n    \u003ctd\u003e月之暗面 Moonshot\u003c/td\u003e\n    \u003ctd\u003e百度文心一言\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctrd\n    \u003ctd\u003e阿里巴巴通义千问\u003c/td\u003e\n    \u003ctd\u003eMiniMax\u003c/td\u003e\n    \u003ctd\u003e讯飞星火\u003c/td\u003e\n    \u003ctd\u003e百川智能\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e昆仑天工\u003c/td\u003e\n    \u003ctd\u003e零一万物\u003c/td\u003e\n    \u003ctd\u003e阶跃星辰\u003c/td\u003e\n    \u003ctd\u003e字节豆包\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd style=\"color:rgb(0, 64, 255); font-weight: bold;\"\u003e深度求索 DeepSeek 🔥\u003c/td\u003e\n    \u003ctd\u003eMore\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n### 4.自定义更多的通知方式和处理手段\n\n1. 可通过实现自定义``Response``类添加如邮箱，私有机器人等多种通知方式，具体教程参见[response.md](doc/response.md)\n2. 可通过自定义更多的``Review Handle``引入自定义的代码审查逻辑，具体教程参见[review.md](doc/review.md)\n\n\n\n\n# 部署 📖\n\n#### Docker 运行\n\n```bash\ngit clone git@github.com:mimo-x/Code-Review-GPT-Gitlab.git\n\ncd Code-Review-GPT-Gitlab\n\nvim ./config/config.py\n\ndocker run -d --network bridge --add-host=host.docker.internal:host-gateway -v ./config:/workspace/config -p 8080:80 --name codereview xuxin1/llmcodereview:latest\n```\n\n#### 源代码运行 💻\n1.**克隆仓库**\n```bash\ngit clone git@github.com:mimo-x/Code-Review-GPT-Gitlab.git\n```\n2.**安装依赖**\n```bash\npip install -r requirements.txt\n```\n3.**修改配置文件**\n```bash\nvim config/config.py\n```\n\n4.**运行**\n```bash\npython3 app.py\n```\n#### **配置Gitlab webhook**\n\u003e 填写```Webhook URL```时，请在域名后添加路径```/git/webhook```，例如：```http://example.com/git/webhook```\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"doc/img/webhookconfig.png\" style=\"width:300px;\"/\u003e\n\u003c/p\u003e\n\n#### **尝试发起一个 Merge Request 吧🎉**\n\n\n\n\n\n\n\n# 待办清单 📌\n\n- ✅ 使用 GPT 进行Code Review\n- ✅ 实现多模型支持\n- [ ] 可以配置更多的触发方式\n  - ✅ Merge Request\n  - [ ] commit\n  - [ ] tag\n- [ ] 兼容飞书的消息通知\n- [ ] 兼容钉钉的消息通知\n- [ ] 结合静态代码分析来提供修改代码的风险等级\n- [ ] 通过pydantic实现大模型输出内容的格式化\n- ✅ 支持插件式自定义 Review 的问题\n\n# 交流 👨‍👨‍👦‍👦\n👏🏻 很高兴你能向我们提出一些问题和修改建议（Issue，PR）, 欢迎 **star 项目 ⭐️** \n\n📮 *Email*：**mixuxin@163.com** \n\n📱 *wx*：**isxuxin**\n\n👨‍👨‍👦‍👦 如果有任何使用问题，欢迎来这里交流（\u003cspan style=\"background-image: linear-gradient(to right, #ff9900, #ff66cc);-webkit-background-clip: text;color: transparent;font-weight: bold;\"\u003eAI 研发效能领域\u003c/span\u003e） 👋 \n\u003cp float=\"left\"\u003e\n  \u003cimg src=\"doc/img/wechat.jpg\" width=\"400\" /\u003e\n  \u003cimg src=\"doc/img/xuxin.png\" width=\"400\" /\u003e \n\u003c/p\u003e\n\n\n\n# 参考文献 📚\n- [(字节)基于大模型 + 知识库的 Code Review 实践](https://mp.weixin.qq.com/s?__biz=Mzg2ODQ1OTExOA==\u0026mid=2247504479\u0026idx=1\u0026sn=1ec09afbb5b5b9b2aaf151994be5fd27\u0026chksm=cea9655ef9deec48b17cbab05ddd1ab04c86736d8b469eaac6f5a707ca110ce4186e8985ff41\u0026mpshare=1\u0026scene=1\u0026srcid=1011C8l5RmCM2EL4Rpl3wdRy\u0026sharer_shareinfo=96d0a83631aaa25db87709baa250085d\u0026sharer_shareinfo_first=96d0a83631aaa25db87709baa250085d#rd)\n- [(美团)代码变更风险可视化系统建设与实践](https://tech.meituan.com/2023/09/22/construction-and-practice-of-code-change-risk-visualization-system.html)\n\n\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=mimo-x/Code-Review-GPT-Gitlab\u0026type=Date)](https://star-history.com/#mimo-x/Code-Review-GPT-Gitlab\u0026Date)\n\n## Powered by [Mobvista - 汇量科技](https://www.mobvista.com)\n\n\u003cp align=\"left\"\u003e\n  \u003cimg src=\"doc/img/Logo-MV.png\" style=\"width:200px;\"/\u003e\n\u003c/p\u003e\n\n\u003e **本项目由 [Mobvista 汇量科技](https://www.mobvista.com) 的技术团队研发及发布。**\n\n[**Mobvista 汇量科技**](https://www.mobvista.com) 是全球领先的开发者增长平台。我们为全球开发者和营销人员**提供完整的广告和分析工具套件**，包括用户**获取、变现、分析、创意自动化和智能媒体采买**等，能大幅提升广告营销ROI，有效帮助移动应用突破增长平台期。 \n\n\n\n\u003e **This tool is developed by the engineering team at [**Mobvista**](https://www.mobvista.com).** \n\nMobvista is a leading mobile technology company that provides **a complete suite of advertising and analytics tools** for app developers and marketers seeking global growth. Offering a range of tailored solutions, such as **user acquisition, monetization, analytics, creative automation, and cross-channel media buying**, Mobvista enables mobile businesses to maximize their potential.\n\nFor more information, please visit our website: www.mobvista.com\n\n\n\n# License 📑\n![github license](https://img.shields.io/github/license/mimo-x/Code-Review-GPT-Gitlab)\n**This project is licensed under the [MIT License](https://chat.openai.com/c/9be6b422-f10c-4379-b152-e756230d54f8#:~:text=%E7%9A%84%E5%AE%8C%E6%95%B4%E6%96%87%E6%9C%AC%EF%BC%9A-,MIT%20License,-%E4%BD%A0%E5%8F%AF%E4%BB%A5%E8%AE%BF%E9%97%AE).**\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmimo-x%2Fcode-review-gpt-gitlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmimo-x%2Fcode-review-gpt-gitlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmimo-x%2Fcode-review-gpt-gitlab/lists"}