gremllm  by awwaiid

Dynamic code generation for Python objects

Created 2 months ago
630 stars

Top 52.6% on SourcePulse

GitHubView on GitHub
Project Summary

GREMLLM provides a dynamic object-oriented interface for interacting with Large Language Models (LLMs), enabling on-the-fly method and property generation based on LLM reasoning. It targets developers seeking to create fluid, chainable, and self-modifying code structures, offering "wet mode" for continuous method chaining and "verbose mode" for LLM-generated code transparency.

How It Works

GREMLLM intercepts every method call and attribute access, routing them through an LLM to dynamically generate and execute Python code. This approach allows objects to exhibit emergent behavior, implementing functionality as needed. "Wet mode" enhances this by returning LLM-generated objects instead of primitive types, facilitating infinite chaining of operations.

Quick Start & Requirements

  • Install: pip install gremllm
  • Prerequisites: Requires an LLM provider (OpenAI default, Claude, Gemini, or local via Ollama). API keys may be needed.
  • Configuration: Use llm keys set <provider> to configure LLM access.
  • Examples: See example/counter.py and example/cart.py.

Highlighted Details

  • Dynamic Behavior: Objects implement methods and properties on-the-fly using LLM reasoning.
  • Wet Mode: Method calls return living gremllm objects for infinite chaining.
  • Verbose Mode: Displays LLM-generated code for debugging and understanding.
  • Multi-Model Support: Integrates with OpenAI, Claude, Gemini, and local models via the llm library.
  • Inheritance: Child objects inherit wet and verbose settings.

Maintenance & Community

The project appears to be a personal endeavor with limited community engagement signals in the README. The author expresses surprise that it works and encourages users to share their experiences.

Licensing & Compatibility

The README does not explicitly state a license.

Limitations & Caveats

The project's author expresses significant uncertainty about its stability and practical use ("please don't use this"). The dynamic nature of LLM-generated code can lead to unpredictable behavior and potential errors.

Health Check
Last Commit

2 months ago

Responsiveness

1 week

Pull Requests (30d)
0
Issues (30d)
0
Star History
11 stars in the last 30 days

Explore Similar Projects

Starred by Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), Travis Fischer Travis Fischer(Founder of Agentic), and
6 more.

AlphaCodium by Codium-ai

0.1%
4k
Code generation research paper implementation
Created 1 year ago
Updated 9 months ago
Feedback? Help us improve.