The Mlflow.js library implements a JavaScript interface to Mlflow's functionality by utilizing the MLflow REST API. For detailed information about the underlying API endpoints, please refer the official MLflow documentation here.Create Experiment
Creates an experiment with a name. Returns the ID of the newly created experiment.
Parameters
name
STRING
Experiment name. (required)
artifact_location
STRING
Optional location where all artifacts for the experiment are stored.
tags
ARRAY<{key: string, value: string}>
Optional collection of tags to set on the experiment.
Returns
Search Experiments
Searches experiments using a filter expression over experiment attributes and tags.
Parameters
filter
STRING
A filter expression over experiment attributes and tags that allows returning a subset of experiments. (required)
max_results
NUMBER
Maximum number of experiments desired. (required)
page_token
STRING
Optional token indicating the page of experiments to fetch.
order_by
ARRAY<STRING>
Optional list of columns for ordering search results.
view_type
STRING
Optional qualifier for type of experiments to be returned.
Returns
Get Experiment
Gets metadata for an experiment, querying by experiment ID. This method works on deleted experiments.
Parameters
experiment_id
STRING
ID of the associated experiment. (required)
Returns
Get Experiment By Name
Gets metadata for an experiment, querying by experiment name. This endpoint will return deleted experiments, but prefers the active experiment if an active and deleted experiment share the same name.
Parameters
experiment_name
STRING
ID of the associated experiment. (required)
Returns
Delete Experiment
Marks an experiment for deletion.
Parameters
experiment_id
STRING
ID of the associated experiment. (required)
Returns
Restore Experiment
Restores an experiment marked for deletion.
Parameters
experiment_id
STRING
ID of the associated experiment. (required)
Returns
Update Experiment
Updates experiment name.
Parameters
experiment_id
STRING
ID of the associated experiment. (required)
new_name
STRING
The experiment’s name is changed to the new name. The new name must be unique. (required)
Returns
Set Experiment Tag
Sets 1 or more tags on an experiment.
Parameters
experiment_id
STRING
ID of the experiment under which to log the tag. (required)
key
STRING
Name of the tag. (required)
value
STRING
String value of the tag being logged. (required)
Returns
Create Run
Creates a new run within an experiment.
Parameters
experiment_id
STRING
ID of the associated experiment. (required)
run_name
STRING
Name of the run.
start_time
NUMBER
Unix timestamp in milliseconds of when the run started.
tags
ARRAY<{ key: string; value: string }>
Additional metadata for the run.
Returns
Delete Run
Marks a run for deletion.
Parameters
run_id
STRING
ID of the run to delete. (required)
Returns
Restore Run
Restores a deleted run.
Parameters
run_id
STRING
ID of the run to restore. (required)
Returns
Get Run
Gets metadata, metrics, params, and tags for a run.
Parameters
run_id
STRING
ID of the run to fetch. (required)
Returns
Update Run
Updates run metadata.
Parameters
run_id
STRING
ID of the run to update. (required)
status
STRING
Updated status of the run.
end_time
NUMBER
Unix timestamp in milliseconds of when the run ended.
run_name
STRING
Updated name of the run.
Returns
Log Metric
Logs a metric for a run.
Parameters
run_id
STRING
ID of the run under which to log the metric. (required)
key
STRING
Name of the metric. (required)
value
NUMBER
Double value of the metric being logged. (required)
timestamp
NUMBER
Unix timestamp in milliseconds at the time metric was logged. (required)
step
NUMBER
Step at which to log the metric.
Returns
Log Batch
Logs a batch of metrics, params, and tags for a run.
Parameters
run_id
STRING
ID of the run to log under. (required)
metrics
ARRAY<{ key: string; value: number; timestamp: number; step?: number }>
Metrics to log.
params
ARRAY<{ key: string; value: string }>
Params to log.
tags
ARRAY<{ key: string; value: string }>
Tags to log.
Returns
Log Model
Logs a model.
Parameters
run_id
STRING
ID of the run to log under. (required)
model_json
STRING
MLmodel file in json format. (required)
Returns
Set Tag
Sets a tag on a run.
Parameters
run_id
STRING
ID of the run under which to log the tag. (required)
key
STRING
Name of the tag. (required)
value
STRING
String value of the tag being logged. (required)
Returns
Delete Tag
Deletes a tag on a run.
Parameters
run_id
STRING
ID of the run that the tag was logged under. (required)
key
STRING
Name of the tag. (required)
Returns
Log Param
Logs a param used for a run.
Parameters
run_id
STRING
ID of the run under which to log the param. (required)
key
STRING
Name of the param. (required)
value
STRING
String value of the param being logged. (required)
Returns
Get Metric History
Gets a list of all values for the specified metric for a given run.
Parameters
run_id
STRING
ID of the run from which to fetch metric values. (required)
metric_key
STRING
Name of the metric. (required)
page_token
STRING
Token indicating the page of metric history to fetch.
max_results
NUMBER
Maximum number of logged instances of a metric for a run to return per call.
Returns
Search Runs
Searches for runs that satisfy expressions.
Parameters
experiment_ids
ARRAY<STRING>
List of experiment IDs to search over.
filter
STRING
A filter expression over params, metrics, and tags.
run_view_type
STRING
Whether to display only active, only deleted, or all runs.
max_results
NUMBER
Maximum number of runs desired.
order_by
ARRAY<STRING>
List of columns to be ordered by.
page_token
STRING
Token that can be used to retrieve the next page of run results.
Returns
List Artifacts
Lists artifacts for a run.
Parameters
run_id
STRING
ID of the run whose artifacts to list. (required)
path
STRING
Filter artifacts matching this path (a relative path from the root artifact directory).
page_token
STRING
Token indicating the page of artifact results to fetch.
Returns
Create Registered Model
Creates a new registered model.
Parameters
name
STRING
The name of the model to register. (required)
tags
ARRAY<{key: string, value: string}>
Optional tags for the model.
description
STRING
Optional description for the model.
Returns
Get Registered Model
Retrieves a registered model by name.
Parameters
name
STRING
The name of the registered model to retrieve. (required)
Returns
Rename Registered Model
Renames a registered model.
Parameters
name
STRING
The current name of the registered model. (required)
newName
STRING
The new name for the registered model. (required)
Returns
Update Registered Model
Updates a registered model's description.
Parameters
name
STRING
The name of the registered model to update. (required)
description
STRING
The new description for the model.
Returns
Delete Registered Model
Deletes a registered model.
Parameters
name
STRING
The name of the registered model to delete. (required)
Returns
Get Latest Model Versions
Gets the latest versions of a registered model.
Parameters
name
STRING
The name of the registered model. (required)
stages
ARRAY<STRING>
Optional array of stages to filter the versions by.
Returns
Search Registered Models
Searches for registered models based on filter criteria.
Parameters
filter
STRING
Optional filter string to apply to the search.
maxResults
NUMBER
Optional maximum number of results to return.
orderBy
ARRAY<STRING>
Optional array of fields to order the results by.
pageToken
STRING
Optional token for pagination.
Returns
Set Registered Model Tag
Sets a tag on a registered model.
Parameters
name
STRING
The name of the registered model. (required)
key
STRING
The key of the tag. (required)
value
STRING
The value of the tag. (required)
Returns
Delete Registered Model Tag
Deletes a tag from a registered model.
Parameters
name
STRING
The name of the registered model. (required)
key
STRING
The key of the tag to delete. (required)
Returns
Set Registered Model Alias
Sets an alias for a specific version of a registered model.
Parameters
name
STRING
The name of the registered model. (required)
alias
STRING
The alias to set. (required)
version
STRING
The version number to associate with the alias. (required)
Returns
Delete Registered Model Alias
Deletes an alias from a registered model.
Parameters
name
STRING
The name of the registered model. (required)
alias
STRING
The alias to delete. (required)
Returns
Get Model Version By Alias
Retrieves a model version using its alias.
Parameters
name
STRING
The name of the registered model. (required)
alias
STRING
The alias of the model version to retrieve. (required)
Returns
Create Model Version
Creates a new version of a model.
Parameters
modelName
STRING
The name of the registered model. (required)
source
STRING
The source path where the model artifacts are stored. (required)
run_id
STRING
The id of the run that generated this version. (optional)
tags
ARRAY
Tags of key/value pairs for the model version. (optional)
run_link
STRING
MLflow run link for the run that generated this model version. (optional)
description
STRING
Description of the model version. (optional)
Returns
Get Model Version
Gets the specified version of the model.
Parameters
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to fetch. (required)
Returns
Update Model Version
Updates a specific model version.
Parameters
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to update. (required)
description
STRING
The description of the model version. (optional)
Returns
Search Model Versions
Searches for model versions based on provided filters.
Parameters
filter
STRING
The filter criteria for searching model versions. (optional)
maxResults
NUMBER
The maximum number of results to return. (optional)
order_by
ARRAY
List of columns to be ordered by. (optional)
page_token
STRING
Pagination token to go to the next page based on previous search query. (optional)
Returns
Get Download URI for Model Version Artifacts
Retrieves the download uri for model version artifacts.
Parameters
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to fetch the uri for. (required)
Returns
Transition Model Version Stage
Transitions a model version to a different stage.
Parameters
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to transition. (required)
stage
STRING
The stage to transition the model version to (e.g., "staging", "production"). (required)
archive_existing_versions
BOOLEAN
Flag to archive existing versions in that stage. (required)
Returns
Set Model Version Tag
Sets a tag on a specific model version.
Parameters
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to tag. (required)
key
STRING
The key of the tag. (required)
value
STRING
The value of the tag. (required)
Returns
Delete Model Version Tag
Deletes a tag from a specific model version.
Parameters
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to untag. (required)
key
STRING
The key of the tag to delete. (required)
Returns
Delete Model Version
Deletes a specific model version.
Parameters
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to delete. (required)
Returns
Run Existing Experiment
Full workflow of creating, naming, and starting a run under an existing experiment, logging metrics, params, tags, logging the model, and finishing the run.
Parameters
experiment_id
STRING
ID of the experiment under which to log the run. (required)
run_name
STRING
Name of the run to be created and run. (optional)
metrics
ARRAY
The metrics to log (up to 1000 metrics). (optional)
params
ARRAY
The params to log (up to 100 params). (optional)
tags
ARRAY
The tags to log (up to 100 tags). (optional)
model
OBJECT
The ML model data to log to the run, represented as a Javascript object. (optional)
Returns
Run New Experiment
Full workflow of creating, naming, and starting a run under a new experiment, logging metrics, params, tags, logging the model, and finishing the run.
Parameters
experiment_name
STRING
Name of the experiment under which to log the run. (required)
run_name
STRING
Name of the run to be created and run. (optional)
metrics
ARRAY
The metrics to log (up to 1000 metrics). (optional)
params
ARRAY
The params to log (up to 100 params). (optional)
tags
ARRAY
The tags to log (up to 100 tags). (optional)
model
OBJECT
The ML model data to log to the run, represented as a Javascript object. (optional)
Returns
Experiment Summary
Returns an array of all the passed-in experiment's runs, sorted according to the passed-in metric.
Parameters
experiment_id
STRING
The experiment whose runs will be evaluated. (required)
primaryMetric
STRING
The metric by which the results array will be sorted. (required)
order
STRING or NUMBER
Sort order for the array: pass in 'DESC' or 1 for descending; 'ASC' or -1 for ascending. (optional)
Returns
Cleanup Runs
Deletes runs that do not meet certain criteria and return deleted runs.
Parameters
experiment_ids
ARRAY<STRING>
The IDs of the associated experiments. (required)
query_string
STRING
SQL-like query string to filter runs to keep. (required)
metric_key
STRING
The metric key for comparison. (required)
dryRun
BOOLEAN
If true, only simulate the deletion. Defaults to true. (optional)
Returns
Copy Run
Copies run from one experiment to another without artifacts and models. Artifacts and models detail tagged in new run as reference.
Parameters
run_id
STRING
The ID of the run to be copied. (required)
target_experiment_id
STRING
The ID of the target experiment. (required)
run_name
STRING
The name of the new run in target experiment.
Returns
Create Registered Model With Version
Creates a new registered model and creates the first version of that model.
Parameters
name
STRING
Name of the registered model. (required)
versionSource
STRING
URI indicating the location of the model artifacts. (required)
versionRun_id
STRING
MLflow run ID for correlation, if versionSource was generated by an experiment run in MLflow tracking server. (required)
Returns
Update Registered Model Description And Tag
Updates a registered model's description and tag.
Parameters
name
STRING
Name of the registered model. (required)
tagKey
STRING
Name of the tag. (required)
tagValue
STRING
String value of the tag being logged. (required)
description
STRING
Description of the registered model. (optional)
Returns
Update All Latest Model Version
Updates the latest version of the specified registered model's description and adds a new alias and tag key/value.
Parameters
name
STRING
Name of the registered model. (required)
alias
STRING
Name of the alias. (required)
description
STRING
The description for the model version. (required)
key
STRING
Name of the tag. (required)
value
STRING
Name of the value of the tag being logged. (required)
Returns
Set Latest Model Version Tag
Adds a new tag key/value for the latest version of the specified registered model.
Parameters
name
STRING
Name of the registered model. (required)
key
STRING
Name of the tag. (required)
value
STRING
Name of the value of the tag being logged. (required)
Returns
Set Latest Model Version Alias
Adds an alias for the latest version of the specified registered model.
Parameters
name
STRING
Name of the registered model. (required)
alias
STRING
Name of the alias. (required)
Returns
Update Latest Model Version
Updates the description of the latest version of a registered model.
Parameters
name
STRING
Name of the registered model. (required)
description
STRING
The description for the model version. (required)
Returns
Update All Model Version
Updates the specified version of the specified registered model's description and adds a new alias and tag key/value for that specified version.
Parameters
name
STRING
Name of the registered model. (required)
version
STRING
Model version number. (required)
alias
STRING
Name of the alias. (required)
key
STRING
Name of the tag. (required)
value
STRING
Name of the value of the tag being logged. (required)
description
STRING
The description for the model version. (required)
Returns
Delete Latest Model Version
Deletes the latest version of the specified registered model.
Parameters
name
STRING
The model name. (required)
Returns
Create Model From Run With Best Metric
Creates a new model with the specified model name from the run with the best specified metric.
Parameters
experiment_ids
ARRAY
An array containing an experiment id. (required)
filterMetric
STRING
The name of the metric that we're filtering by. (required)
metricMinOrMax
STRING
A string specifying if we want the minimum or maximum value of the specified metric. Can be either "min" or "max". (required)
modelName
STRING
The name of the new model that will be created. (required)
Returns