|
| 1 | +<div style="text-align: center"> |
| 2 | +<img src="/mlflow-site/public/assets/mlflow-js-logo-whitebg.png" width=600px;"/></div> |
1 | 3 |
|
| 4 | +<br> |
| 5 | + |
| 6 | +## About |
| 7 | + |
| 8 | +[](/LICENSE) |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +[](/CONTRIBUTING.md) |
| 13 | + |
| 14 | +<i>MLflow.js</i> 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. |
| 15 | + |
| 16 | +<br> |
| 17 | + |
| 18 | +## Features |
| 19 | + |
| 20 | +<i>MLflow.js</i> 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: |
| 21 | + |
| 22 | +- Native JavaScript Integration: Seamlessly integrate MLflow capabilities within JavaScript codebases |
| 23 | +- Type Safety: Built with TypeScript for enhanced developer experience and code reliability |
| 24 | +- Modular Architecture: Designed with object-oriented structure that mirrors MLflow's concepts while being extensible and maintainable |
| 25 | +- Client-side ML Compatibility: Complements popular JavaScript libraries like TensorFlow.js, enabling ML deployment directly in the browser or client side |
| 26 | + |
| 27 | +<br> |
| 28 | + |
| 29 | +## Built with |
| 30 | + |
| 31 | +[](https://www.typescriptlang.org/) |
| 32 | +[](https://www.javascript.com/) |
| 33 | +[](https://react.dev/) |
| 34 | +[](https://nextjs.org/) |
| 35 | +[](https://tailwindcss.com/) |
| 36 | +[](https://eslint.org/) |
| 37 | +[](https://nodejs.org/en/) |
| 38 | +[](https://jestjs.io/) |
| 39 | +[](https://github.com/features/actions) |
| 40 | +[](https://www.docker.com/) |
| 41 | +[](https://www.npmjs.com/) |
| 42 | +[](https://vercel.com/) |
| 43 | + |
| 44 | +<br> |
| 45 | + |
| 46 | +## Prerequisites |
| 47 | + |
| 48 | +### Set Up MLflow |
| 49 | + |
| 50 | +Ensure MLflow is installed on your system: |
| 51 | + |
| 52 | +```bash |
| 53 | +pip install mlflow |
| 54 | +``` |
| 55 | + |
| 56 | +**Note:** MLflow is compatible with MacOS. If you encounter 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`. |
| 57 | + |
| 58 | +### Start the MLflow Tracking Server |
| 59 | + |
| 60 | +To start the MLflow tracking server locally, use the following command: |
| 61 | + |
| 62 | +```bash |
| 63 | +mlflow ui --port 5001 |
| 64 | +``` |
| 65 | + |
| 66 | +This will launch the MLflow UI on your local machine at `http://localhost:5001`. |
| 67 | + |
| 68 | +### Alternative Docker approach to the MLflow Tracking Server |
| 69 | + |
| 70 | +Install [Docker Desktop](https://www.docker.com/). |
| 71 | + |
| 72 | +To start the MLflow tracking server locally, use the following commands: |
| 73 | + |
| 74 | +```bash |
| 75 | +docker pull ghcr.io/mlflow/mlflow |
| 76 | +docker run -p 5001:5001 ghcr.io/mlflow/mlflow:latest mlflow server --host 0.0.0.0 --port 5001 |
| 77 | +``` |
| 78 | + |
| 79 | +This will launch the MLflow UI on your local machine at `http://localhost:5001`. |
| 80 | + |
| 81 | +### Development Setup |
| 82 | + |
| 83 | +For development environment setup instructions, please refer to our [Contributing Guide](/CONTRIBUTING.md). |
| 84 | + |
| 85 | +<br> |
| 86 | + |
| 87 | +## Quickstart |
| 88 | + |
| 89 | +### Install <i>mlflow.js</i> Library |
| 90 | + |
| 91 | +To use the <i>mlflow.js</i> library, navigate to your project directory and install it via npm: |
| 92 | + |
| 93 | +```bash |
| 94 | +npm install mlflow-js |
| 95 | +``` |
| 96 | + |
| 97 | +### Usage Example |
| 98 | + |
| 99 | +Here is an example of how to use the <i>mlflow.js</i> library to create an experiment: |
| 100 | + |
| 101 | +```JavaScript |
| 102 | +import Mlflow from 'mlflow-js'; |
| 103 | + |
| 104 | +// Initialize the MLflow client |
| 105 | +const mlflow = new Mlflow(process.env.MLFLOW_TRACKING_URI); |
| 106 | + |
| 107 | +// Create a new experiment |
| 108 | +async function createExperiment(){ |
| 109 | + await mlflow.createExperiment('My Experiment'); |
| 110 | + console.log('Experiment created successfully'); |
| 111 | +} |
| 112 | + |
| 113 | +createExperiment(); |
| 114 | + |
| 115 | +``` |
| 116 | + |
| 117 | +<br> |
| 118 | + |
| 119 | +## Resources |
| 120 | + |
| 121 | +- [Example Repository](https://github.com/oslabs-beta/mlflow-js/tree/dev/mlflow/examples) - Practical examples demonstrating <i>MLflow.js</i>'s functionality |
| 122 | +- [Quick Tutorials](https://www.mlflow-js.org/) - Video walkthrough of the example code with MLflow UI |
| 123 | +- [Read our Medium Article](link) - Overview on why we built <i>MLflow.js</i> and how it enhances ML workflows in JavaScript environments |
| 124 | + |
| 125 | +<br> |
| 126 | + |
| 127 | +## Documentation |
| 128 | + |
| 129 | +Official documentation for <i>MLflow.js</i> can be found <a href="https://www.mlflow-js.org/documentation">here</a>. |
| 130 | + |
| 131 | +### High-Level Workflows |
| 132 | + |
| 133 | +**Experiment Manager** |
| 134 | + |
| 135 | +- 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 |
| 136 | +- 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 |
| 137 | +- experimentSummary - Returns an array of all the passed-in experiment's runs, sorted according to the passed-in metric |
| 138 | + |
| 139 | +**Run Manager** |
| 140 | + |
| 141 | +- cleanupRuns - Deletes runs that do not meet certain criteria and return an object of deleted runs and details |
| 142 | +- copyRun - Copies a run from one experiment to another (without artifacts and models) |
| 143 | + |
| 144 | +**Model Manager** |
| 145 | + |
| 146 | +- createRegisteredModelWithVersion - Creates a new registered model and the first version of that model |
| 147 | +- updateRegisteredModelDescriptionAndTag - Updates a registered model's description and tags |
| 148 | +- updateAllLatestModelVersion - Updates the latest version of the specified registered model's description, adds a new alias, and tag key/value for the latest version |
| 149 | +- setLatestModelVersionTag - Adds a new tag key/value for the latest version of the specified registered model |
| 150 | +- setLatestModelVersionAlias - Adds an alias for the latest version of the specified registered model |
| 151 | +- updateLatestModelVersion - Updates the description of the latest version of a registered model |
| 152 | +- 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 |
| 153 | +- deleteLatestModelVersion - Deletes the latest version of the specified registered model |
| 154 | +- createModelFromRunWithBestMetric - Creates a new model with the specified model name from the run with the best specified metric |
| 155 | + |
| 156 | +<br> |
| 157 | + |
| 158 | +## Contributing |
| 159 | + |
| 160 | +We welcome contributions to <i>MLflow.js</i>! Please see our [Contributing Guide](/CONTRIBUTING.md) for more details on how to get started. |
| 161 | + |
| 162 | +<br> |
| 163 | + |
| 164 | +## License |
| 165 | + |
| 166 | +[MIT License](/LICENSE) |
| 167 | + |
| 168 | +<br> |
| 169 | + |
| 170 | +## Meet The Team |
| 171 | + |
| 172 | +| Name | GitHub | LinkedIn | |
| 173 | +| -------------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 174 | +| Yiqun Zheng | [](https://github.com/yiqunzheng) | [](https://www.linkedin.com/in/yiqunzheng/) | |
| 175 | +| Kyler Chiago | [](https://github.com/Kyler-Chiago) | [](https://www.linkedin.com/in/kyler-chiago/) | |
| 176 | +| Austin Fraser | [](https://github.com/austinbfraser) | [](http://www.linkedin.com/in/austin-fraser) | |
| 177 | +| Stephany Ho | [](https://github.com/seneyu) | [](https://www.linkedin.com/in/stephanyho/) | |
| 178 | +| Winston Ludlam | [](https://github.com/winjolu/) | [](https://www.linkedin.com/in/wjludlam/) | |
0 commit comments