G
Mlflow.js Methods
Experiment Client Methods
Create Experiment
Search Experiments
Get Experiment
Get Experiment By Name
Delete Experiment
Restore Experiment
Update Experiment
Set Experiment Tag
Run Client Methods
Create Run
Delete Run
Restore Run
Get Run
Update Run
Log Metric
Log Batch
Log Model
Log Inputs
Set Tag
Delete Tag
Log Param
Get Metric History
Search Runs
List Artifacts
Model Registry Client Methods
Create Registered Model
Get Registered Model
Rename Registered Model
Update Registered Model
Delete Registered Model
Get Latest Model Versions
Search Registered Models
Set Registered Model Tag
Delete Registered Model Tag
Set Registered Model Alias
Delete Registered Model Alias
Get Model Version By Alias
Model Version Client Methods
Create Model Version
Get Model Version
Update Model Version
Search Model Versions
Get Download URI for Model Version Artifacts
Transition Model Version Stage
Set Model Version Tag
Delete Model Version Tag
Delete Model Version
Experiment Manager Methods
Run Existing Experiment
Run New Experiment
Experiment Summary
Run Manager Methods
Cleanup Runs
Copy Run
Model Manager Methods
Create Registered Model With Version
Update Registered Model Description And Tag
Update All Latest Model Version
Set Latest Model Version Tag
Set Latest Model Version Alias
Update Latest Model Version
Update All Model Version
Delete Latest Model Version
Create Model From Run With Best Metric
Methods
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.
Experiment Client Methods
Create Experiment
Creates an experiment with a name. Returns the ID of the newly created experiment.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<string>
Returns the ID of the newly created experiment in an object.
Get Experiment
Gets metadata for an experiment, querying by experiment ID. This method works on deleted experiments.
Parameters
Field Name
Type
Description
experiment_id
STRING
ID of the associated experiment. (required)
Returns
Type
Description
Promise<object>
Returns object containing the matched experiment.
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
Field Name
Type
Description
experiment_name
STRING
ID of the associated experiment. (required)
Returns
Type
Description
Promise<object>
Returns object containing the matched experiment.
Delete Experiment
Marks an experiment for deletion.
Parameters
Field Name
Type
Description
experiment_id
STRING
ID of the associated experiment. (required)
Returns
Type
Description
Promise<void>
No response.
Restore Experiment
Restores an experiment marked for deletion.
Parameters
Field Name
Type
Description
experiment_id
STRING
ID of the associated experiment. (required)
Returns
Type
Description
Promise<void>
No response.
Update Experiment
Updates experiment name.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Set Experiment Tag
Sets 1 or more tags on an experiment.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Run Client Methods
Create Run
Creates a new run within an experiment.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
The newly created run object.
Delete Run
Marks a run for deletion.
Parameters
Field Name
Type
Description
run_id
STRING
ID of the run to delete. (required)
Returns
Type
Description
Promise<void>
No response.
Restore Run
Restores a deleted run.
Parameters
Field Name
Type
Description
run_id
STRING
ID of the run to restore. (required)
Returns
Type
Description
Promise<void>
No response.
Get Run
Gets metadata, metrics, params, and tags for a run.
Parameters
Field Name
Type
Description
run_id
STRING
ID of the run to fetch. (required)
Returns
Type
Description
Promise<object>
Run metadata (name, start time, etc) and data (metrics, params, and tags).
Update Run
Updates run metadata.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
Updated metadata of the run.
Log Metric
Logs a metric for a run.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Log Batch
Logs a batch of metrics, params, and tags for a run.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Log Model
Logs a model.
Parameters
Field Name
Type
Description
run_id
STRING
ID of the run to log under. (required)
model_json
STRING
MLmodel file in json format. (required)
Returns
Type
Description
Promise<void>
No response.
Log Inputs
Logs inputs.
Parameters
Field Name
Type
Description
run_id
STRING
ID of the run to log under. (required)
datasets
ARRAY<{tags?: { key: string, value: string }[], dataset: {name: string, digest: string, source_type: string, source: string, schema?: string, profile?: string}}>
Dataset inputs. (required)
Returns
Type
Description
Promise<void>
No response.
Set Tag
Sets a tag on a run.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Delete Tag
Deletes a tag on a run.
Parameters
Field Name
Type
Description
run_id
STRING
ID of the run that the tag was logged under. (required)
key
STRING
Name of the tag. (required)
Returns
Type
Description
Promise<void>
No response.
Log Param
Logs a param used for a run.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Get Metric History
Gets a list of all values for the specified metric for a given run.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
All logged values for this metric, along with a token that can be used to issue a query for the next page of metric history values. A missing token indicates that no additional metrics are available to fetch.
List Artifacts
Lists artifacts for a run.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
Root artifact directory for the run, file location and metadata for artifacts, and a token that can be used to retrieve the next page of artifact results. A missing token indicates that no additional artifacts are available to fetch.
Model Registry Client Methods
Create Registered Model
Creates a new registered model.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
The created registered model object.
Get Registered Model
Retrieves a registered model by name.
Parameters
Field Name
Type
Description
name
STRING
The name of the registered model to retrieve. (required)
Returns
Type
Description
Promise<object>
The registered model object.
Rename Registered Model
Renames a registered model.
Parameters
Field Name
Type
Description
name
STRING
The current name of the registered model. (required)
newName
STRING
The new name for the registered model. (required)
Returns
Type
Description
Promise<object>
The updated registered model object.
Update Registered Model
Updates a registered model's description.
Parameters
Field Name
Type
Description
name
STRING
The name of the registered model to update. (required)
description
STRING
The new description for the model.
Returns
Type
Description
Promise<object>
The updated registered model object.
Delete Registered Model
Deletes a registered model.
Parameters
Field Name
Type
Description
name
STRING
The name of the registered model to delete. (required)
Returns
Type
Description
Promise<void>
No response.
Get Latest Model Versions
Gets the latest versions of a registered model.
Parameters
Field Name
Type
Description
name
STRING
The name of the registered model. (required)
stages
ARRAY<STRING>
Optional array of stages to filter the versions by.
Returns
Type
Description
Promise<Array<object>>
An array of the latest model versions.
Set Registered Model Tag
Sets a tag on a registered model.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Delete Registered Model Tag
Deletes a tag from a registered model.
Parameters
Field Name
Type
Description
name
STRING
The name of the registered model. (required)
key
STRING
The key of the tag to delete. (required)
Returns
Type
Description
Promise<void>
No response.
Set Registered Model Alias
Sets an alias for a specific version of a registered model.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Delete Registered Model Alias
Deletes an alias from a registered model.
Parameters
Field Name
Type
Description
name
STRING
The name of the registered model. (required)
alias
STRING
The alias to delete. (required)
Returns
Type
Description
Promise<void>
No response.
Get Model Version By Alias
Retrieves a model version using its alias.
Parameters
Field Name
Type
Description
name
STRING
The name of the registered model. (required)
alias
STRING
The alias of the model version to retrieve. (required)
Returns
Type
Description
Promise<object>
The model version object.
Model Version Client Methods
Create Model Version
Creates a new version of a model.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
The created model version object.
Get Model Version
Gets the specified version of the model.
Parameters
Field Name
Type
Description
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to fetch. (required)
Returns
Type
Description
Promise<object>
The model version object.
Update Model Version
Updates a specific model version.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
The updated model version object.
Get Download URI for Model Version Artifacts
Retrieves the download uri for model version artifacts.
Parameters
Field Name
Type
Description
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to fetch the uri for. (required)
Returns
Type
Description
Promise<string>
The uri for downloading the model version artifacts.
Transition Model Version Stage
Transitions a model version to a different stage.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
The updated model version object after the stage transition.
Set Model Version Tag
Sets a tag on a specific model version.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Delete Model Version Tag
Deletes a tag from a specific model version.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Delete Model Version
Deletes a specific model version.
Parameters
Field Name
Type
Description
modelName
STRING
The name of the registered model. (required)
version
STRING
The version number of the model to delete. (required)
Returns
Type
Description
Promise<void>
No response.
Experiment Manager Methods
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
Field Name
Type
Description
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
Type
Description
Promise<object>
The created run object with updated metadata.
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
Field Name
Type
Description
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
Type
Description
Promise<object>
The created run object with updated metadata.
Experiment Summary
Returns an array of all the passed-in experiment's runs, sorted according to the passed-in metric.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<Array<object>>
An array of run objects belonging to the passed-in experiment ID, sorted according to the primary metric.
Run Manager Methods
Cleanup Runs
Deletes runs that do not meet certain criteria and return deleted runs.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
An object of deleted runs.
Copy Run
Copies run from one experiment to another without artifacts and models. Artifacts and models detail tagged in new run as reference.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
An object detail of the copied run.
Model Manager Methods
Create Registered Model With Version
Creates a new registered model and creates the first version of that model.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
The updated model version object.
Update Registered Model Description And Tag
Updates a registered model's description and tag.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<object>
The updated registered model object.
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
Field Name
Type
Description
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
Type
Description
Promise<object>
The updated model version object.
Set Latest Model Version Tag
Adds a new tag key/value for the latest version of the specified registered model.
Parameters
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.
Set Latest Model Version Alias
Adds an alias for the latest version of the specified registered model.
Parameters
Field Name
Type
Description
name
STRING
Name of the registered model. (required)
alias
STRING
Name of the alias. (required)
Returns
Type
Description
Promise<void>
No response.
Update Latest Model Version
Updates the description of the latest version of a registered model.
Parameters
Field Name
Type
Description
name
STRING
Name of the registered model. (required)
description
STRING
The description for the model version. (required)
Returns
Type
Description
Promise<object>
The updated model version object.
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
Field Name
Type
Description
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
Type
Description
Promise<object>
The updated model version object.
Delete Latest Model Version
Deletes the latest version of the specified registered model.
Parameters
Field Name
Type
Description
name
STRING
The model name. (required)
Returns
Type
Description
Promise<void>
No response.
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
Field Name
Type
Description
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
Type
Description
Promise<void>
No response.