Integrating Artificial Intelligence systems, data processing pipelines, and IT infrastructure has become one of the most significant challenges for modern organizations. Often, teams end up assembling a series of ad-hoc scripts and microservices, creating a “patchwork” that is difficult to manage, scale, and maintain. This fragmented approach leads to high operational costs, development slowdowns, and general inefficiency that directly impacts the ability to innovate. An environment with 2,000 endpoints and 300+ VMs, like the one I manage, cannot afford artisanal solutions when it comes to automation and AI. A robust framework is needed to unify the management of these elements, reducing complexity and increasing productivity.
Tested on: Ubuntu 24.04 LTS · Python 3.10 · Docker 26.x · August 2026
What is Modular and Why is it Relevant
Modular is an open-source framework designed to simplify the orchestration of complex workflows that combine Artificial Intelligence components, data processing, and infrastructure interaction. Its approach is based on the idea of reusable “modules,” which can be composed to create sophisticated and scalable pipelines. This solves the problem of “boilerplate code” and inter-team dependencies (data scientists, ML engineers, DevOps), allowing for smoother collaboration and greater agility in developing AI-driven applications. Its relevance is paramount in contexts where managing a large number of models, heterogeneous data sources, and distributed infrastructures is the norm, not the exception.
Read also: PrimeAgent: AI Agent for IT Automation
Prerequisites / Test Environment
To replicate the examples and start using Modular, you need an environment with:
- Python: Version 3.8 or higher.
- pip: The Python package manager.
- Git: To clone the Modular repository.
- Docker (optional): To run modules in isolated containers, useful for scalability and dependency management.
# Install Python (if not already present)
sudo apt update
sudo apt install python3 python3-pip git -y
# Verify versions
python3 --version
pip --version
git --version
# Install Docker (if you intend to use it)
sudo apt install docker.io -y
sudo usermod -aG docker ${USER}
newgrp docker
1. Modular Installation and First Workflow
Modular’s installation is straightforward. Once Python and pip are installed, simply clone the repository and install the dependencies. The core of Modular lies in its ability to define workflows as graphs of interconnected modules, where each module performs a specific operation.
Installation
Clone the repository and install the framework. It’s good practice to create a Python virtual environment to isolate dependencies.
# Clone the Modular repository
git clone https://github.com/modular/modular.git
cd modular
# Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate
# Install Modular and its dependencies
pip install -e .
Define a Simple Workflow
Create a my_workflow.py file that defines two modules: one that generates a message and one that processes it. This example illustrates basic composition.
# my_workflow.py
from modular import module, workflow
@module
def generate_message(name: str) -> str:
return f