Skip to content

oslabs-beta/mlflow-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


About

License: MIT Release Build Coverage Contributions

mlflow.js is an open-source npm library designed for JavaScript developers who want to integrate with MLflow, providing tools and functionalities for managing machine learning lifecycle.

Visit the official mlflow.js site for more info!

Visit our LinkedIn page below:

LinkedIn


Features

mlflow.js covers all REST API endpoints under MLflow's Tracking Server and Model Registry. Official documentation for MLflow.js can be found here. Moreover, high-level abstraction workflows have been developed to facilitate developers' work processes.

High-Level Abstraction Workflows

Experiment Manager

  • runExistingExperiment - Full workflow of creating, naming, and starting a run under an existing experiment, logging metrics, params, tags, and the model, and finishing the run
  • runNewExperiment - Full workflow of creating, naming, and starting a run under a new experiment, ogging mettrics, params,tags, and the model, and finishing the run
  • experimentSummary - Returns an array of all the passed-in experiment's runs, sorted accoroding to the passed-in metric

Run Manager

  • cleanupRuns - Deletes runs that do not meet certain criteria and return an object of deleted runs and details
  • copyRun - Copies a run from one experiment to another (without artifacts and models)

Model Manager

  • createRegisteredModelWithVersion - Creates a new registered model and the frist version of that model
  • updateRegisteredModelDescriptionAndTag - Updates a registered model's description and tags
  • updateAllLatestModelVersion - Updates the latest version of the specified registered model's description, adds a new alias, and tag key/value foro tthat latest version

Built with

TypeScript JavaScript React Next.js TailwindCSS ESLINT Node.js Jest GitHub Actions Docker NPM Vercel


Prerequisites

Set Up MLflow UI

Ensure MLflow is installed on your system:

pip install mlflow

Note: MLflow is compatible with MacOS. If you encountner issues with the default system Python, consider installing Python 3 via the Homebrew package manger using brew install python. In this case, installing MLflow is now pip3 install mlflow.

Start the MLflow Tracking Server

To start the MLflow tracking server locally, use the following command:

mlflow ui --port 5000

This will launch the MLflow UI on your local machine at http://localhost:5000.


Quickstart

Install MLflow.js Library

To use the MLflow.js library, navigate to your project directory and install it via npm:

npm install mlflow-js

Usage Example

Here is an example of how to use the MLflow.js library to create an experiment:

import Mlflow from 'mlflow-js';

// Initialize the MLflow client
const mlflow = new Mlflow('http://127.0.0.1:5000');

// Get the experiment client
const experimentClient = mlflow.getExperimentClient();

// Create a new experiment
async function createExperiment(){
	try {
  	await experimentClient.createExperiment('My Experiment');
  	console.log('Experiment created successfully');
	} catch (error) {
  	console.error('Error creating experiment:', error);
	}
}

createExperiment();

Documentation

Official documentation for MLflow.js can be found here.


Contributing

We welcome contributions to mlflow.js! Please see our Contributing Guide for more details on how to get started.


License

MIT


Meet The Team

Name GitHub LinkedIn
Kyler Chiago GitHub LinkedIn
Austin Fraser GitHub LinkedIn
Stephany Ho GitHub LinkedIn
Winston Ludlam GitHub LinkedIn
Yiqun Zheng GitHub LinkedIn