cataclysm  by Mattie

Code generation library for rapid prototyping and experimentation

created 2 years ago
406 stars

Top 72.7% on sourcepulse

GitHubView on GitHub
Project Summary

Cataclysm is a Python library that leverages OpenAI's GPT-4 to generate code based on function signatures, docstrings, and comments. It aims to automate code writing for developers by providing context to an LLM, reducing the need for manual coding.

How It Works

Cataclysm utilizes OpenAI's GPT-4 API, accessed via plunkylib, to generate code. The library inspects function signatures, call stacks, keyword arguments, docstrings, and comments to inform the LLM. It offers two primary modes: consume() for interactive/notebook use where any unrecognized function can trigger AI code generation, and doom for library/app integration, requiring explicit function calls. The library caches generated code for subsequent calls to improve performance and predictability.

Quick Start & Requirements

  • Install via pip install cataclysm.
  • Requires an OpenAI API key (GPT-4 recommended, GPT-3.5-turbo supported).
  • Copy env.template.cataclysm to .env and add your OPENAI_API_KEY.
  • Official documentation and examples are available via YouTube and a provided notebook.

Highlighted Details

  • Generates code for unrecognized functions based on context.
  • Supports two modes: consume() (global generation) and doom (explicit generation).
  • Caches generated code for performance and predictability.
  • Allows customization of prompts and LLM parameters (e.g., for GPT-3.5-turbo).

Maintenance & Community

  • Developed by Mattie.
  • Contact available for enterprise solutions.

Licensing & Compatibility

  • No explicit license is mentioned in the README.

Limitations & Caveats

The library carries significant warnings about the potential dangers and unpredictability of AI-generated code, comparing it to blindly following GPS. While it caches code, exact regeneration of code is difficult due to the nature of LLMs. The consume() mode is explicitly not recommended for libraries or apps due to its global nature.

Health Check
Last commit

1 year ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.