DSPy with Meridian
Route every DSPy LLM call through Meridian's secure API gateway.
Quickstart
Swap your existing dspy.OpenAI constructor to point at Meridian. Everything else — signatures, optimizers, teleprompters — stays identical.
import dspy
lm = dspy.OpenAI(
model="gpt-4o",
api_key="sk-meridian-...", # Meridian API key
api_base="https://api.meridian.sh/v1",
)
dspy.configure(lm=lm)
# Your existing DSPy pipeline — unchanged
qa = dspy.ChainOfThought("question -> answer")
print(qa(question="What is the capital of France?"))Configuration
| Parameter | Value |
|---|---|
| model | Any model Meridian proxies (gpt-4o, claude-3.5-sonnet, etc.) |
| api_key | Your Meridian project API key |
| api_base | https://api.meridian.sh/v1 |
Notes
- Meridian is OpenAI-API–compatible. Any DSPy LM class that accepts
api_baseworks. - All requests are encrypted in transit and logged in your Meridian dashboard.
- Rate limits and spend caps are enforced per API key — configure them in the Meridian console.