Modular Agent Infrastructure Collection, a python framework for managing and sharing DSPy agents
Project description
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
- PrecompiledProgram: Statically defined programs with explicit configuration
- 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
Development
install development dependencies:
uv sync --all-extras
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file modaic-0.12.2.tar.gz.
File metadata
- Download URL: modaic-0.12.2.tar.gz
- Upload date:
- Size: 47.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bc3a824e2df5e847c151122d48e634e526c7669e38e992edd22d85358dc1e0d
|
|
| MD5 |
8378f7bd969ae122c10ee2362cdf9e14
|
|
| BLAKE2b-256 |
ac37dfbbad87388609127e19c3e9b7020446b512e5e5c01111ed4e7ebad3c9e8
|
Provenance
The following attestation bundles were made for modaic-0.12.2.tar.gz:
Publisher:
python-publish.yml on modaic-ai/modaic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modaic-0.12.2.tar.gz -
Subject digest:
7bc3a824e2df5e847c151122d48e634e526c7669e38e992edd22d85358dc1e0d - Sigstore transparency entry: 850384107
- Sigstore integration time:
-
Permalink:
modaic-ai/modaic@44ff24c9a0a399222d5855480389f8b523df9f6d -
Branch / Tag:
refs/tags/v0.12.2 - Owner: https://github.com/modaic-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@44ff24c9a0a399222d5855480389f8b523df9f6d -
Trigger Event:
release
-
Statement type:
File details
Details for the file modaic-0.12.2-py3-none-any.whl.
File metadata
- Download URL: modaic-0.12.2-py3-none-any.whl
- Upload date:
- Size: 50.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85b888c626cf414c9d114deeba01a697b81cd564e8b20744d7feed8069306ff1
|
|
| MD5 |
4208bb50c05b815f4837e4c9eed91dc2
|
|
| BLAKE2b-256 |
b43a4e7adfc301c7565d8fb32f920f9e5f8ac9d46ee9b1b238389c3b44694e11
|
Provenance
The following attestation bundles were made for modaic-0.12.2-py3-none-any.whl:
Publisher:
python-publish.yml on modaic-ai/modaic
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
modaic-0.12.2-py3-none-any.whl -
Subject digest:
85b888c626cf414c9d114deeba01a697b81cd564e8b20744d7feed8069306ff1 - Sigstore transparency entry: 850384147
- Sigstore integration time:
-
Permalink:
modaic-ai/modaic@44ff24c9a0a399222d5855480389f8b523df9f6d -
Branch / Tag:
refs/tags/v0.12.2 - Owner: https://github.com/modaic-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@44ff24c9a0a399222d5855480389f8b523df9f6d -
Trigger Event:
release
-
Statement type: