Skip to content

Configuration Reference

This reference is generated from the pydantic schemas in src/lgtmaybe/core/models.py.

ReviewConfig

The user-facing configuration model. Fields map directly to .lgtmaybe.yml keys and CLI flags.

Field Type Required Default Description
api_base string / null No null Api Base
auto_describe boolean No False Auto Describe
auto_diagram boolean No False Auto Diagram
categories list[complexity / correctness / deprecation / documentation / intent / performance / ponytail / security / tests] No ['security', 'correctness', 'deprecation', 'tests', 'documentation', 'performance', 'complexity', 'intent', 'ponytail'] Categories
context_lines integer No 20 Context Lines
exclude_paths list[string] No [] Exclude Paths
extra_lenses list[CustomLens] No [] Extra Lenses
finding_rules list[FindingRule] No [] Finding Rules
function_context boolean No True Function Context
ignore_fingerprints list[string] No [] Ignore Fingerprints
include_paths list[string] No [] Include Paths
incremental boolean / null No null Incremental
max_concurrency integer / null No null Max Concurrency
max_files integer No 50 Max Files
max_input_tokens integer No 100000 Max Input Tokens
max_review_seconds integer No 600 Max Review Seconds
min_confidence integer No 0 Min Confidence
min_severity critical / high / info / low / medium No low
model string Yes Model
num_ctx integer / null No null Num Ctx
pr_labels boolean No False Pr Labels
preset fast / full No fast
prompt_cache boolean No True Prompt Cache
provider anthropic / azure / bedrock / ollama / openai / openai-compatible / openrouter / vertex / zai Yes
recursive boolean No True Recursive
reflect boolean No True Reflect
reflect_model string / null No null Reflect Model
resolve_fixed boolean No True Resolve Fixed
static_analysis StaticAnalysisConfig No {'enabled': False, 'tools': ['ruff', 'bandit', 'semgrep'], 'min_severity': 'info', 'tool_min_severity': {}, 'semgrep_rules': None}
structured_output boolean No True Structured Output
summary_template string / null No null Summary Template
symbol_resolution boolean No True Symbol Resolution
temperature number No 0.0 Temperature
timeout integer / null No null Timeout
triage_model string / null No null Triage Model
unanchored_min_severity critical / high / info / low / medium No high

Enums

Provider

LLM backend selected by --provider. Cloud providers (bedrock, vertex, azure) use ambient credentials — azure also needs the resource endpoint (--api-base) and accepts a key as an alternative. openai-compatible points at any server speaking the OpenAI /v1 wire format (DeepSeek, llama.cpp, LM Studio, vLLM) via --api-base; the key is optional so keyless local servers work.

  • anthropic
  • azure
  • bedrock
  • ollama
  • openai
  • openai-compatible
  • openrouter
  • vertex
  • zai

Severity

Finding severity, ordered low to high. Use min_severity in config to suppress findings below a threshold.

  • critical
  • high
  • info
  • low
  • medium

ReviewFinding

The structured output the model must return for each inline comment. All fields are validated by pydantic before anything is posted to GitHub.

Field Type Required Default Description
anchor string / null No null Anchor
anchored boolean No True Anchored
body string Yes Body
broad boolean No False Broad
category string / null No null Category
confidence integer / null No null Confidence
line integer Yes Line
path string Yes Path
severity critical / high / info / low / medium Yes
side string No RIGHT Side
suggestion string / null No null Suggestion
title string Yes Title

ProviderResult

The normalised return value of one LLM completion, including token usage.

Field Type Required Default Description
attempts integer No 1 Attempts
cache_creation_tokens integer No 0 Cache Creation Tokens
cache_read_tokens integer No 0 Cache Read Tokens
input_tokens integer Yes Input Tokens
output_tokens integer Yes Output Tokens
text string Yes Text

PRContext

Everything the engine needs about a pull request. Fetched via the GitHub REST API — PR code is never checked out.

