https://github.com/open-source-labs/mlflow-js
A JavaScript client library for MLflow that streamlines machine learning lifecycle management in web environments.
https://github.com/open-source-labs/mlflow-js
ai data-science javascript machine-learning mlflow mlops node-js typescript
Last synced: 10 months ago
JSON representation
A JavaScript client library for MLflow that streamlines machine learning lifecycle management in web environments.
- Host: GitHub
- URL: https://github.com/open-source-labs/mlflow-js
- Owner: open-source-labs
- License: mit
- Created: 2024-08-22T01:00:28.000Z (almost 2 years ago)
- Default Branch: dev
- Last Pushed: 2025-07-31T00:53:45.000Z (11 months ago)
- Last Synced: 2025-08-09T10:58:59.616Z (10 months ago)
- Topics: ai, data-science, javascript, machine-learning, mlflow, mlops, node-js, typescript
- Language: TypeScript
- Homepage: https://mlflow-js.org/
- Size: 4.51 MB
- Stars: 36
- Watchers: 0
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
## About
[](/LICENSE)



[](/CONTRIBUTING.md)
MLflow.js is an open-source JavaScript library that helps developers track machine learning experiments and manage models with MLflow, providing functionalities for machine learning lifecycle in JavaScript/TypeScript environments.
## Features
MLflow.js covers all REST API endpoints under MLflow's Tracking Server and Model Registry. Moreover, high-level abstractions have been developed to facilitate developers' common ML workflows. It provides some key advantages:
- Native JavaScript Integration: Seamlessly integrate MLflow capabilities within JavaScript codebases
- Type Safety: Built with TypeScript for enhanced developer experience and code reliability
- Modular Architecture: Designed with object-oriented structure that mirrors MLflow's concepts while being extensible and maintainable
- Client-side ML Compatibility: Complements popular JavaScript libraries like TensorFlow.js, enabling ML deployment directly in the browser or client side
## Built with
[](https://www.typescriptlang.org/)
[](https://www.javascript.com/)
[](https://react.dev/)
[](https://nextjs.org/)
[](https://tailwindcss.com/)
[](https://eslint.org/)
[](https://nodejs.org/en/)
[](https://jestjs.io/)
[](https://github.com/features/actions)
[](https://www.docker.com/)
[](https://www.npmjs.com/)
[](https://vercel.com/)
## Prerequisites
### Set Up MLflow
Ensure MLflow is installed on your system:
```bash
pip install mlflow
```
For MacOS users, we recommend creating and activating a Python virtual environment to avoid common installation issues and keep dependencies isolated:
```bash
python3 -m venv mlflow-venv
source mlflow-venv/bin/activate
pip install mlflow
```
Remember to activate your virtual environment (`source mlflow-venv/bin/activate`) each time you open a new terminal before running MLflow commands.
### Start the MLflow Tracking Server
After activating the virtual environment, start the MLflow tracking server locally, use the following command:
```bash
mlflow ui --port 5001
```
This will launch the MLflow UI on your local machine at `http://localhost:5001`.
### Alternative Docker approach to the MLflow Tracking Server
Install [Docker Desktop](https://www.docker.com/).
To start the MLflow tracking server locally, use the following commands:
```bash
docker pull ghcr.io/mlflow/mlflow
docker run -p 5001:5001 ghcr.io/mlflow/mlflow:latest mlflow server --host 0.0.0.0 --port 5001
```
This will launch the MLflow UI on your local machine at `http://localhost:5001`.
### Development Setup
For development environment setup instructions, please refer to our [Contributing Guide](/CONTRIBUTING.md).
## Quickstart
### Install mlflow.js Library
To use the mlflow.js library, navigate to your project directory and install it via npm:
```bash
npm install mlflow-js
```
### Usage Example
Here is an example of how to use the mlflow.js library to create an experiment:
```JavaScript
import Mlflow from 'mlflow-js';
// Initialize the MLflow client
const mlflow = new Mlflow(process.env.MLFLOW_TRACKING_URI);
// Create a new experiment
async function createExperiment(){
await mlflow.createExperiment('My Experiment');
console.log('Experiment created successfully');
}
createExperiment();
```
## Resources
- [Example Repository](https://github.com/oslabs-beta/mlflow-js/tree/dev/mlflow/examples) - Practical examples demonstrating MLflow.js's functionality
- [Quick Tutorials](https://www.mlflow-js.org/) - Video walkthrough of the example code with MLflow UI
- [Read our Medium Article](link) - Overview on why we built MLflow.js and how it enhances ML workflows in JavaScript environments
## Documentation
Official documentation for MLflow.js can be found here.
### High-Level 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, logging metrics, params, tags, and the model, and finishing the run
- experimentSummary - Returns an array of all the passed-in experiment's runs, sorted according 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 first 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 for the latest version
- setLatestModelVersionTag - Adds a new tag key/value for the latest version of the specified registered model
- setLatestModelVersionAlias - Adds an alias for the latest version of the specified registered model
- updateLatestModelVersion - Updates the description of the latest version of a registered model
- updateAllModelVersion - Updates the specified version of the specified registered model's description and adds a new alias and tag key/value for that specified version
- deleteLatestModelVersion - Deletes the latest version of the specified registered model
- createModelFromRunWithBestMetric - Creates a new model with the specified model name from the run with the best specified metric
## Contributing
We welcome contributions to MLflow.js! See our [Contributing Guide](/CONTRIBUTING.md) for more details on how to get started.
**Note:** MLflow.js is community-based and maintained by a goodwill.
## License
[MIT License](/LICENSE)
## Meet The Team
| Name | GitHub | LinkedIn |
| -------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Yiqun Zheng | [](https://github.com/yiqunzheng) | [](https://www.linkedin.com/in/yiqunzheng/) |
| Kyler Chiago | [](https://github.com/Kyler-Chiago) | [](https://www.linkedin.com/in/kyler-chiago/) |
| Austin Fraser | [](https://github.com/austinbfraser) | [](http://www.linkedin.com/in/austin-fraser) |
| Stephany Ho | [](https://github.com/seneyu) | [](https://www.linkedin.com/in/stephanyho/) |
| Winston Ludlam | [](https://github.com/winjolu/) | [](https://www.linkedin.com/in/wjludlam/) |