BugOut is a fairly early proof-of-concept (PoC) Python coding agent that demonstrates how you can build a local code-generation and execution agent from scratch. It leverages a locally running “DeepSeek Lite” API (llm/deepseek_lite_api.py
) to generate code. The code is then automatically run and refined until it executes without errors, or until a set iteration limit is reached.
-
Local LLM API Integration
- BugOut calls your locally running LLM endpoint (DeepSeek Lite) to generate Python code based on instructions and user prompts.
- Uses streaming responses to capture code as it’s generated.
-
Conversation Management
- Maintains a conversation list (
self.conversation
) with:- A “system” prompt that provides instructions to the LLM.
- A sequence of user prompts or feedback.
- The LLM’s replies, including any generated code.
- Maintains a conversation list (
-
Iterative Refinement
- If code execution returns an error, BugOut re-injects the error output into the conversation, prompting the LLM to provide a refined solution.
- Planning and Reflection
- This loop continues until:
- The code executes successfully, or
- The maximum iteration count (
max_iterations
) is reached.
- Writes the code to a temporary
.py
file—rather than usingexec()
—and then runs it in a subprocess for safety and isolation.