Configure Language Models with dspy.LM
dspy.LM is DSPy's unified interface for calling language models. It wraps LiteLLM so any provider -- OpenAI, Anthropic, Google, Together AI, Ollama, vLLM, and 100+ others -- works through one consistent API. You configure a model once, then every DSPy module uses it automatically.
Basic setup
import dspy
# Create an LM instance with a provider/model string
lm = dspy.LM("openai/gpt-4o-mini") # o
[Description truncada. Veja o README completo no GitHub.]