Lattice
Skip to content

TextGrad

github.comlibraryself-hosted

TextGrad is a self-hosted library in the Prompt Engineering layer of the AI stack. Automatic prompt optimisation via textual feedback loops.

By Lattice editorial · Facts verified · method

licence
MIT
language
Python
cost
free

Use TextGrad when

Automatic prompt optimisation via textual feedback loops.

Skip TextGrad when

Optimising without an eval set is guessing.

Makes the prompt an artifact you can diff and test. — that is what this layer of the stack is answerable for. See the full Prompt Engineering section for the rest of the options.

Visit github.comCompare with another tool
Badge this entry
Lattice badge: TextGrad verified 2026-09
[![TextGrad on Lattice: verified 2026-09](https://lattice.kunjshah.in/prompt-engineering/textgrad/badge.svg)](https://lattice.kunjshah.in/prompt-engineering/textgrad)

Quick answers

Is TextGrad open source?
Yes. TextGrad is open source under the MIT licence. It is free to use.
What are the alternatives to TextGrad?
The closest alternatives to TextGrad are DSPy.

Reading on prompts

Alternatives to TextGrad

Listed as an alternative to

  • DSPy

Also in prompts

  • DSPy
  • Instructor
  • Humanloop
  • Guidance
  • PromptLayer
  • Agenta
  • Promptwatch
  • Outlines