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

ParameterValue
modelAny model Meridian proxies (gpt-4o, claude-3.5-sonnet, etc.)
api_keyYour Meridian project API key
api_basehttps://api.meridian.sh/v1

Notes

  • Meridian is OpenAI-API–compatible. Any DSPy LM class that accepts api_base works.
  • 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.