Skip to main content
DSPy is a framework for programming language models rather than relying on static prompts. It enables you to build modular AI systems with code instead of hand-crafted prompting, and it offers methods to automatically optimize these systems. Features
  • Programmatic approach to LLM interactions through Python
  • Modular components for building complex AI pipelines
  • Self-improvement algorithms that optimize prompts and weights
  • Support for various applications from simple classifiers to RAG systems and agent loops

Installing Libraries

Set your Neosantara AI API key:

Example

Setup and connect DSPy to LLMs on Neosantara AI
Now we can set up a DSPy module, like dspy.ReAct with a task-specific signature. For example, question -> answer: str tells the module to take a question and to produce a string answer below.
The output will return an string for answer below:
output
Last modified on November 11, 2025