{"id":16359325,"url":"https://github.com/gaborvecsei/prometh-review","last_synced_at":"2025-03-23T01:32:16.047Z","repository":{"id":218924552,"uuid":"654044661","full_name":"gaborvecsei/Prometh-Review","owner":"gaborvecsei","description":"AI Pull-Request Reviewer Companion (in the command line)","archived":false,"fork":false,"pushed_at":"2024-04-11T12:21:05.000Z","size":18,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-18T16:22:45.345Z","etag":null,"topics":["automation","gpt","large-language-models","pull-requests"],"latest_commit_sha":null,"homepage":"https://www.gaborvecsei.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaborvecsei.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-06-15T09:18:26.000Z","updated_at":"2024-04-11T12:24:50.000Z","dependencies_parsed_at":"2024-01-24T14:57:46.734Z","dependency_job_id":"31494887-1637-4f77-9637-f12721a44e60","html_url":"https://github.com/gaborvecsei/Prometh-Review","commit_stats":null,"previous_names":["gaborvecsei/prometh-review"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FPrometh-Review","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FPrometh-Review/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FPrometh-Review/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaborvecsei%2FPrometh-Review/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaborvecsei","download_url":"https://codeload.github.com/gaborvecsei/Prometh-Review/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245044099,"owners_count":20551877,"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":["automation","gpt","large-language-models","pull-requests"],"created_at":"2024-10-11T02:08:05.744Z","updated_at":"2025-03-23T01:32:15.743Z","avatar_url":"https://github.com/gaborvecsei.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prometh Review - AI Pull-Request Reviewer Companion\n\n_Unveil the extraordinary power of Prometh-Review, an AI-driven companion that kindles the flames\nof pull request enlightenment, empowering developers to ascend to new heights of collaborative mastery._\n\nWith `Prometh Review` you can get instant feedback on any pull-request:\n\n- bugs\n- security issues\n- missed best practices\n- general feedback\n\nYou can also start an interactive session and talk with the AI about the changes in the pull request\n\n\u003e _Warning_: Proof of concept tool and right now only works with Bitbucket/Stash\n\n# Setup\n\n## Install\n\n```\n$ pip install git+https://github.com/gaborvecsei/Prometh-Review.git\n```\n\nOr `Docker` can be used (but you'll have to mount the repo so the `git diff` can be accessed inside the container)\n\n```shell\ndocker built -t prometh .\n```\n\n## LLM type\n\n### OpenAI\n\nYou only need the OpenAI API key (see the setup of environment variables)\n\n### Self hosted LLM\n\nI am using the `LocalAI` solutions: https://localai.io/\n\n- Find the model you'd like to serve - https://localai.io/basics/getting_started/index.html\n- Start the docker container\n- Test if it's running (e.g.: `curl http://\u003cIP\u003e:\u003cPORT\u003e/v1/models`)\n- Retrieve the model name that you're hosting (e.g.: `mistral-openorca`)\n  - You can get this from the `curl` request above\n\n## Environment variables\n\nYou'll need some environment variables depending on how you'd like to run the tool\n\n### Stash/Bitbucket\n\nRequired if you have the repo on Stash/Bitbucket\n\n```\nexport STASH_HTTP_ACCESS_TOKEN=\u003cYOUR_TOKEN\u003e\n```\n\n### OpenAI\n\nRequired to use the OpenAI GPT LLM family\n\n```\nexport OPENAI_API_KEY=\u003cYOUR_TOKEN\u003e\n```\n\n### GitHub\n\nTODO\n\n### GitLab\n\nTODO\n\n# Usage\n\n## Setup\n\n- Go to the folder of the repository where you'll run `prometh`\n  - (_Why?_ It works from the local `git diff`, I really don't want to parse Github/Bitbucket API diff responses...)\n- Update refs (if required)\n- Retrieve the necessary parameters (check these by running `prometh -h`)\n  - Project Name (e.g.: AI)\n  - Repo slug (simplified name of the repository) (e.g.: churn-prediction)\n  - Pull request ID (e.g.: 85)\n- Run the tool: `prometh -h`\n  - OpenAI LLM: `prometh -p ai -r churn-prediction -id 85 --base-url stash.mycompany.com --llm-type gpt-4`\n  - Local LLM: `prometh -p ai -r churn-prediction -id 85 --base-url stash.mycompany.com --llm-type mistral-openorca --llm-url http://localhost:8080\"`\n\nAlso, docker can be used, just don't forget to mount the repo as a volume\n\n```\n$ docker run -it -e OPENAI_API_KEY=\"TODO\" [other required env vars] -v \u003cPROJECT_DIR\u003e:/src prometh prometh -h\n```\n\n## Defaults\n\nYou can set default values for some of the not commonly used parameters (e.g.: base-url) with the `.promethrc.json` file.\nThis is where you can set your custom prompt.\n\nThe localtion of the file should be in your home `~/.promethrc.json`.\n\nSee the example included in the repo (`.promethrc.json.example`).\n\n```shell\ncp .promethrc.json.example ~/.promethrc.json\n# Edit the file\nvim ~/.promethrc.json\n```\n\n# FAQ\n\n**What to do if the script fails with some token count error?**\n\nThis means that you have a big diff 😏 and the GPT model cannot handle it because of the context limitation.\n\nWhat to do? First let's try to reduce the `--nb-context-lines`, but if this is not enough, then I would go file by file\nwhat can be done with the file filter `-x`.\n\n**How much does this cost with OpenAI 💰?**\n\nYou can do a calculation here [https://gpt-calculator.gaborvecsei.com/](https://gpt-calculator.gaborvecsei.com/)\n\nA single PR-Review (without the interactive session) (with the `gpt-3.5-turbo-16k`) should not cost more than _$0.05_.\n\n# Todo\n\nSome ideas what needs to be done in order to have a tool which is fun to use\n\n- [ ] Support GitHub\n- [ ] Support Manual mode\n- [ ] Error handling (as right now there is `None`)\n- [ ] Make the output more pretty with `rich`\n- [ ] More consistent output format from GPT\n- [ ] More control on what to check in the PRs\n  - [ ] Check single files only\n  - [ ] Include, exclude file trypes (e.g.: Jupyter-Notebooks)\n- [ ] When the diff too big, do some smart truncation, or file-by-file analyzis\n- [ ] Check token count before sending the request to OpenAI\n- [ ] Allow other LLMs other than OpenAI GPT family (e.g.: locally deployed models)\n\n---\n\nMade with ❤️❤️❤️\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaborvecsei%2Fprometh-review","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaborvecsei%2Fprometh-review","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaborvecsei%2Fprometh-review/lists"}