Skip to main content

Modular Agent Infrastructure Collection, a python framework for managing and sharing DSPy agents

Project description

Docs PyPI

Modaic 🐙

Modular + Mosaic, a Python framework for composing and maintaining DSPy applications.

Key Features

  • Hub Support: Load and share precompiled DSPY programs from Modaic Hub
  • Program Framework: Precompiled and auto-loading DSPY programs
  • Automated LM Judge Alignment: Continuously align your LM judges to your preferences while staying at the pareto frontier!

Never lose your progress again. Save everything you need to compare and reproduce optimization runs with GEPA, MIPROv2, etc. - architecture, hyperparameters, precompiled prompts, predictions, git commits, and even datasets - in 5 minutes. Modaic is free for personal use and academic projects, and it's easy to get started.

Installation

Using uv (recommended)

uv add modaic

Optional (for hub operations):

export MODAIC_TOKEN="<your-token>"

Using pip

Please note that you will not be able to push DSPY programs to the Modaic Hub with pip.

pip install modaic

Quick Start

Creating a Simple Program

from modaic import PrecompiledProgram, PrecompiledConfig

class WeatherConfig(PrecompiledConfig):
    weather: str = "sunny"

class WeatherProgram(PrecompiledProgram):
    config: WeatherConfig

    def __init__(self, config: WeatherConfig, **kwargs):
        super().__init__(config, **kwargs)

    def forward(self, query: str) -> str:
        return f"The weather in {query} is {self.config.weather}."

weather_program = WeatherProgram(WeatherConfig())
print(weather_program(query="Tokyo"))
weather_program.push_to_hub("me/my-weather-program")

Save and load locally:

weather_program.save_precompiled("./my-weather")

from modaic import AutoProgram, AutoConfig

cfg = AutoConfig.from_precompiled("./my-weather", local=True)
loaded = AutoProgram.from_precompiled("./my-weather", local=True)
print(loaded(query="Kyoto"))

from hub:

from modaic import AutoProgram, AutoConfig

loaded = AutoProgram.from_precompiled("me/my-weather-program", rev="v2.0.0")
print(loaded(query="Kyoto"))

Architecture

Program Types

  1. PrecompiledProgram: Statically defined programs with explicit configuration
  2. AutoProgram: Dynamically loaded programs from Modaic Hub or local repositories

Support

For issues and questions:

  • GitHub Issues: https://github.com/modaic-ai/modaic/issues
  • Docs: https://docs.modaic.dev

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modaic-0.10.2.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

modaic-0.10.2-py3-none-any.whl (34.5 kB view details)

Uploaded Python 3

File details

Details for the file modaic-0.10.2.tar.gz.

File metadata

  • Download URL: modaic-0.10.2.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modaic-0.10.2.tar.gz
Algorithm Hash digest
SHA256 ed482e88caafccf9fb6baa742ea6dfcd96adc4dd5a9a73951e3b3fb0636e60dd
MD5 3d9c3a64f86257be48511a3e36534b54
BLAKE2b-256 e1d5fe81fdd7fe98925289d4fad53fc3fc50ef203cf32c54141dbc06a70f74ee

See more details on using hashes here.

File details

Details for the file modaic-0.10.2-py3-none-any.whl.

File metadata

  • Download URL: modaic-0.10.2-py3-none-any.whl
  • Upload date:
  • Size: 34.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for modaic-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f725e1ce5e86ef61fd7a4031c56b629f8510c18905cd3f7a0a545e29736b7eaa
MD5 b6c39a6c333fae22048c4e3374c82950
BLAKE2b-256 78113c1917fa89fa7117f8a056f851f82e5614878fbcbac842d310b8a077de9e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page