Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
TextGrad: Automatic ''Differentiation'' via Text -- using large language models to backpropagate textual gradients. Published in Nature.
| Date | Stars |
|---|---|
| 2026-07-31 | 3675 |
| 2026-08-03 | 3675 |
| 2026-08-04 | 3684 |
| 2026-08-06 | 3684 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day

<!--- BADGES: START --->
[](https://colab.research.google.com/github/zou-group/TextGrad/blob/main/examples/notebooks/Prompt-Optimization.ipynb)
[][#license-gh-package]
[](https://www.nature.com/articles/s41586-025-08661-4)
[][#arxiv-paper-package]
[][#docs-package]
[][#pypi-package]
[][#pypi-package]
[][#conda-forge-package]
[][#conda-forge-package]
[#license-gh-package]: https://lbesson.mit-license.org/
[#arxiv-paper-package]: https://arxiv.org/abs/2406.07496
[#docs-package]: https://textgrad.readthedocs.io/en/latest/?badge=latest
[#pypi-package]: https://pypi.org/project/textgrad/
[#conda-forge-package]: https://anaconda.org/conda-forge/textgrad
[#nature-link]: https://www.nature.com/articles/s41586-025-08661-4
<!--- BADGES: END --->
## TextGrad: Automatic ''Differentiation'' via Text
An autograd engine -- for textual gradients!
TextGrad is a powerful framework building automatic ``differentiation'' via text.
TextGrad implements backpropagation through text feedback provided by LLMs, strongly building on the gradient metaphor
We provide a simple and intuitive API that allows you to define your own loss functions and optimize them using text feedback.
This API is similar to the Pytorch API, making it simple to adapt to your usecases.

### Updates:
**19th March 2025**
TextGrad published in [Nature](https://www.nature.com/articles/s41586-025-08661-4)!
**Past Updates**:
We are introducing a new engine based on [litellm](https://github.com/BerriAI/litellm). This should allow
you to use any model you like, as long as it is supported by litellm. This means that now
**Bedrock, Together, Gemini and even more** are all supported by TextGrad!
This should be seen as experimental but we plan to depreciate the old engines in the future.
In addition to this, with the new engines it should be easy to enable and disable caching.
We are in the process of testing these new engines and deprecating the old engines. If you have any issues, please let us know!
The new litellm engines can be loaded with the following code:
An example of loading a litellm engine:
```python
engine = get_engine("experimental:gpt-4o", cache=False)
# this also works with
set_backward_engine("experimental:gpt-4o", cache=False)
```
Be sure to set the relevant environment variables for the new engines!
An example of forward pass:
```python
import httpx
from textgrad.engine_experimental.litellm import LiteLLMEngine
LiteLLMEngine("gpt-4o", cache=True).generate(content="hello, what's 3+4", system_prompt="you are an assistant")
image_url = "https://upload.wikimedia.org/wikipedia/commons/a/a7/Camponotus_flavomarginatus_ant.jpg"
image_data = httpx.get(image_url).content
LiteLLMEngine("gpt-4o", cache=True).generate(content=[image_data, "what is this my boy"], system_prompt="you are an assistant")
```
In the examples folder you will find two new notebooks that show how to use the new engines.
## QuickStart
If you know PyTorch, you know 80% of TextGrad.
Let's walk through the key components with a simple example. Say we want to use GPT-4o to solve a simple
reasoning problem.
The question is *If it takes 1 hour to dry 25 shirts under the sun, how long will it take to dry 30 shiExcerpt of 19,116 characters
Read on GitHubFederico Bianchi · Together AI · United States
63
42
Pan Lu · Stanford University · United States
8
5
3
Sugato Ray · Truist · United States
2
2
Nihal Nayak · Harvard University · Morocco
2
1
1
1
1
David Ruan
1
Atakan Tekparmak
1
Zhenning Yang · University of Michigan
1
1
1
1
1
Ahmed Mustahid · Japan
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:958d5ae08087da58, topic:large-language-models