DSPy Introduces Flex: Letting LLMs Optimize Code Directly, Cutting LLM Calls by 75%

dbreunig · x · 2026-08-06

The prompt optimization framework DSPy has introduced Flex, a new module that allows optimizers like GEPA to rewrite and optimize a program's Python code directly, rather than just tweaking prompts.

Key Highlights:

The module was implemented by Michael Isaac, a PhD student at Carnegie Mellon University, during his internship at cmpnd.

Related event: DSPy's Flex Optimizes Both Code and Prompts, Cutting LLM Calls by 75%(4 posts)→

Original post →

More from coding & agent

coding & agent channel →