gitmyhub

code-forge

Python ★ 0 updated 1mo ago

Decompose→contract→test-first→red/green harness that lets a local 27B model do agentic coding — no context expansion, no bigger GPU, no API bill.

A harness that lets a small, locally run AI model write and test working code end to end, without needing more context or a bigger GPU.

PythonPySide6pytestllama.cppsetup: hardcomplexity 4/5

Code Forge is a Python tool that lets a small, locally run AI model write working code on its own, without needing a bigger computer, a longer context window, or a paid API. The project's argument is that the usual fixes people reach for when a local coding model struggles, giving it more context or buying a bigger GPU, are not actually the problem. Instead, Code Forge focuses on structuring the work so a smaller model can succeed.

It does this by breaking a goal into smaller subtasks, writing down a clear interface for each piece of code before anything is implemented, generating tests first, and then having the model write code in a loop until those tests pass. The plan, the tests, and the final code all refer to the exact same declared names, which is meant to stop the model from getting confused between similarly named functions. The model that writes the code is not allowed to edit the tests it is being checked against, so passing the tests actually means something.

The workflow has a clear split between what the machine can check automatically, such as whether code compiles, launches, and passes its tests, and what only a human can judge, such as whether the finished program actually behaves and feels right. Code Forge is upfront that it will not falsely claim something works if a human still needs to try it out and confirm.

To use it, you need a local server that speaks the OpenAI style chat API, such as one built with llama.cpp, running a capable local model. The project was tested with a 27 billion parameter model on a 24 gigabyte graphics card, using it to build a playable Tetris game. Code Forge ships with a graphical interface built in PySide6, as well as a simpler command line style HTTP service for automation. It can optionally send a few specific planning and test writing steps to a stronger cloud model from Anthropic if an API key is provided, but everything works fully locally by default. Comments inside the code are written in Japanese, since this began as a personal research project before being cleaned up and shared publicly. No license is stated in the README.

Where it fits