Metadata-Version: 2.4
Name: modaic
Version: 0.10.2
Summary: Modular Agent Infrastructure Collection, a python framework for managing and sharing DSPy agents
Project-URL: Homepage, https://github.com/modaic-ai/modaic
Project-URL: Modaic, https://www.modaic.dev
Project-URL: Docs, https://docs.modaic.dev
Author-email: Tyrin <tytodd@mit.edu>, Farouk <farouk@modaic.dev>
License: MIT License
        
        Copyright (c) 2025 Modaic Inc
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
        ---
        
        Additional Terms:
        
        1. You may not modify this Software in any way that changes the default hub
           endpoint, nor distribute derivative works that route agents or models to
           a hub other than modaic.dev.
        
        2. All other rights are granted as per the MIT License.
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: dspy>=2.6.27
Requires-Dist: gitpython>=3.1.45
Requires-Dist: opik==1.8.42
Requires-Dist: platformdirs>=4.3.8
Requires-Dist: tomlkit>=0.13.3
Description-Content-Type: text/markdown

[![Docs](https://img.shields.io/badge/docs-available-brightgreen.svg)](https://docs.modaic.dev)
[![PyPI](https://img.shields.io/pypi/v/modaic)](https://pypi.org/project/modaic/)


# 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)

```bash
uv add modaic
```

Optional (for hub operations):

```bash
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.
```bash
pip install modaic
```
## Quick Start

### Creating a Simple Program

```python
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:

```python
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:

```python
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`
