DSPy is Stanford NLP's framework for algorithmically optimizing LLM prompts and weights. Rather than manually crafting prompts, DSPy lets you write modular programs and automatically optimizes the prompts through compilation, dramatically improving reliability and performance.