Skip to content

justindal/debugging-code-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self Debugging Code Agent

A Python code agent built with LangGraph that writes solutions for specific LeetCode problems, runs test cases, and self-corrects its solutions.

Data

This project uses the Hugging Face dataset newfacade/LeetCodeDataset as the source for the problems including the starter code, entry points, and tests.

  • Problems are loaded from the test split.

Requirements

  • Python 3.12+
  • One provider:
    • Ollama
    • OpenAI-compatible local server
    • MLX LM server (mlx_lm.server)
  • A model supported by the chosen provider (default: llama3.1)

Example for Ollama:

ollama pull llama3.1

Example for MLX:

pip install mlx-lm
mlx_lm.server --model mlx-community/Llama-3.1-8B-Instruct

Installation

Using uv:

uv sync

Or using pip:

python -m venv .venv
source .venv/bin/activate
pip install -e .

Usage

Run:

debugging-code-agent

Or with the module:

python -m debugging_code_agent

Provider examples

Ollama (default):

debugging-code-agent --provider ollama --model llama3.1

OpenAI-compatible local server:

debugging-code-agent --provider server --base-url http://localhost:8000/v1 --model Qwen/Qwen2.5-Coder-7B-Instruct

MLX LM server (defaults to http://127.0.0.1:8080/v1):

debugging-code-agent --provider mlx --model mlx-community/Llama-3.1-8B-Instruct

All options

--provider {ollama,server,mlx}   LLM provider (default: ollama)
--model MODEL                    Model name for the selected provider (default: llama3.1)
--temperature TEMPERATURE        Sampling temperature (default: 0.1)
--base-url BASE_URL              Base URL for server/mlx providers
--api-key API_KEY                Optional API key for server/mlx providers
--max-attempts MAX_ATTEMPTS      Maximum solve attempts per problem (default: 5)

Frameworks Used

About

A Python code agent built with LangGraph that writes solutions for specific LeetCode problems, runs test cases, and self-corrects its solutions.

Resources

Stars

Watchers

Forks

Contributors

Languages