zou-group/textgrad ? reverse-engineered prompt
Reverse engineered prompt
Build me a Python library that lets me improve prompts, answers, and even bits of text using feedback from a language model, kind of like training with gradients but in words instead of numbers.
I want a simple API that feels familiar if someone knows PyTorch, where I can create variables, define a text based loss, run a backward pass, and then update the result. It should work with popular LLM providers through a backend that I can swap easily, and it should support caching and the newer flexible model setup too.
Please include a few clear examples, like optimizing a prompt, fixing a bad reasoning answer, and improving some generated text. Also add tests and a couple of tutorial style notebooks or example scripts so it is easy to try right away. If useful, look up current docs online for the model provider setup, but keep the project simple and practical.
Are you gonna build this?
make sure you review the code using coderabbit