{"id":28411264,"url":"https://github.com/elementsinteractive/lgtm-ai","last_synced_at":"2026-01-21T12:10:17.756Z","repository":{"id":295617964,"uuid":"988359935","full_name":"elementsinteractive/lgtm-ai","owner":"elementsinteractive","description":"Your AI-powered code review companion","archived":false,"fork":false,"pushed_at":"2026-01-15T11:30:56.000Z","size":8308,"stargazers_count":23,"open_issues_count":10,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-15T15:49:31.011Z","etag":null,"topics":["ai","code-reviews","dev-tools","github","gitlab","llms"],"latest_commit_sha":null,"homepage":"https://www.elements.nl/en","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/elementsinteractive.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-22T12:38:20.000Z","updated_at":"2026-01-15T11:30:28.000Z","dependencies_parsed_at":"2025-06-10T09:21:53.796Z","dependency_job_id":"aaa0b2eb-e547-4a65-b5b3-88f9ddf2f924","html_url":"https://github.com/elementsinteractive/lgtm-ai","commit_stats":null,"previous_names":["elementsinteractive/lgtm-ai"],"tags_count":40,"template":false,"template_full_name":null,"purl":"pkg:github/elementsinteractive/lgtm-ai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elementsinteractive%2Flgtm-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elementsinteractive%2Flgtm-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elementsinteractive%2Flgtm-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elementsinteractive%2Flgtm-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elementsinteractive","download_url":"https://codeload.github.com/elementsinteractive/lgtm-ai/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elementsinteractive%2Flgtm-ai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28632782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ai","code-reviews","dev-tools","github","gitlab","llms"],"created_at":"2025-06-02T15:00:30.065Z","updated_at":"2026-01-21T12:10:17.739Z","avatar_url":"https://github.com/elementsinteractive.png","language":"Python","readme":"\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"lgtm-logo\" width=\"150\" src=\"https://raw.githubusercontent.com/elementsinteractive/lgtm-ai/main/assets/lgtm-large.png\"\u003e\n\u003c/p\u003e\n\n# lgtm-ai\n\n![Python Version](https://img.shields.io/badge/python-3.12%20|%203.13-blue?logo=python\u0026logoColor=yellow)\n![Build Status](https://github.com/elementsinteractive/lgtm-ai/actions/workflows/test.yml/badge.svg)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n[![PyPI version](https://img.shields.io/pypi/v/lgtm-ai?logo=python\u0026logoColor=f5f5f5)](https://pypi.org/project/lgtm-ai/)\n[![Docker version](https://img.shields.io/docker/v/elementsinteractive/lgtm-ai?label=DockerHub\u0026logo=docker\u0026logoColor=f5f5f5)](https://hub.docker.com/r/elementsinteractive/lgtm-ai)\n[![LGTM AI Code Review Action](https://img.shields.io/badge/GitHub%20Action-LGTM%20AI%20Code%20Review-blue?logo=github\u0026logoColor=white)](https://github.com/marketplace/actions/lgtm-ai-code-review)\n[![License](https://img.shields.io/github/license/elementsinteractive/lgtm-ai)](LICENSE)\n\n---\n\nlgtm-ai is your AI-powered code review companion. It generates code reviews using your favorite LLMs and helps human reviewers with detailed, context-aware reviewer guides. Supports GitHub, GitLab, and major AI models including GPT-4, Claude, Gemini, and more.\n\n**Table of Contents**\n- [Quick Usage](#quick-usage)\n  - [Review](#review)\n    - [Local Changes](#local-changes)\n  - [Reviewer Guide](#reviewer-guide)\n- [Installation](#installation)\n- [How it works](#how-it-works)\n  - [Review scores and comment categories](#review-scores-and-comment-categories)\n  - [Supported Code Repository Services](#supported-code-repository-services)\n  - [Using Issue/User Story Information](#using-issueuser-story-information)\n  - [Supported AI models](#supported-ai-models)\n    - [Summary](#summary)\n    - [OpenAI](#openai)\n    - [Google Gemini](#google-gemini)\n    - [Anthropic's Claude](#anthropics-claude)\n    - [Mistral AI](#mistral-ai)\n    - [DeepSeek](#deepseek)\n    - [Local models](#local-models)\n  - [CI/CD Integration](#cicd-integration)\n  - [Configuration](#configuration)\n    - [Main options](#main-options)\n    - [Review options](#review-options)\n    - [Issues Integration options](#issues-integration-options)\n    - [Example `lgtm.toml`](#example-lgtmtoml)\n- [Contributing](#contributing)\n  - [Running the project](#running-the-project)\n  - [Managing requirements](#managing-requirements)\n  - [Commit messages](#commit-messages)\n- [Contributors ✨](#contributors-)\n\n\n## Quick Usage\n\n### Review\n\n```sh\n lgtm review --ai-api-key $OPENAI_API_KEY \\\n             --git-api-key $GITLAB_TOKEN \\\n             --model gpt-5 \\\n             --publish \\\n             \"https://gitlab.com/your-repo/-/merge-requests/42\"\n```\n\n\nThis will generate a **review** like this one:\n\n\u003cimg src=\"https://raw.githubusercontent.com/elementsinteractive/lgtm-ai/main/assets/review.png\" alt=\"lgtm-review\" height=\"250\"/\u003e\n\u003cbr/\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/elementsinteractive/lgtm-ai/main/assets/review-comment.png\" alt=\"lgtm-review-comment\" height=\"250\"/\u003e\n\n\n#### Local Changes\n\nYou can also review local changes without a pull request:\n\n```sh\nlgtm review --ai-api-key $OPENAI_API_KEY \\\n            --model gpt-5 \\\n            --compare main \\\n            path/to/git/repo\n```\n\n### Reviewer Guide\n\n```sh\n lgtm guide  --ai-api-key $OPENAI_API_KEY \\\n             --git-api-key $GITLAB_TOKEN \\\n             --model gpt-5 \\\n             --publish \\\n             \"https://gitlab.com/your-repo/-/merge-requests/42\"\n```\n\n\nThis will generate a **reviewer guide** like this one:\n\n\u003cimg src=\"https://raw.githubusercontent.com/elementsinteractive/lgtm-ai/main/assets/reviewer-guide.png\" alt=\"lgtm-review-guide\" height=\"250\"/\u003e\n\n## Installation\n\n```sh\npip install lgtm-ai\n```\n\nOr you can use the official Docker image:\n\n```sh\ndocker pull elementsinteractive/lgtm-ai\n```\n\n## How it works\n\nlgtm reads the given pull request and feeds it to several AI agents to generate a code review or a reviewer guide. The philosophy of lgtm is to keep the models out of the picture and totally configurable, so that you can choose which model to use based on pricing, security, data privacy, or whatever is important to you.\n\nIf instructed (with the option `--publish`), lgtm will publish the review or guide to the pull request page as comments.\n\n### Review scores and comment categories\n\nReviews generated by lgtm will be assigned a **score**, using the following scale:\n\n| Score |  Description |\n| ------ | --- |\n| LGTM  👍 |  The PR is generally ready to be merged. |\n| Nitpicks  🤓 |  There are some minor issues, but the PR is almost ready to be merged. |\n| Needs Work  🔧 |  There are some issues with the PR, and it is not ready to be merged. The approach is generally good, the fundamental structure is there, but there are some issues that need to be fixed. |\n| Needs a Lot of Work 🚨 |  Issues are major, overarching, and/or numerous. However, the approach taken is not necessarily wrong. |\n| Abandon ❌  |  The approach taken is wrong, and the author needs to start from scratch. The PR is not ready to be merged as is at all. |\n\nFor each review, lgtm may create several inline comments, pointing out specific issues within the PR. These comments belong to a **category** and have a **severity**. You can configure which categories you want lgtm to take a look at (see the [configuration section below](#configuration)). The available categories are:\n\n| Category | Description |\n| -------  | ----------- | \n| Correctness 🎯 | Does the code behave as intended? Identifies logical errors, bugs, incorrect algorithms, broken functionality, or deviations from requirements. |\n| Quality ✨ | Is the code clean, readable, and maintainable? Evaluates naming, structure, modularity, and adherence to clean code principles (e.g., SOLID, DRY, KISS). |\n| Testing 🧪 | Are there sufficient and appropriate tests? Includes checking for meaningful test coverage, especially for edge cases and critical paths. Are tests isolated, reliable, and aligned with the behavior being verified? |\n| Security 🔒 | Does the code follow secure programming practices? Looks for common vulnerabilities such as injection attacks, insecure data handling, improper access control, hardcoded credentials, or lack of input validation. |\n\nThere are three available severities for comments:\n\n- LOW 🔵\n- MEDIUM 🟡\n- HIGH 🔴\n\n### Supported Code Repository Services\n\nlgtm aims to work with as many services as possible, and that includes remote repository providers. At the moment, lgtm supports:\n\n- [GitLab](https://gitlab.com) (both gitlab.com and [self-managed](https://about.gitlab.com/install/)).\n- [GitHub](https://github.com)\n\nlgtm will autodetect the url of the pull request passed as an argument.\n\n\n### Using Issue/User Story Information\n\nlgtm-ai can enhance code reviews by including context from linked issues or user stories (e.g., GitHub/GitLab issues). This helps the AI understand the purpose and requirements of the PR.\n\n**How to use:**\n\n- Provide the following options to the `lgtm review` command:\n  - `--issues-url`: The base URL of the issues or user story page.\n  - `--issues-platform`: The platform for the issues (e.g., `github`, `gitlab`, `jira`).\n  - `--issues-regex`: (Optional) A regex pattern to extract the issue ID from the PR title or description.\n  - `--issues-api-key`: (Optional) API key for the issues platform (if different from `--git-api-key`).\n  - `--issues-user`: (Optional) Username for the issues platform (required if source is `jira`).\n\n**Example:**\n```sh\nlgtm review \\\n  --issues-url \"https://github.com/your-org/your-repo/issues\" \\\n  --issues-platform github \\\n  --issues-regex \"(?:Fixes|Resolves) #(\\d+)\" \\\n  --issues-api-key $GITHUB_TOKEN \\\n  ...\n  \"https://github.com/your-org/your-repo/pull/42\"\n```\n\n- These options can also be set in the `lgtm.toml` configuration file, see more in the [configuration section](#configuration).\n- lgtm will automatically extract the issue ID from the PR metadata using the provided regex, fetch the issue content, and include it as additional context for the review.\n\n**Notes:**\n\n- GitHub, GitLab, and [JIRA cloud](https://developer.atlassian.com/cloud/jira/platform/) issues are supported.\n- If `--issues-api-key` is not provided, lgtm will use `--git-api-key` for authentication.\n- If no issue is found, the review will proceed without issue context.\n- lgtm provides a default regex for extracting issue IDs that works with [conventional commits](https://www.conventionalcommits.org). This means you often do not need to specify `--issues-regex` if your PR titles or commit messages follow the conventional commit format (e.g., `feat(#123): add new feature`), or if your PR descriptions contain mentions to issues like: `refs: #123` or `closes: #123`.\n\n### Supported AI models\n\nlgtm supports several AI models so you can hook up your preferred LLM to perform reviews for you.\n\nThis is the full list of supported models:\n\n#### Summary\n\n| Provider    | Example Models                  | API Key Setup                                                                 |\n|-------------|---------------------------------|-------------------------------------------------------------------------------|\n| **OpenAI**  | `gpt-5`, `gpt-4.1`, `gpt-4o-mini`, `o1-preview` | [Generate API key](https://platform.openai.com/api-keys) |\n| **Google Gemini** | `gemini-2.5-pro`, `gemini-2.5-flash` | [Get API key](https://aistudio.google.com/apikey) |\n| **Anthropic (Claude)** | `claude-opus-4-5`, `claude-sonnet-4-5`, `claude-haiku-4-5` | [Anthropic Console](https://console.anthropic.com/dashboard) |\n| **Mistral** | `mistral-large-latest`, `mistral-small`, `codestral-latest` | [Mistral Platform](https://console.mistral.ai/api-keys) |\n| **DeepSeek** | `deepseek-chat`, `deepseek-reasoner` | [DeepSeek Platform](https://platform.deepseek.com/usage) |\n| **Local / Custom** | Any OpenAI-compatible model (e.g. `llama3`) | Run with `--model-url http://localhost:11434/v1` |\n\n\n#### OpenAI\n\nCheck out the OpenAI platform page to see [all available models provided by OpenAI](https://platform.openai.com/docs/overview).\n\nTo use OpenAI LLMs, you need to provide lgtm with an API Key, which can be generated in the [OpenAI platform page for your project, or your user](https://platform.openai.com/api-keys).\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSupported OpenAI models\u003c/summary\u003e\n\nThese are the main supported models, though the CLI may support additional ones due to the use of [pydantic-ai](https://ai.pydantic.dev).\n\n| Model name |\n| -------- |\n| gpt-5 |\n| gpt-5-mini |\n| gpt-4.1 |\n| gpt-4.1-mini |\n| gpt-4.1-nano |\n| gpt-4o * |\n| gpt-4o-mini |\n| o4-mini |\n| o3-mini |\n| o3 |\n| o1-preview |\n| o1-mini |\n| o1 |\n| gpt-4-turbo |\n| gpt-4 |\n| gpt-3.5-turbo |\n| chatgpt-4o-latest |\n\n\u003c/details\u003e\n\n#### Google Gemini\n\nCheck out the [Gemini developer docs](https://ai.google.dev/gemini-api/docs/models) to see all models provided by Google.\n\nTo use Gemini LLMs, you need to provide lgtm an API Key, which can be generated [here](https://aistudio.google.com/apikey). \n\nThese are the main supported models, though the CLI may support additional ones due to the use of [pydantic-ai](https://ai.pydantic.dev). Gemini timestamps models, so be sure to always use the latest model of each family, if possible.\n\n\nFor Gemini models exclusively, you can provide a wildcard at the end of the model name and lgtm will attempt to select the latest model (e.g., `gemini-2.5-pro*`)\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSupported Google's Gemini models\u003c/summary\u003e\n\n\n| Model name |\n| ----------- |\n| gemini-2.5-pro |\n| gemini-2.5-pro-preview-06-05 |\n| gemini-2.5-pro-preview-05-06 |\n| gemini-2.5-flash |\n| gemini-2.0-pro-exp-02-05 |\n| gemini-1.5-pro |\n| gemini-1.5-flash |\n\n\u003c/details\u003e\n\n#### Anthropic's Claude\n\nCheck out [Anthropic documentation](https://docs.anthropic.com/en/docs/about-claude/models/all-models) to see which models they provide. lgtm works with a subset of Claude models. To use Anthropic LLMs, you need to provide lgtm with an API Key, which can be generated from the [Anthropic Console](https://console.anthropic.com/dashboard).\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSupported Anthropic models\u003c/summary\u003e\n\nThese are the main supported models, though the CLI may support additional ones due to the use of [pydantic-ai](https://ai.pydantic.dev).\n\n| Model name |\n| ---------------------------- |\n| claude-opus-4-5 |\n| claude-sonnet-4-5 |\n| claude-haiku-4-5 |\n| claude-opus-4-1-20250805 |\n| claude-sonnet-4-0 |\n| claude-3-7-sonnet-latest |\n| claude-3-5-sonnet-latest |\n| claude-3-5-haiku-latest |\n| claude-3-opus-latest |\n\n\u003c/details\u003e\n\n#### Mistral AI\n\nCheck out the [Mistral documentation](https://docs.mistral.ai/getting-started/models/models_overview/) to see all models provided by Mistral.\n\nTo use Mistral LLMs, you need to provide lgtm with an API Key, which can be generated from Mistral's [Le Platforme](https://console.mistral.ai/api-keys).\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSupported Mistral AI models\u003c/summary\u003e\n\nThese are the main supported models, though the CLI may support additional ones due to the use of [pydantic-ai](https://ai.pydantic.dev).\n\n| Model name |\n| ------------------ |\n| mistral-large-latest |\n| mistral-small |\n| codestral-latest |\n\n\u003c/details\u003e\n\n#### DeepSeek\n\nCheck out the [DeepSeek documentation](https://api-docs.deepseek.com/quick_start/pricing) to see all models provided by DeepSeek.\n\nAt the moment, lgtm only supports DeepSeek from `https://api.deepseek.com`: other providers and custom URLs are not supported. However, this is in our roadmap!\n\nTo get an API key for DeepSeek, create one at [DeepSeek Platform](https://platform.deepseek.com/usage).\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSupported DeepSeek models\u003c/summary\u003e\n\n| Model name |\n| ----------- |\n| deepseek-chat |\n| deepseek-reasoner |\n\n\u003c/details\u003e\n\n#### Local models\n\nYou can run lgtm against a model available at a custom url (say, models running with [ollama](https://ollama.com) at http://localhost:11434/v1). These models need to be compatible with OpenAI. In that case, you need to pass the option `--model-url` (and you can choose to skip the option `--ai-api-token`). Check out the [pydantic-ai documentation](https://ai.pydantic.dev/models/openai/#openai-responses-api) to see more information about how lgtm interacts with these models.\n\n```sh\nlgtm review \\\n  --model llama3.2 \\\n  --model-url http://localhost:11434/v1 \\\n  ...\n  https://github.com/group/repo/pull/1\n```\n\n### CI/CD Integration\n\nlgtm is meant to be integrated into your CI/CD pipeline, so that PR authors can choose to request reviews by running the necessary pipeline step.\n\nFor GitLab, you can use this .gitlab-ci.yml step as inspiration:\n\n```yaml\nlgtm-review:\n  image:\n    name: docker.io/elementsinteractive/lgtm-ai\n    entrypoint: [\"\"]\n  stage: ai-review\n  needs: []\n  rules:\n   - if: $CI_MERGE_REQUEST_ID\n  when: manual\n  script:\n    - lgtm review --git-api-key ${LGTM_GIT_API_KEY} --ai-api-key ${LGTM_AI_API_KEY} -v ${MR_URL}\n  variables:\n    MR_URL: \"${CI_PROJECT_URL}/-/merge_requests/${CI_MERGE_REQUEST_IID}\"\n```\n\nFor GitHub, you can use the official [LGTM AI GitHub Action](https://github.com/marketplace/actions/lgtm-ai-code-review):\n\n```yaml\n- name: AI Code Review\n  uses: elementsinteractive/lgtm-ai-action@v1.0.0\n  with:\n    ai-api-key: ${{ secrets.AI_API_KEY }}\n    git-api-key: ${{ secrets.GITHUB_TOKEN }}\n    model: 'gpt-5'\n    pr-number: ${{ github.event.issue.number }}\n```\n\nYou can also check out this repo's [lgtm workflow](./.github/workflows/lgtm.yml) for a complete example with comment triggers (`/lgtm review`).\n\n### Configuration\n\nYou can customize how lgtm works by passing cli arguments to it on invocation, or by using the *lgtm configuration file*. \n\nYou can configure lgtm through cli arguments, through environment variables, and through a configuration file. lgtm uses a `.toml` file to configure how it works. It will autodetect a `lgtm.toml` file in the current directory, or you can pass a specific file path with the CLI option `--config \u003cpath\u003e`.\n\nAlternatively, lgtm also supports [pyproject.toml](https://packaging.python.org/en/latest/guides/writing--toml/) files, you just need to nest the options inside `[tool.lgtm]`.\n\nWhen it comes to preference for selecting options, lgtm follows this preference order:\n\n  `CLI options` \u003e `lgtm.toml` \u003e `pyproject.toml`\n\n\n\u003cdetails\u003e\n\n\u003csummary\u003eSummary of options\u003c/summary\u003e\n\n| Option               | Feature Group         | Optionality         | Notes/Conditions                                                                |\n|----------------------|----------------------|---------------------|---------------------------------------------------------------------------------|\n| model                | Main (review + guide)  | 🟢 Optional                   | AI model to use. Defaults to `gemini-2.5-flash` if not set.                              |\n| model_url            | Main (review + guide)  | 🟡 Conditionally required     | Only needed for custom/local models.                                             |\n| exclude              | Main (review + guide)  | 🟢 Optional                   | File patterns to exclude from review.                                            |\n| publish              | Main (review + guide)  | 🟢 Optional                   | If true, posts review as comments. Default: false.                               |\n| output_format        | Main (review + guide)  | 🟢 Optional                   | `pretty` (default), `json`, or `markdown`.                                      |\n| silent               | Main (review + guide)  | 🟢 Optional                   | Suppress terminal output. Default: false.                                        |\n| ai_retries           | Main (review + guide)  | 🟢 Optional                   | Number of retries for AI agent queries. Default: 1.                              |\n| ai_input_tokens_limit| Main (review + guide)  | 🟢 Optional                   | Max input tokens for LLM. Default: 500,000. Use `\"no-limit\"` to disable.        |\n| git_api_key          | Main (review + guide)  | 🟡 Conditionally required     | API key for git service (GitHub/GitLab). Can't be given through config file. Also available through env variable `LGTM_GIT_API_KEY`. Required if reviewing a PR URL from a remote repository service (GitHub, GitLab, etc.).     |\n| ai_api_key           | Main (review + guide)  | 🔴 Required*                  | API key for AI model. Can't be given through config file. Also available through env variable `LGTM_AI_API_KEY`.                        |\n| technologies         | Review Only          | 🟢 Optional                   | List of technologies for reviewer expertise.                                     |\n| categories           | Review Only          | 🟢 Optional                   | Review categories. Defaults to all (`Quality`, `Correctness`, `Testing`, `Security`). |\n| additional_context   | Review Only          | 🟢 Optional                   | Extra context for the LLM (array of prompts/paths/URLs). Can't be given through the CLI |\n| compare              | Review Only          | 🟢 Optional                   | If reviewing local changes, what to compare against (branch, commit, range, etc.). CLI only. |\n| issues_url           | Issues Integration   | 🟢 Optional                   | Enables issue context. If set, `issues_platform` becomes required.                 |\n| issues_platform        | Issues Integration   | 🟡 Conditionally required     | Required if `issues_url` is set.                                                 |\n| issues_regex         | Issues Integration   | 🟢 Optional                   | Regex for issue ID extraction. Defaults to conventional commit compatible regex. |\n| issues_api_key       | Issues Integration   | 🟢 Optional                   | API key for issues platform (if different from `git_api_key`). Can't be given through config file. Also available through env variable `LGTM_ISSUES_API_KEY`.                         |\n| issues_user       | Issues Integration   | 🟡 Conditionally required    | Username for accessing issues information. Only required for `issues_platform=jira` |\n\n\u003c/details\u003e\n\n#### Main options\n\nThese options apply to both reviews and guides generated by lgtm.\n\n- **model**: Choose which AI model you want lgtm to use. If not set, defaults to `gemini-2.5-flash`.\n- **model_url**: When not using one of the specific supported models from the providers mentioned above, you can pass a custom URL where the model is deployed (e.g., for local/hosted models).\n- **exclude**: Instruct lgtm to ignore certain files. This is important to reduce noise in reviews, but also to reduce the amount of tokens used for each review (and to avoid running into token limits). You can specify file patterns (e.g., `exclude = [\"*.md\", \"package-lock.json\"]`).\n- **publish**: If `true`, lgtm will post the review as comments on the PR page. Default is `false`.\n- **output_format**: Format of the terminal output of lgtm. Can be `pretty` (default), `json`, or `markdown`.\n- **silent**: Do not print the review in the terminal. Default is `false`.\n- **ai_retries**: How many times to retry calls to the LLM when they do not succeed. By default, this is set to 1 (no retries at all).\n- **ai_input_tokens_limit**: Set a limit on the input tokens sent to the LLM in total. Default is 500,000. To disable the limit, you can pass the string `\"no-limit\"`.\n- **git_api_key**: API key to post the review in the source system of the PR. Can be given as a CLI argument, or as an environment variable (`LGTM_GIT_API_KEY`). You can omit this option if reviewing local changes.\n- **ai_api_key**: API key to call the selected AI model. Can be given as a CLI argument, or as an environment variable (`LGTM_AI_API_KEY`).\n\n#### Review options\n\nThese options are only used when performing reviews through the command `lgtm review`.\n\n- **technologies**: Specify, as a list of free strings, which technologies lgtm specializes in. This can help direct the reviewer towards specific technologies. By default, lgtm won't assume any technology and will just review the PR considering itself an \"expert\" in it.\n- **categories**: lgtm will, by default, evaluate several areas of the given PR (`Quality`, `Correctness`, `Testing`, and `Security`). You can choose any subset of these (e.g., if you are only interested in `Correctness`, you can configure `categories` so that lgtm does not evaluate the other missing areas).\n- **additional_context**: TOML array of extra context to send to the LLM. It supports setting the context directly in the `context` field, passing a relative file path so that lgtm downloads it from the repository, or passing any URL from which to download the context. Each element of the array must contain `prompt`, and either `context` (directly injecting context) or `file_url` (for directing lgtm to download it from there).\n- **compare**: When reviewing local changes (the positional argument to `lgtm` is a valid `git` path), you can choose what to compare against to generate a git diff. You can pass branch names, commits, etc. Default is `HEAD`. Only available as a CLI option.\n\n#### Issues Integration options\n\nSee [Using Issue/User Story Information section](#using-issueuser-story-information).\n\n- **issues_url**: The base URL of the issues or user story page to fetch additional context for the PR. If set, `issues_platform` becomes required.\n- **issues_platform**: The platform for the issues (e.g., `github`, `gitlab`, `jira`). Required if `issues_url` is set.\n- **issues_regex**: A regex pattern to extract the issue ID from the PR title or description. If omitted, lgtm uses a default regex compatible with conventional commits and common PR formats.\n- **issues_api_key**: API key for the issues platform (if different from `git_api_key`). Can be given as a CLI argument, or as an environment variable (`LGTM_ISSUES_API_KEY`).\n- **issues_user**: Username for accessing the issues platform (only necessary for `jira`). Can be given as a CLI argument, or as an environment variable (`LGTM_ISSUES_USER`).\n\n#### Example `lgtm.toml`\n\n```toml\ntechnologies = [\"Django\", \"Python\"]\ncategories = [\"Correctness\", \"Quality\", \"Testing\", \"Security\"]\nexclude = [\"*.md\"]\nmodel = \"gpt-4.1\"\nsilent = false\npublish = true\nai_retries = 1\nai_input_tokens_limit = 30000\n\n[[additional_context]]\nprompt = \"These are the development guidelines for the team, ensure the PR follows them\"\nfile_url = \"https://my.domain.com/dev-guidelines.md\"\n\n[[additional_context]]\nprompt = \"CI pipeline for the repo. Do not report issues that this pipeline would otherwise catch\"\nfile_url = \".github/workflows/pr.yml\"\n\n[[additional_context]]\nprompt = \"Consider these points when making your review\"\ncontext = '''\n- We avoid using libraries and rely mostly on the stdlib.\n- We follow the newest syntax available for Python (3.13).\n'''\n\n# Optional Issue/user story integration\nissues_url = \"https://github.com/your-org/your-repo/issues\"\nissues_platform = \"github\"\n# The options below are optional even if the two above are provided\nissues_regex = \"(?:Fixes|Resolves) #(\\d+)\"\nissues_api_key = \"${GITHUB_TOKEN}\"\n```\n\n## Contributing\n\n### Running the project\n\nThis project uses [`just`](https://github.com/casey/just) recipes to do all the basic operations (testing the package, formatting the code, etc.).\n\nInstallation:\n\n```sh\nbrew install just\n# or\nsnap install --edge --classic just\n```\n\nIt requires [poetry](https://python-poetry.org/docs/#installation).\n\nThese are the available commands for the justfile:\n\n```\nAvailable recipes:\n    help                        # Shows list of recipes.\n    venv                        # Generate the virtual environment.\n    clean                       # Cleans all artifacts generated while running this project, including the virtualenv.\n    test *test-args=''          # Runs the tests with the specified arguments (any path or pytest argument).\n    t *test-args=''             # alias for `test`\n    test-all                    # Runs all tests including coverage report.\n    format                      # Format all code in the project.\n    lint                        # Lint all code in the project.\n    pre-commit *precommit-args  # Runs pre-commit with the given arguments (defaults to install).\n    spellcheck *codespell-args  # Spellchecks your markdown files.\n    lint-commit                 # Lints commit messages according to conventional commit rules.\n```\n\nTo run the tests of this package, simply run:\n\n```sh\n# All tests\njust t\n\n# A single test\njust t tests/test_dummy.py\n\n# Pass arguments to pytest like this\njust t -k test_dummy -vv\n```\n\n### Managing requirements\n\n`poetry` is the tool we use for managing requirements in this project. The generated virtual environment is kept within the directory of the project (in a directory named `.venv`), thanks to the option `POETRY_VIRTUALENVS_IN_PROJECT=1`. Refer to the [poetry documentation](https://python-poetry.org/docs/cli/) to see the list of available commands.\n\nAs a short summary:\n\n- Add a dependency:\n\n        poetry add foo-bar\n\n- Remove a dependency:\n\n        poetry remove foo-bar\n\n- Update a dependency (within constraints set in `pyproject.toml`):\n\n        poetry update foo-bar\n\n- Update the lockfile with the contents of `pyproject.toml` (for instance, when getting a conflict after a rebase):\n\n        poetry lock\n\n- Check if `pyproject.toml` is in sync with `poetry.lock`:\n\n        poetry lock --check\n\n### Commit messages\n\nIn this project we enforce [conventional commits](https://www.conventionalcommits.org) guidelines for commit messages. The usage of [commitizen](https://commitizen-tools.github.io/commitizen/) is recommended, but not required. Story numbers (JIRA, etc.) must go in the scope section of the commit message. Example message:\n\n```\nfeat(#\u003cissue-number\u003e): add new feature x\n```\n\nMerge requests must be approved before they can be merged to the `main` branch, and all the steps in the `ci` pipeline must pass.\n\nThis project includes an optional pre-commit configuration. Note that all necessary checks are always executed in the ci pipeline, but\nconfiguring pre-commit to execute some of them can be beneficial to reduce late errors. To do so, simply execute the following just recipe:\n\n```sh\njust pre-commit\n```\n\nFeel free to create [GitHub Issues](https://github.com/elementsinteractive/lgtm-ai/issues) for any feature request, bug, or suggestion!\n\n## Contributors ✨\n\nThanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/scastlara\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7606872?v=4?s=50\" width=\"50px;\" alt=\"Sergio Castillo\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSergio Castillo\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/elementsinteractive/lgtm-ai/commits?author=scastlara\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#design-scastlara\" title=\"Design\"\u003e🎨\u003c/a\u003e \u003ca href=\"#ideas-scastlara\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#maintenance-scastlara\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/jbozanowski\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/114900?v=4?s=50\" width=\"50px;\" alt=\"Jakub Bożanowski\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eJakub Bożanowski\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/elementsinteractive/lgtm-ai/commits?author=jbozanowski\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-jbozanowski\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e \u003ca href=\"#maintenance-jbozanowski\" title=\"Maintenance\"\u003e🚧\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/sacha-c\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/3247529?v=4?s=50\" width=\"50px;\" alt=\"Sacha Brouté\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eSacha Brouté\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/elementsinteractive/lgtm-ai/commits?author=sacha-c\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"#ideas-sacha-c\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/sdn4z\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/13658011?v=4?s=50\" width=\"50px;\" alt=\"Daniel\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eDaniel\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"#ideas-sdn4z\" title=\"Ideas, Planning, \u0026 Feedback\"\u003e🤔\u003c/a\u003e\u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\" width=\"14.28%\"\u003e\u003ca href=\"https://github.com/Rooni\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/916242?v=4?s=50\" width=\"50px;\" alt=\"Rooni\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eRooni\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/elementsinteractive/lgtm-ai/commits?author=Rooni\" title=\"Code\"\u003e💻\u003c/a\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-restore --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!","funding_links":[],"categories":["Code Review \u0026 Collaboration"],"sub_categories":["Other IDEs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felementsinteractive%2Flgtm-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felementsinteractive%2Flgtm-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felementsinteractive%2Flgtm-ai/lists"}