A Python utility that uses LLMs to dynamically implement methods and properties on objects at runtime.
GREMLLM is a Python utility class that uses Large Language Models to dynamically implement methods and properties on objects at runtime. It allows developers to define objects by their intended purpose, and the LLM generates the actual code for method calls and attribute access on-the-fly, solving the problem of writing boilerplate implementation code.
Python developers experimenting with AI-assisted programming, metaprogramming enthusiasts, and those building prototypes or educational tools where dynamic object behavior is desired.
Developers choose GREMLLM for its unique ability to generate object behavior dynamically using LLMs, enabling rapid prototyping, infinite method chaining in 'wet mode', and a novel, experimental approach to coding that reduces manual implementation work.
A slight upgrade to the Gremlins in your code
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Objects implement methods and properties on-the-fly using LLM reasoning, allowing developers to define behavior without writing boilerplate code, as shown in the counter and shopping cart examples.
Method calls return living gremllm objects instead of plain values, enabling complex, emergent interactions like the swimming pool simulator where actions chain indefinitely.
Setting verbose=True displays the exact code generated by the LLM for each method call, helping developers understand and debug the dynamic behavior, as demonstrated in the README examples.
Works with multiple LLMs including OpenAI, Claude, Gemini, and local models via the llm library, allowing customization based on cost and performance needs, per the configuration section.
LLM-generated code can vary wildly between calls, leading to bugs and unexpected behavior, which the README acknowledges with its playful, experimental tone and warnings.
Every method call involves LLM inference, making it slow and expensive for real-time use, with no caching or optimization mentioned, limiting scalability.
Dynamic code generation at runtime complicates error tracking and version control, as changes aren't stored in source files, hindering team collaboration and long-term projects.