DSPy Launches Experimental Flex Feature for Automated Code and Control Flow Optimization

lateinteraction · x · 2026-08-04

The DSPy framework has released a new experimental feature, dspy.Flex, led by @michaelnisaac. This feature enables models to learn and rewrite the code that represents a task, rather than just optimizing its instructions.

By expanding on dspy.GEPA, Flex can rewrite predictors, control flow, DSPy primitives, and intelligently balance the ratio between Python code and LM calls. The development team noted that this feature is extremely helpful in reducing the operational costs of complex reasoning pipelines, with a detailed blog post coming soon.

Original post →

More from coding & agent

coding & agent channel →