DSPy introduces Flex: Joint code and prompt optimization slashes LLM calls by 75%

dbreunig · x · 2026-08-06

DSPy has introduced Flex, a new feature that optimizes the program's code in addition to the prompt.

According to the cited results using the GEPA optimizer, Flex improved task accuracy from 90% to 95% while making 75% fewer LLM calls. This approach offers a cheaper, faster, deterministic, and auditable method for developing LLM applications.

Related event: DSPy Introduces Flex Module for Code and Prompt Optimization(3 posts)→

Original post →

More from coding & agent

coding & agent channel →