seanchatmangpt / dspygen

A Ruby on Rails style framework for the DSPy (Demonstrate, Search, Predict) project for Language Models like GPT, BERT, and LLama.
MIT License
66 stars 16 forks source link

Codegen workflow (WIP) #6

Open chadbrewbaker opened 3 weeks ago

chadbrewbaker commented 3 weeks ago

On my mobile playing with gpt2lmsys. I don’t disagree with its codegen workflow skeleton as to how it should split the problem into dspy optimization modules. Handle langsec formalization of IO surface first. Come up with an internal representation for the problem domain. Generate test cases to make sure the internal representation is faithfull to the spec. Emit target code for the arch. It keeps everything in prompt space till the end. Layers are not too tightly coupled.

Explanation of Layers

  1. Layer 0: Handles the input of the specification and its validation.
  2. Layer 1: Converts the specification into an intermediate representation (IR).
  3. Layer 2: Responsible for generating code from the IR.
  4. Layer 3: Generates test cases and verifies the generated code.
  5. Layer 4: Packages and deploys the generated code.
seanchatmangpt commented 3 weeks ago

I agree. I will have FSM Actors to handle the decisions.