Loading...
Loading...
Build complex AI systems with declarative programming, optimize prompts automatically, create modular RAG systems and agents with DSPy - Stanford NLP's framework for systematic LM programming. Use when you need to build complex AI systems, program LMs declaratively, optimize prompts automatically, create modular AI pipelines, or build RAG systems and agents.
npx skill4agent add zpankz/mcp-skillset dspyimport dspy
# 1. Configure
dspy.settings.configure(lm=dspy.OpenAI(model='gpt-4o-mini'))
# 2. Define Module
qa = dspy.ChainOfThought("question -> answer")
# 3. Run
response = qa(question="What is the capital of France?")
print(response.answer)configuring-language-models.mddesigning-signatures.mdbuilding-modules.mdconfiguring-language-models.mdbuilding-rag-pipelines.mdfew-shot-learning.mdevaluating-programs.mdconfiguring-language-models.mddesigning-signatures.mdbuilding-modules.mdassertions-validation.mdinstruction-optimization.mdevaluating-programs.mdpip install dspy
# Or with specific providers
pip install dspy[anthropic] # Claude
pip install dspy[openai] # GPT
pip install dspy[all] # All providers