Field Type Required Default Description
base_sha string Yes Base Sha
changed_files list[string] Yes Changed Files
commit_messages list[string] No [] Commit Messages
description string No `` Description
diff string Yes Diff
file_contents object No File Contents
head_sha string Yes Head Sha
pr_number integer Yes Pr Number
repo string Yes Repo
title string No `` Title

Raw JSON schemas

The canonical machine-readable schemas. These are the source of truth for provider output validation.

ReviewConfig

{
  "$defs": {
    "CustomLens": {
      "additionalProperties": false,
      "description": "A user-defined review lens \u2014 a \"skill file\" run alongside the built-ins.\n\nThe engine fans it out as its own focused LLM call (same pipeline as a\nbuilt-in ``ReviewCategory``) and merges its findings with the rest. A lens is\ndeclared in **trusted** config (``.lgtmaybe.yml`` or a file referenced by\n``lens_paths``), never from PR-author content, so its text is safe to put in\nthe system prompt. Supplying a worked example (``example_diff`` +\n``example_finding``) is optional but sharply improves a small model's output.",
      "properties": {
        "example_diff": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Example Diff"
        },
        "example_finding": {
          "anyOf": [
            {
              "$ref": "#/$defs/ReviewFinding"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "id": {
          "title": "Id",
          "type": "string"
        },
        "instructions": {
          "title": "Instructions",
          "type": "string"
        },
        "title": {
          "default": "",
          "title": "Title",
          "type": "string"
        }
      },
      "required": [
        "id",
        "instructions"
      ],
      "title": "CustomLens",
      "type": "object"
    },
    "FindingRule": {
      "additionalProperties": false,
      "description": "One declarative post-processing rule, applied in list order.\n\nThe safe alternative to arbitrary user hooks: rules can only filter or\nre-grade findings \u2014 no user code ever executes.",
      "properties": {
        "action": {
          "$ref": "#/$defs/FindingRuleAction"
        },
        "match": {
          "$ref": "#/$defs/FindingRuleMatch",
          "default": {
            "category": null,
            "min_severity": null,
            "path": null,
            "title_contains": null
          }
        }
      },
      "required": [
        "action"
      ],
      "title": "FindingRule",
      "type": "object"
    },
    "FindingRuleAction": {
      "additionalProperties": false,
      "description": "What a matched rule does: drop the finding, or remap its severity.",
      "properties": {
        "drop": {
          "default": false,
          "title": "Drop",
          "type": "boolean"
        },
        "set_severity": {
          "anyOf": [
            {
              "$ref": "#/$defs/Severity"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "title": "FindingRuleAction",
      "type": "object"
    },
    "FindingRuleMatch": {
      "additionalProperties": false,
      "description": "The selector of a finding rule. Every specified field must match (AND).\n\nAn empty match selects every finding. ``path`` is an fnmatch glob against\nthe repo-relative path (a ``**/`` prefix also matches at the repo root,\nlike the path filters); ``category`` is the originating lens id;\n``title_contains`` is a case-insensitive substring; ``min_severity``\nselects findings at or above that severity.",
      "properties": {
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        },
        "min_severity": {
          "anyOf": [
            {
              "$ref": "#/$defs/Severity"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        },
        "path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Path"
        },
        "title_contains": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Title Contains"
        }
      },
      "title": "FindingRuleMatch",
      "type": "object"
    },
    "Provider": {
      "description": "The backend selected by the `--provider` flag.",
      "enum": [
        "openai",
        "openrouter",
        "anthropic",
        "bedrock",
        "vertex",
        "azure",
        "ollama",
        "openai-compatible",
        "zai"
      ],
      "title": "Provider",
      "type": "string"
    },
    "ReviewCategory": {
      "description": "A single review lens. The engine asks for each one in its own LLM call.\n\n``intent`` checks the diff against the PR's stated intent (title, description,\ncommit messages); it only runs when the context carries some stated intent.\n``ponytail`` is the \"lazy senior dev\" lens \u2014 the best code is the code you\nnever wrote \u2014 flagging code that needn't exist at all (YAGNI, reach for the\nstandard library, do it in fewer lines).",
      "enum": [
        "security",
        "correctness",
        "deprecation",
        "tests",
        "documentation",
        "performance",
        "complexity",
        "intent",
        "ponytail"
      ],
      "title": "ReviewCategory",
      "type": "string"
    },
    "ReviewFinding": {
      "additionalProperties": false,
      "description": "A single inline review comment the model wants to post.",
      "properties": {
        "anchor": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Anchor"
        },
        "anchored": {
          "default": true,
          "title": "Anchored",
          "type": "boolean"
        },
        "body": {
          "title": "Body",
          "type": "string"
        },
        "broad": {
          "default": false,
          "title": "Broad",
          "type": "boolean"
        },
        "category": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Category"
        },
        "confidence": {
          "anyOf": [
            {
              "maximum": 10,
              "minimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Confidence"
        },
        "line": {
          "minimum": 1,
          "title": "Line",
          "type": "integer"
        },
        "path": {
          "title": "Path",
          "type": "string"
        },
        "severity": {
          "$ref": "#/$defs/Severity"
        },
        "side": {
          "default": "RIGHT",
          "enum": [
            "LEFT",
            "RIGHT"
          ],
          "title": "Side",
          "type": "string"
        },
        "suggestion": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Suggestion"
        },
        "title": {
          "title": "Title",
          "type": "string"
        }
      },
      "required": [
        "path",
        "line",
        "severity",
        "title",
        "body"
      ],
      "title": "ReviewFinding",
      "type": "object"
    },
    "ReviewPreset": {
      "description": "How many model calls a review spends: the everyday path or the deep audit.\n\n``fast`` (the default) covers seven built-in lenses in four calls when the\nprovider can overlap work: security, correctness flow/intent, correctness\nstate/lifecycle, and code health. With one worker, correctness stays\ncombined for three calls.\n``full`` restores tests and documentation and runs each of the nine lenses\nas its own call for release branches and deep audits. An explicit\n``categories`` list always wins over the preset.",
      "enum": [
        "fast",
        "full"
      ],
      "title": "ReviewPreset",
      "type": "string"
    },
    "Severity": {
      "description": "Finding severity, ordered low \u2192 high for `min_severity` filtering.",
      "enum": [
        "info",
        "low",
        "medium",
        "high",
        "critical"
      ],
      "title": "Severity",
      "type": "string"
    },
    "StaticAnalysisConfig": {
      "additionalProperties": false,
      "description": "Static-analysis fusion: deterministic tool findings as LLM grounding.\n\nWhen enabled, the installed tools run over the already-fetched changed-file\ntexts (sandboxed subprocess, scrubbed environment, no network, never a\ncheckout) and their findings enter each lens prompt as untrusted HINTS \u2014\n\"confirm, contextualise, or discard\" \u2014 raising recall on the deterministic\nbugs models miss without posting raw linter noise. A tool that isn't\ninstalled is skipped silently, so the feature degrades to nothing on a\nminimal install.",
      "properties": {
        "enabled": {
          "default": false,
          "title": "Enabled",
          "type": "boolean"
        },
        "min_severity": {
          "$ref": "#/$defs/Severity",
          "default": "info"
        },
        "semgrep_rules": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Semgrep Rules"
        },
        "tool_min_severity": {
          "additionalProperties": {
            "$ref": "#/$defs/Severity"
          },
          "propertyNames": {
            "$ref": "#/$defs/StaticAnalysisTool"
          },
          "title": "Tool Min Severity",
          "type": "object"
        },
        "tools": {
          "default": [
            "ruff",
            "bandit",
            "semgrep"
          ],
          "items": {
            "$ref": "#/$defs/StaticAnalysisTool"
          },
          "title": "Tools",
          "type": "array"
        }
      },
      "title": "StaticAnalysisConfig",
      "type": "object"
    },
    "StaticAnalysisTool": {
      "description": "A deterministic linter/SAST tool whose findings ground the LLM review.",
      "enum": [
        "ruff",
        "bandit",
        "semgrep"
      ],
      "title": "StaticAnalysisTool",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "description": "How to run one review: provider/model, severity floor, filters, caps.",
  "properties": {
    "api_base": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Api Base"
    },
    "auto_describe": {
      "default": false,
      "title": "Auto Describe",
      "type": "boolean"
    },
    "auto_diagram": {
      "default": false,
      "title": "Auto Diagram",
      "type": "boolean"
    },
    "categories": {
      "default": [
        "security",
        "correctness",
        "deprecation",
        "tests",
        "documentation",
        "performance",
        "complexity",
        "intent",
        "ponytail"
      ],
      "items": {
        "$ref": "#/$defs/ReviewCategory"
      },
      "title": "Categories",
      "type": "array"
    },
    "context_lines": {
      "default": 20,
      "title": "Context Lines",
      "type": "integer"
    },
    "exclude_paths": {
      "items": {
        "type": "string"
      },
      "title": "Exclude Paths",
      "type": "array"
    },
    "extra_lenses": {
      "items": {
        "$ref": "#/$defs/CustomLens"
      },
      "title": "Extra Lenses",
      "type": "array"
    },
    "finding_rules": {
      "items": {
        "$ref": "#/$defs/FindingRule"
      },
      "title": "Finding Rules",
      "type": "array"
    },
    "function_context": {
      "default": true,
      "title": "Function Context",
      "type": "boolean"
    },
    "ignore_fingerprints": {
      "items": {
        "type": "string"
      },
      "title": "Ignore Fingerprints",
      "type": "array"
    },
    "include_paths": {
      "items": {
        "type": "string"
      },
      "title": "Include Paths",
      "type": "array"
    },
    "incremental": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Incremental"
    },
    "max_concurrency": {
      "anyOf": [
        {
          "minimum": 1,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Max Concurrency"
    },
    "max_files": {
      "default": 50,
      "title": "Max Files",
      "type": "integer"
    },
    "max_input_tokens": {
      "default": 100000,
      "title": "Max Input Tokens",
      "type": "integer"
    },
    "max_review_seconds": {
      "default": 600,
      "minimum": 0,
      "title": "Max Review Seconds",
      "type": "integer"
    },
    "min_confidence": {
      "default": 0,
      "maximum": 10,
      "minimum": 0,
      "title": "Min Confidence",
      "type": "integer"
    },
    "min_severity": {
      "$ref": "#/$defs/Severity",
      "default": "low"
    },
    "model": {
      "title": "Model",
      "type": "string"
    },
    "num_ctx": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Num Ctx"
    },
    "pr_labels": {
      "default": false,
      "title": "Pr Labels",
      "type": "boolean"
    },
    "preset": {
      "$ref": "#/$defs/ReviewPreset",
      "default": "fast"
    },
    "prompt_cache": {
      "default": true,
      "title": "Prompt Cache",
      "type": "boolean"
    },
    "provider": {
      "$ref": "#/$defs/Provider"
    },
    "recursive": {
      "default": true,
      "title": "Recursive",
      "type": "boolean"
    },
    "reflect": {
      "default": true,
      "title": "Reflect",
      "type": "boolean"
    },
    "reflect_model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Reflect Model"
    },
    "resolve_fixed": {
      "default": true,
      "title": "Resolve Fixed",
      "type": "boolean"
    },
    "static_analysis": {
      "$ref": "#/$defs/StaticAnalysisConfig",
      "default": {
        "enabled": false,
        "min_severity": "info",
        "semgrep_rules": null,
        "tool_min_severity": {},
        "tools": [
          "ruff",
          "bandit",
          "semgrep"
        ]
      }
    },
    "structured_output": {
      "default": true,
      "title": "Structured Output",
      "type": "boolean"
    },
    "summary_template": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Summary Template"
    },
    "symbol_resolution": {
      "default": true,
      "title": "Symbol Resolution",
      "type": "boolean"
    },
    "temperature": {
      "default": 0.0,
      "title": "Temperature",
      "type": "number"
    },
    "timeout": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Timeout"
    },
    "triage_model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Triage Model"
    },
    "unanchored_min_severity": {
      "$ref": "#/$defs/Severity",
      "default": "high"
    }
  },
  "required": [
    "provider",
    "model"
  ],
  "title": "ReviewConfig",
  "type": "object"
}

