The world of AI is moving at lightning speed, but the process of building, training, and deploying machine learning models can often feel like a monolithic, slow-moving beast. A typical MLOps pipeline—from data ingestion to model deployment—is a complex chain of interconnected tasks. When one link breaks, the entire chain can shatter, leading to hours of debugging, failed experiments, and delayed progress.
What if we could tame this complexity? What if, instead of building one massive, brittle pipeline, we could construct it from small, robust, and independent building blocks?
This is the core philosophy behind action.do: breaking down complex processes into discrete, single-purpose atomic actions. Let's explore how this powerful, API-first approach can revolutionize the way you build and manage AI model training workflows.
If you've worked in MLOps, this probably sounds familiar: a single, giant script is responsible for everything. It fetches data, cleans it, engineers features, trains the model, evaluates it, and maybe even tries to deploy it.
This approach is fraught with problems:
This monolithic approach turns your sophisticated business process into a black box—hard to understand, harder to maintain, and impossible to scale efficiently.
action.do provides a simple, yet profound solution: Execute Atomic Actions.
An atomic action is the smallest, indivisible unit of work in any process. Think of it as a well-defined function with a single responsibility. It accepts structured inputs, performs one specific task, and returns a predictable, structured output.
On the action.do platform, you define these actions as fundamental building blocks. An action for send-invoice, an action for update-crm-record, or, in our case, an action for a single step in an AI pipeline. By composing these simple, reliable blocks, you can build incredibly complex and robust Services-as-Software.
Let's break down a typical model training workflow and see how it maps perfectly to the atomic action model. Instead of one script, we define a series of distinct actions.
Each of these is a self-contained, testable, and reusable action.do. A larger workflow simply orchestrates the execution of these actions, passing the output of one as the input to the next.
Defining these actions is elegantly simple with the action.do SDK. Here’s how you might define the train-model action from our example.
import { Do } from '@do-inc/sdk';
// Initialize the platform client
const platform = new Do({ apiKey: 'YOUR_API_KEY' });
// Define the atomic action for training a model
const trainModel = platform.action('train-model', {
description: 'Trains an ML model with specified data and hyperparameters.',
handler: async (inputs: { trainingDataPath: string, hyperparameters: object }) => {
//
// Placeholder for your actual model training logic
// e.g., using scikit-learn, TensorFlow, or PyTorch
//
console.log(`Starting training with data from: ${inputs.trainingDataPath}`);
console.log(`Hyperparameters:`, inputs.hyperparameters);
// Simulate training and saving an artifact
const modelArtifactPath = `/artifacts/model-${new Date().getTime()}.pkl`;
const metrics = { accuracy: Math.random() * (0.98 - 0.85) + 0.85 }; // Simulated accuracy
console.log(`Training complete. Model saved to ${modelArtifactPath}`);
return { success: true, modelArtifactPath, metrics };
},
});
// Example of how you would execute the action
const result = await trainModel.run({
trainingDataPath: '/tmp/training-set.csv',
hyperparameters: { learning_rate: 0.01, epochs: 100 },
});
console.log(result);
By adopting this atomic approach to task execution, MLOps teams unlock several superpowers:
Stop wrestling with monolithic scripts. Start building your AI and MLOps pipelines with the precision, reliability, and scalability of atomic actions.
Ready to build better, more robust automated systems? Define your first atomic action with action.do today!