Lattice
Skip to content

TextGrad

librarySelf-hostedgithub.com

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

By Facts verifiedmethod

Licence
MIT
Language
Python
Cost
free
Owned by
Applied Engineering

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. See every prompts 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)

Rules of thumb

  • Prompt changes without evals are guesses. Version prompts and measure before you ship a wording change.
  • Keep prompts out of string literals. A prompt you cannot diff is a prompt you cannot review.
  • Fix the examples before the instructions. Models copy what you show more faithfully than what you tell.

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.

Ask an AI about this page

Opens the assistant with this page’s link and a question already filled in.

Reading on prompts

Alternatives to TextGrad

Listed as an alternative to

  • DSPy

Also in prompts

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