ReviewFinding

{
  "$defs": {
    "Severity": {
      "description": "Finding severity, ordered low \u2192 high for `min_severity` filtering.",
      "enum": [
        "info",
        "low",
        "medium",
        "high",
        "critical"
      ],
      "title": "Severity",
      "type": "string"
    }
  },
  "additionalProperties": false,
  "description": "A single inline review comment the model wants to post.",
  "properties": {
    "anchor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Anchor"
    },
    "anchored": {
      "default": true,
      "title": "Anchored",
      "type": "boolean"
    },
    "body": {
      "title": "Body",
      "type": "string"
    },
    "broad": {
      "default": false,
      "title": "Broad",
      "type": "boolean"
    },
    "category": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Category"
    },
    "confidence": {
      "anyOf": [
        {
          "maximum": 10,
          "minimum": 0,
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Confidence"
    },
    "line": {
      "minimum": 1,
      "title": "Line",
      "type": "integer"
    },
    "path": {
      "title": "Path",
      "type": "string"
    },
    "severity": {
      "$ref": "#/$defs/Severity"
    },
    "side": {
      "default": "RIGHT",
      "enum": [
        "LEFT",
        "RIGHT"
      ],
      "title": "Side",
      "type": "string"
    },
    "suggestion": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Suggestion"
    },
    "title": {
      "title": "Title",
      "type": "string"
    }
  },
  "required": [
    "path",
    "line",
    "severity",
    "title",
    "body"
  ],
  "title": "ReviewFinding",
  "type": "object"
}

