Skip to content

demml/opsml

Repository files navigation


opsml logo

Quality Control for the Machine Learning Lifecycle

OpsML is an open-source developer-first ML operations platform focused on injecting quality control into the machine learning artifact lifecycle. Leverage Opsml to build, manage, track, monitor, and govern your AI applications. Build with confidence, deploy with peace of mind.

CI Py-Versions gitleaks License: MIT llms.txt


Current status: v3.0.0 pre-release (check release tags for latest 3.0.0-rc.* version)

Table of Contents

Why OpsML?

Building reliable ML systems shouldn't require gluing together dozens of disparate tools, each with their own quirks, gaps, and maintenance overhead. The modern ML stack is fragmented. While opsml can't solve every problem, it aims to provide a unified foundation for your machine learning lifecycle.

What makes OpsML different

  • All-in-One Simplicity – Models, data, prompts, experiments, services, and monitoring in one unified platform
  • Artifact-First Approach – Artifacts are the foundation of any ML system. Opsml treats them all as first-class citizens.
  • Type-Safe & Fast – OpsML is written entirely in rust with a focus on reliability and performance
  • Zero-Friction Integration – Drop into existing workflows in minutes
  • Cloud & Database Agnostic – Deploy anywhere, from local dev to multi-cloud production
  • Production-Ready Controls – Authentication, encryption, audit trails, and governance built-in
  • Integrated Monitoring – Real-time drift detection via Scouter
  • Standardized Patterns – Consistent workflows across teams, projects, and environments
  • Developer Happiness – One dependency, unified API, maximum productivity

Installation

pip install "opsml==3.0.0rc15"

Demo

Install the following dependencies to run the demo (if you don't have them already):

pip install scikit-learn

Then run the demo:

opsml demo

Now start the ui and navigate to localhost:3000 in your browser (use guest as username and password):

opsml ui start

shutdown the ui when you're done:

opsml ui stop

Example Usage (Traditional ML)

# create_fake_data requires polars and pandas to be installed 
from opsml.helpers.data import create_fake_data
from opsml import SklearnModel, CardRegistry, TaskType, ModelCard, RegistryType
from sklearn import ensemble

# get model registry
reg = CardRegistry(RegistryType.Model)

# create data
X, y = create_fake_data(n_samples=1200)

# Create and train model
classifier = ensemble.RandomForestClassifier(n_estimators=5)
classifier.fit(X.to_numpy(), y.to_numpy().ravel())

model_interface = SklearnModel( 
    model=classifier,
    sample_data=X[0:10],
    task_type=TaskType.Classification,
)
model_interface.create_drift_profile(alias="drift", X)

modelcard = ModelCard(
    interface=model_interface,
    space="opsml",
    name="my_model",
)

# register model
reg.register_card(modelcard)

Example Usage (LLM)

from openai import OpenAI
from opsml import PromptCard, Prompt, CardRegistry

client = OpenAI()

card = PromptCard(
    space="opsml",
    name="my_prompt",
    prompt=Prompt( 
        model="gpt-4o",
        provider="openai",
        message="Provide a brief summary of the programming language ${language}.", 
        system_instruction="Be concise, reply with one sentence.",
    ),
)

def chat_app(language: str):

    # create the prompt and bind the context
    user_prompt = card.prompt.bind(language=language).message[0].unwrap()
    system_instruction = card.prompt.system_instruction[0].unwrap()

    response = client.chat.completions.create(
        model=card.prompt.model_identifier,
        messages=[
            {"role": "system", "content": system_instruction},
            {"role": "user", "content": user_prompt},
        ],
    )

    return response.choices[0].message.content

if __name__ == "__main__":
    result = chat_app("Python")
    print(result)

    # Register the card in the registry
    registry = CardRegistry("prompt")
    registry.register_card(card)

For more examples, check out the examples directory.

Hosting

OpsML can be hosted on any cloud provider or on-premises. It supports multi-cloud deployments and is compatible with various databases. You can run OpsML in isolated environments to avoid conflicts between staging and production. Check out the hosting guide for more details.

Us vs Others

Feature OpsML Others
Artifact-First Approach
SemVer for All Artifacts ❌ (rare)
Multi-Cloud Compatibility
Multi-Database Support
Authentication
Encryption ❌ (rare)
Artifact Lineage ❌ (uncommon)
Out-of-the-Box Model Monitoring & Data Profiling
Isolated Environments (No Staging/Prod Conflicts)
Single Dependency
Low-friction Integration Into Your Current Tech Stack
Standardized Patterns and Workflows
Open Source ❌ (some)

Contributing

If you'd like to contribute, be sure to check out our contributing guide! If you'd like to work on any outstanding items, check out the roadmap section in the docs and get started.

Thanks goes to these phenomenal projects and people for creating a great foundation to build from!