CodeVet is an LLM powered git pull request review tool for Gitea and GitHub. Supports OpenAI and self-hosted open-source OpenAI compatible servers like llama-cpp-python.
This tool uses webhooks of Gitea/GitHub. Once webhook is triggered on 'Pull Request' event, this tool will fetch the git diff of the opened pull request and then send it to LLM for reviewing. Once LLM returns the review, this tool will push that review to Gitea/GitHub as a comment on the pull request. If there is any kind of failure, a generic error message would be posted to pull request as a comment indicating failure.
- Edit
config.ini
and changemodelAlias
to name of the model you are using. - Edit
config.ini
and changeuserToken
to base64 of textusername:password
of your Gitea account. AlsobaseUrl
forGITEA
to your gitea instance URL. (Alternative, for GitHub create a personal access token and paste it in config file underaccessToken
forGITHUB
)
Build the container:
docker build -t codevet .
Run the container: (change OPENAI_API_KEY as per your OpenAI API key)
docker run -d --name codevet -p 8001:8001 -v $PWD:/home -e UVICORN_HOST=0.0.0.0 -e OPENAI_API_KEY=sk-xxxx codevet
Once the containers are up, create a webhook in Gitea repo for http://<host-server>:8001/review
If you prefer using self-hosted models. You can use any OpenAI compatible server like llama-cpp-python.
Checkout my other repo llm-server, its a dockerized OpenAI compatible server based on llama-cpp-python
Once you have server deployed, modify config.ini
and change baseUrl
(under LLMSERVER
) value to the server link.
- So far it only works on
opened
event for PR. - Provided user prompt for LLM might not work for you, so you can change it according the model you are using.
- Can be inaccurate if git diff doesn't have enough changes.
- Supporting Gitlab
- Supporting other events like Push and PR updates.