ProviderResult

{
  "additionalProperties": false,
  "description": "The normalised return of one LLM completion, with token usage.",
  "properties": {
    "attempts": {
      "default": 1,
      "minimum": 1,
      "title": "Attempts",
      "type": "integer"
    },
    "cache_creation_tokens": {
      "default": 0,
      "title": "Cache Creation Tokens",
      "type": "integer"
    },
    "cache_read_tokens": {
      "default": 0,
      "title": "Cache Read Tokens",
      "type": "integer"
    },
    "input_tokens": {
      "title": "Input Tokens",
      "type": "integer"
    },
    "output_tokens": {
      "title": "Output Tokens",
      "type": "integer"
    },
    "text": {
      "title": "Text",
      "type": "string"
    }
  },
  "required": [
    "text",
    "input_tokens",
    "output_tokens"
  ],
  "title": "ProviderResult",
  "type": "object"
}

PRContext

{
  "additionalProperties": false,
  "description": "Everything the engine needs about a PR \u2014 fetched via API, never checkout.",
  "properties": {
    "base_sha": {
      "title": "Base Sha",
      "type": "string"
    },
    "changed_files": {
      "items": {
        "type": "string"
      },
      "title": "Changed Files",
      "type": "array"
    },
    "commit_messages": {
      "items": {
        "type": "string"
      },
      "title": "Commit Messages",
      "type": "array"
    },
    "description": {
      "default": "",
      "title": "Description",
      "type": "string"
    },
    "diff": {
      "title": "Diff",
      "type": "string"
    },
    "file_contents": {
      "additionalProperties": {
        "type": "string"
      },
      "title": "File Contents",
      "type": "object"
    },
    "head_sha": {
      "title": "Head Sha",
      "type": "string"
    },
    "pr_number": {
      "title": "Pr Number",
      "type": "integer"
    },
    "repo": {
      "title": "Repo",
      "type": "string"
    },
    "title": {
      "default": "",
      "title": "Title",
      "type": "string"
    }
  },
  "required": [
    "diff",
    "changed_files",
    "base_sha",
    "head_sha",
    "repo",
    "pr_number"
  ],
  "title": "PRContext",
  "type": "object"
}