explaingit

rahuldr556/ast-guided-llm-code-review_system

Analysis updated 2026-05-18

56PythonAudience · developerComplexity · 3/5Setup · moderate

TLDR

A Python tool that combines AST-based code structure analysis with an LLM to automatically flag bugs like None-reference errors, divide-by-zero, and unclosed resource handles.

Mindmap

mindmap
  root((AST-Guided LLM Code Review))
    What it does
      Parses Python code structure
      Detects six bug patterns
      LLM judges each flag
      Aggregates findings
    Tech stack
      Python
      AST parsing
      OpenAI GPT-4 optional
    Use cases
      Pre-review bug scan
      Data science pipeline checks
      CI bug gate
    Audience
      Developers
      Data scientists
    Modes
      Free simulation mode
      GPT-4 API mode

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Scan a Python codebase for None-reference, divide-by-zero, and out-of-bounds bugs before merging a PR

USE CASE 2

Catch data leakage between training and test sets in a machine learning pipeline

USE CASE 3

Run the free simulation mode to bug-check code with no API key or cost

What is it built with?

PythonAST parsingOpenAI API

How does it compare?

rahuldr556/ast-guided-llm-code-review_systemeadmin2/jarvis_aigreatvishal27-rc/ai-resume_analyzer
Stars565656
LanguagePythonPythonPython
Setup difficultymoderatehardmoderate
Complexity3/54/52/5
Audiencedeveloperdevelopervibe coder

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Simulation mode needs no API key, GPT-4 mode requires an OpenAI API key.

In plain English

This project is a code review tool that automatically scans Python programs for bugs, combining two techniques: structural code analysis (called AST, which reads how code is organized like a grammar checker reads sentences) and an AI language model that reasons about what the code is doing. The goal is to catch real bugs before humans have to find them manually. The system works as a five-step assembly line. First it parses the source file to understand its structure. Then it runs detectors that look for specific problem patterns. Next it slices out the relevant code sections around any suspicious spot so the AI does not have to read everything at once. The AI then reviews those slices and judges whether each flag is a real bug. Finally an aggregator collects all findings and resolves any conflicts between detectors. The tool looks for six specific types of bugs: accessing a variable that might be None, dividing by zero, reading outside array bounds, data leakage between training and test sets in machine learning code, tensor shape mismatches, and resource handles that are opened but never closed. These cover common mistakes in both ordinary Python code and data science pipelines. Benchmark results reported in the README are strong. On a synthetic test set of 80 cases the tool scored 100% precision and 94.3% recall, meaning it flagged only real bugs and caught almost all of them. On 12 hand-picked real-world bugs the recall was 92%. When run against 90 real-world cases using GPT-4 the recall was 88%, still with perfect precision. You can run it in simulation mode at no cost, which uses a built-in reasoning layer without calling any external API, or with an OpenAI API key to use GPT-4 for the review stage. The repository includes 39 unit tests and 92 benchmark cases across 25 Python files totaling roughly 8,500 lines of code.

Copy-paste prompts

Prompt 1
Set up AST-Guided LLM Code Review System in simulation mode and run it against my Python project's src/ folder
Prompt 2
Configure this tool with my OpenAI API key so the review stage uses GPT-4 instead of simulation mode
Prompt 3
Write a script that runs this tool's five detectors across every .py file in my repo and prints a summary table
Prompt 4
Explain what the tool's tensor-shape-mismatch detector would catch in a PyTorch training script

Frequently asked questions

What is ast-guided-llm-code-review_system?

A Python tool that combines AST-based code structure analysis with an LLM to automatically flag bugs like None-reference errors, divide-by-zero, and unclosed resource handles.

What language is ast-guided-llm-code-review_system written in?

Mainly Python. The stack also includes Python, AST parsing, OpenAI API.

How hard is ast-guided-llm-code-review_system to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is ast-guided-llm-code-review_system for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.