zou-group/textgrad

github.com/zou-group/textgrad AI Data & Analytics Open-source projectOpen source

Automatic "Differentiation" via Text, using large language models to backpropagate textual gradients.

github.com/zou-group/textgrad
zou-group/textgrad homepage screenshot

About zou-group/textgrad

TextGrad is an open-source Python framework for automatic differentiation via text. It uses large language models to provide textual feedback, which the framework backpropagates to optimize variables such as an LLM's answer to a question. The project's README states that it was published in Nature on 19 March 2025. Its API is modeled on PyTorch: users define a loss function in natural language, then optimize variables with a textual gradient descent optimizer (TGD).

The repository includes example Jupyter notebooks in its examples folder. A newer engine built on LiteLLM allows use of any model that LiteLLM supports, and the README names Bedrock, Together, and Gemini as examples. It also offers an option to enable or disable caching in these engines. The README describes this LiteLLM engine as experimental, and states that the older engines are planned for deprecation.

Key features

  • Backpropagates textual feedback from LLMs to update variables
  • Natural-language loss functions defined with TextLoss
  • Textual Gradient Descent (TGD) optimizer for text variables
  • Variables with role descriptions and requires_grad settings
  • Experimental LiteLLM-based engine supporting LiteLLM-compatible models
  • Optional caching in the newer engines, configurable on or off
Best for: Python developers and researchers who work with LLMs and want to optimize text outputs using a PyTorch-style API and natural-language feedback.
Good for
  • Open source, with the code and examples available in a public GitHub repository
  • API is modeled on PyTorch, which the README presents as familiar to PyTorch users
  • Includes example notebooks showing the quickstart and the newer engines
Watch out for
  • The LiteLLM-based engines are described as experimental
  • The older engines are planned for deprecation in the future
  • New engines require setting relevant environment variables before use

zou-group/textgrad at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 6, 2026 · Online when checked
Listed
Oct 5, 2026

zou-group/textgrad alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in AI Data & Analytics

Well-known listings from the same topic.

All 302

zou-group/textgrad FAQ

Which models can be used with the newer engines?
The README says the LiteLLM-based engine can be used with any model supported by LiteLLM, and names Bedrock, Together, and Gemini as examples.
Can responses be cached?
The README states that the newer engines make it easy to enable and disable caching.
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing