Skip to main content

OmegaEngine Logo

dspy-omega

DSPy Integration for OmegaEngine

PyPI License


✨ Features

  • 🧠 Programmatic Prompting — Govern DSPy modules
  • 📊 Signature Validation — Validate input/output signatures
  • 🔄 Optimizer Governance — Control optimization runs
  • 📈 Trace Logging — Full audit of DSPy pipelines
  • 🛡️ Module Wrappers — Governance for any DSPy module

📦 Installation

pip install dspy-omega

🚀 Quick Start

import dspy
from dspy_omega import OmegaModule, configure_omega

# Configure governance
configure_omega(
    api_key="your-omega-key",
    policy_id="dspy_policy",
)

class RAG(dspy.Module):
    def __init__(self):
        self.retrieve = dspy.Retrieve(k=3)
        self.generate = dspy.ChainOfThought("context, question -> answer")

    def forward(self, question):
        context = self.retrieve(question).passages
        return self.generate(context=context, question=question)

# Wrap with governance
governed_rag = OmegaModule(RAG())

# All module calls are governed
result = governed_rag(question="What is AI safety?")
print(result.answer)
print(result.omega_audit_id)

🔄 Optimizer Governance

from dspy_omega import governed_optimizer

# Control optimization runs
optimizer = governed_optimizer(
    dspy.MIPROv2(),
    omega_api_key="...",
    max_unsafe_retries=3,
)

📄 License

Licensed under the Apache License 2.0.

Release files for dspy-omega 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dspy-omega 0.3.0
File Size Uploaded
dspy_omega-0.3.0.tar.gz 562.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dspy-omega 0.3.0
File Interpreter ABI Platform
dspy_omega-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 573.1 kB

Release files / dspy_omega-0.3.0.tar.gz

Download URL dspy_omega-0.3.0.tar.gz
Size 562.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dfe3c87c48f398fef088036182916995c1e010cbaa5550d211e07495d38bc6e8
BLAKE2b-256 checksum
How to use checksums
495a67cf51a6ae8bbebd9ee40f43d86f6e7950d6a4e5f60b1b4d52bd23254adb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / dspy_omega-0.3.0-py3-none-any.whl

Download URL dspy_omega-0.3.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96c4f0bf9052f71beed1fb42746c7e313292ca5eab2b76af1233ff9e7c729307
BLAKE2b-256 checksum
How to use checksums
ef5f71864b4392f84b05bad9da2c4cd51858cb43b5ee3d79df57aa9afdc95e7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page