MLflow tracking
Point any MLflow client at Kaimei: experiments, runs, metrics, params, tags, inputs, logged models and artifacts, over MLflow's own REST API.
Kaimei answers MLflow's tracking API, so code that logs to MLflow, mlflow.autolog() included, records Kaimei runs with no change but two environment variables (below).
The routes take and return MLflow's JSON (see MLflow's REST API); below, each says what Kaimei does with it. Tested with the MLflow 2 and MLflow 3 clients. API keys need the runs scope; a POST …/search is a read, and viewers and reviewers read only. Errors are MLflow's: {"error_code", "message"}.
- An experiment is a project. Experiment
"0"(Default) is the projectdefault, made when first used, and also shows runs that have no project. Other experiment ids are project ids; a name is looked up as a project's name, then its slug. Experiment names are at most 120 characters. - An MLflow run is a Kaimei run (
source: "mlflow"), one id for both APIs, so the dashboard, health checks, alerts and the training record work on it. RUNNING, FINISHED, FAILED and KILLED arerunning,finished,failedandstopped. An MLflow client sends no heartbeats, so its runs are never marked crashed. - Metrics are series, stored as a batch is, so the plan's points, points a second, storage and 10,000 series a run apply, and values are 32-bit floats. Params go into the config as text, and logging one again with another value is
INVALID_PARAMETER_VALUE. Tags are kept as sent;mlflow.runName,mlflow.note.contentandmlflow.parentRunIdare the run's name, notes and parent, and your own tags also show among its tags askey:value. - Inputs and models.
log-inputsadds the datasets to the run's declared datasets (the training record lists them);log-modeland MLflow 3's logged models recordcheckpointevents. - Artifacts are run files of kind
artifact, at most 16 MB each, uploaded and downloaded through the artifacts proxy; no multipart or presigned transfers. - Sizes. Keys hold at most 250 characters, a param's value 6,000, a run tag's 8,000 and an experiment tag's 20,000. A run's tags take 1 MB together, as do an experiment's tags, a logged model's tags and its params; a run's inputs take 4 MB and its outputs name at most 10,000 logged models;
log-batchtakes 1,000 metrics, 100 params and 100 tags. All of it counts in the training storage, past which writes areQUOTA_EXCEEDED. Searches'LIKEandILIKEpatterns hold at most 500 characters and 64 wildcards (%and_together); longer ones areINVALID_PARAMETER_VALUE. - Deleting is MLflow's soft delete: hidden from MLflow's searches and restorable; the run stays in Kaimei until deleted there.
- Not served: the model registry, traces, prompts and other MLflow routes answer
404 ENDPOINT_NOT_FOUND.
#Point MLflow at Kaimei
Set the tracking URI to Kaimei's /mlflow and the token to a Kaimei API key. MLflow sends the token as a bearer token; a key given as basic auth's password works too. Nothing else changes: mlflow.start_run, log_metric, log_artifact and mlflow.autolog() record Kaimei runs, which the dashboard draws and the health checks read as they arrive.
Runs logged to another MLflow server or an mlruns folder come over with kaimei import mlflow; see moving to Kaimei.
export MLFLOW_TRACKING_URI=https://api.kaimei.ai/mlflow
export MLFLOW_TRACKING_TOKEN=$KAIMEI_API_KEY
python train.py#Create an experiment
/mlflow/api/2.0/mlflow/experiments/createAPI key or sessionMakes a project with the experiment's name, within the plan's projects. A name in use is RESOURCE_ALREADY_EXISTS.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/create \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "fraud-models"}'{
"experiment_id": "prj_a82aa8dfcbeb66871420"
}curl "https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/get?experiment_id=prj_a82aa8dfcbeb66871420" \
-H "Authorization: Bearer $KAIMEI_API_KEY"{
"experiment": {
"experiment_id": "prj_a82aa8dfcbeb66871420",
"name": "fraud-models",
"artifact_location": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420",
"lifecycle_stage": "active",
"last_update_time": 1796472061080,
"creation_time": 1796472061078,
"tags": []
}
}#Get an experiment by name
/mlflow/api/2.0/mlflow/experiments/get-by-nameAPI key or sessionBy experiment_name: a project's name, then its slug.
curl "https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/get-by-name?experiment_name=nope" \
-H "Authorization: Bearer $KAIMEI_API_KEY"{
"error_code": "RESOURCE_DOES_NOT_EXIST",
"message": "Could not find experiment with name 'nope'"
}#Search experiments
/mlflow/api/2.0/mlflow/experiments/searchAPI key or sessionfilter on name, tags.<key> and times, order_by, view_type (ACTIVE_ONLY, DELETED_ONLY, ALL), max_results and page_token.curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/search \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filter": "name LIKE 'fraud%'", "max_results": 100}'{
"experiments": [
{
"experiment_id": "prj_a82aa8dfcbeb66871420",
"name": "fraud-models",
"artifact_location": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420",
"lifecycle_stage": "active",
"last_update_time": 1796472061080,
"creation_time": 1796472061078,
"tags": []
}
]
}#Search experiments (GET)
/mlflow/api/2.0/mlflow/experiments/searchAPI key or sessionThe same search with the parameters in the query string, as older clients send it.
curl "https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/search?max_results=100" \
-H "Authorization: Bearer $KAIMEI_API_KEY"#Rename an experiment
/mlflow/api/2.0/mlflow/experiments/updateAPI key or sessionRenames the project.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/update \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_id": "prj_a82aa8dfcbeb66871420", "new_name": "fraud-models-2027"}'{}#Delete an experiment
/mlflow/api/2.0/mlflow/experiments/deleteAPI key or sessionMarks it deleted for MLflow: hidden from searches, restorable, and the project stays. Experiment "0" can't be deleted.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/delete \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_id": "prj_a82aa8dfcbeb66871420"}'{}#Restore an experiment
/mlflow/api/2.0/mlflow/experiments/restoreAPI key or sessionUndoes a delete.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/restore \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_id": "prj_a82aa8dfcbeb66871420"}'{}#Tag an experiment
/mlflow/api/2.0/mlflow/experiments/set-experiment-tagAPI key or sessionKept beside the project; mlflow.note.content is its description.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/set-experiment-tag \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_id": "prj_a82aa8dfcbeb66871420", "key": "team", "value": "fraud"}'{}#Untag an experiment
/mlflow/api/2.0/mlflow/experiments/delete-experiment-tagAPI key or sessionRemoves the tag.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/experiments/delete-experiment-tag \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_id": "prj_a82aa8dfcbeb66871420", "key": "team"}'{}#Create a run
/mlflow/api/2.0/mlflow/runs/createAPI key or sessionStarts a Kaimei run in the experiment's project, counted like any run start. A nested run (mlflow.parentRunId) is not one more live run.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/create \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_id": "prj_a82aa8dfcbeb66871420", "run_name": "xgb-depth-6", "start_time": 1796472000000,
"tags": [{"key": "mlflow.source.name", "value": "train.py"}]}'{
"run": {
"info": {
"run_id": "run_799a8be2d318cb056edb",
"run_uuid": "run_799a8be2d318cb056edb",
"run_name": "xgb-depth-6",
"experiment_id": "prj_a82aa8dfcbeb66871420",
"user_id": "ada",
"status": "RUNNING",
"start_time": 1796472000000,
"artifact_uri": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420/run_799a8be2d318cb056edb/artifacts",
"lifecycle_stage": "active"
},
"data": {
"metrics": [],
"params": [],
"tags": [
{"key": "mlflow.runName", "value": "xgb-depth-6"},
{"key": "mlflow.source.name", "value": "train.py"}
]
},
"inputs": {
"dataset_inputs": [],
"model_inputs": []
},
"outputs": {
"model_outputs": []
}
}
}#Get a run
/mlflow/api/2.0/mlflow/runs/getAPI key or sessionWith its latest metrics, params, tags, inputs and outputs.
curl "https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/get?run_id=run_799a8be2d318cb056edb" \
-H "Authorization: Bearer $KAIMEI_API_KEY"{
"run": {
"info": {
"run_id": "run_799a8be2d318cb056edb",
"run_uuid": "run_799a8be2d318cb056edb",
"run_name": "xgb-depth-6",
"experiment_id": "prj_a82aa8dfcbeb66871420",
"user_id": "ada",
"status": "RUNNING",
"start_time": 1796472000000,
"artifact_uri": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420/run_799a8be2d318cb056edb/artifacts",
"lifecycle_stage": "active"
},
"data": {
"metrics": [
{
"key": "val_auc",
"value": 0.91,
"timestamp": 1796472060000,
"step": 10,
"run_id": "run_799a8be2d318cb056edb"
}
],
"params": [
{"key": "max_depth", "value": "6"}
],
"tags": [
{"key": "mlflow.runName", "value": "xgb-depth-6"},
{"key": "mlflow.source.name", "value": "train.py"},
{"key": "team", "value": "fraud"}
]
},
"inputs": {
"dataset_inputs": [],
"model_inputs": []
},
"outputs": {
"model_outputs": []
}
}
}#Update a run
/mlflow/api/2.0/mlflow/runs/updateAPI key or sessionstatus, end_time and run_name. A status other than RUNNING finishes the Kaimei run.curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/update \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "status": "FINISHED", "end_time": 1796472900000}'{
"run_info": {
"run_id": "run_799a8be2d318cb056edb",
"run_uuid": "run_799a8be2d318cb056edb",
"run_name": "xgb-depth-6",
"experiment_id": "prj_a82aa8dfcbeb66871420",
"user_id": "ada",
"status": "FINISHED",
"start_time": 1796472000000,
"artifact_uri": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420/run_799a8be2d318cb056edb/artifacts",
"lifecycle_stage": "active",
"end_time": 1796472900000
}
}#Delete a run
/mlflow/api/2.0/mlflow/runs/deleteAPI key or sessionHidden from MLflow's searches and restorable; the run stays in Kaimei until deleted there.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/delete \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb"}'{}curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/restore \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb"}'{}#Search runs
/mlflow/api/2.0/mlflow/runs/searchAPI key or sessionRuns of the given experiments. filter compares metrics., params., tags. and attributes (status, run_name, start_time, …) with =, !=, >, >=, <, <=, LIKE, ILIKE, IN, NOT IN and IS [NOT] NULL, joined by AND. order_by, run_view_type, max_results (1 to 50,000, default 1,000) and page_token. LIKE is case-sensitive and ILIKE not; a pattern holds at most 500 characters and 64 wildcards.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/search \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_ids": ["prj_a82aa8dfcbeb66871420"], "filter": "metrics.val_auc > 0.9", "max_results": 10}'{
"runs": [
{
"info": {
"run_id": "run_799a8be2d318cb056edb",
"run_uuid": "run_799a8be2d318cb056edb",
"run_name": "xgb-depth-6",
"experiment_id": "prj_a82aa8dfcbeb66871420",
"user_id": "ada",
"status": "RUNNING",
"start_time": 1796472000000,
"artifact_uri": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420/run_799a8be2d318cb056edb/artifacts",
"lifecycle_stage": "active"
},
"data": {
"metrics": [
{
"key": "val_auc",
"value": 0.91,
"timestamp": 1796472060000,
"step": 10,
"run_id": "run_799a8be2d318cb056edb"
}
],
"params": [
{"key": "max_depth", "value": "6"}
],
"tags": [
{"key": "mlflow.runName", "value": "xgb-depth-6"},
{"key": "mlflow.source.name", "value": "train.py"},
{"key": "team", "value": "fraud"}
]
},
"inputs": {
"dataset_inputs": [],
"model_inputs": []
},
"outputs": {
"model_outputs": []
}
}
]
}#Log a metric
/mlflow/api/2.0/mlflow/runs/log-metricAPI key or sessionOne point of a series, with its step and timestamp.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/log-metric \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "key": "val_auc", "value": 0.91, "timestamp": 1796472060000, "step": 10}'{}#Log a param
/mlflow/api/2.0/mlflow/runs/log-parameterAPI key or sessionInto the run's config, as text.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/log-parameter \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "key": "max_depth", "value": "6"}'{}curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/set-tag \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "key": "team", "value": "fraud"}'{}curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/delete-tag \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "key": "team"}'{}#Log a batch
/mlflow/api/2.0/mlflow/runs/log-batchAPI key or sessionUp to 1,000 metrics, 100 params and 100 tags at once.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/log-batch \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "params": [{"key": "max_depth", "value": "6"}],
"metrics": [{"key": "val_auc", "value": 0.91, "timestamp": 1796472060000, "step": 10}]}'{}#Log a model
/mlflow/api/2.0/mlflow/runs/log-modelAPI key or sessionMLflow 2's log_model: kept in the mlflow.log-model.history tag, with a checkpoint event.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/log-model \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "model_json": "{…}"}'{}#Log inputs
/mlflow/api/2.0/mlflow/runs/log-inputsAPI key or sessionDatasets (and MLflow 3's models) the run used. Each dataset joins the run's declared datasets as {name, fingerprint: digest, context, source_type}.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/log-inputs \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "datasets": [{"dataset": {"name": "train", "digest": "9c1e0b", "source_type": "local"}, "tags": [{"key": "mlflow.data.context", "value": "training"}]}]}'{}#Log outputs
/mlflow/api/2.0/mlflow/runs/outputsAPI key or sessionMLflow 3's logged models a run produced, each recorded as a checkpoint event.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/runs/outputs \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"run_id": "run_799a8be2d318cb056edb", "models": [{"model_id": "m-cca3fc61efd08a5fe509f27aead561eb", "step": 10}]}'{}#Get a metric's history
/mlflow/api/2.0/mlflow/metrics/get-historyAPI key or sessionEvery point of one metric, by step: max_results up to 100,000 (default 25,000) and page_token.
curl "https://api.kaimei.ai/mlflow/api/2.0/mlflow/metrics/get-history?run_id=run_799a8be2d318cb056edb&metric_key=val_auc" \
-H "Authorization: Bearer $KAIMEI_API_KEY"{
"metrics": [
{
"key": "val_auc",
"value": 0.91,
"timestamp": 1796472060000,
"step": 10,
"run_id": "run_799a8be2d318cb056edb"
}
]
}#List a run's artifacts
/mlflow/api/2.0/mlflow/artifacts/listAPI key or sessionThe files and folders at path in the run's artifacts.
curl "https://api.kaimei.ai/mlflow/api/2.0/mlflow/artifacts/list?run_id=run_799a8be2d318cb056edb" \
-H "Authorization: Bearer $KAIMEI_API_KEY"{
"files": [
{"path": "model", "is_dir": true}
]
}#Create a logged model
/mlflow/api/2.0/mlflow/logged-modelsAPI key or sessionMLflow 3's model of a run. Its artifacts are kept with the run that logged it.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_id": "prj_a82aa8dfcbeb66871420", "name": "model", "source_run_id": "run_799a8be2d318cb056edb"}'{
"model": {
"info": {
"model_id": "m-cca3fc61efd08a5fe509f27aead561eb",
"experiment_id": "prj_a82aa8dfcbeb66871420",
"name": "model",
"creation_timestamp_ms": 1796472061188,
"last_updated_timestamp_ms": 1796472061188,
"artifact_uri": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420/models/m-cca3fc61efd08a5fe509f27aead561eb/artifacts",
"status": "LOGGED_MODEL_PENDING",
"tags": [],
"source_run_id": "run_799a8be2d318cb056edb"
},
"data": {
"params": [],
"metrics": []
}
}
}#Search logged models
/mlflow/api/2.0/mlflow/logged-models/searchAPI key or sessionBy experiment, with MLflow's filter, order and pages.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models/search \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"experiment_ids": ["prj_a82aa8dfcbeb66871420"]}'{
"models": [
{
"info": {
"model_id": "m-cca3fc61efd08a5fe509f27aead561eb",
"experiment_id": "prj_a82aa8dfcbeb66871420",
"name": "model",
"creation_timestamp_ms": 1796472061188,
"last_updated_timestamp_ms": 1796472061188,
"artifact_uri": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420/models/m-cca3fc61efd08a5fe509f27aead561eb/artifacts",
"status": "LOGGED_MODEL_PENDING",
"tags": [],
"source_run_id": "run_799a8be2d318cb056edb"
},
"data": {
"params": [],
"metrics": []
}
}
]
}#Get a logged model
/mlflow/api/2.0/mlflow/logged-models/{model_id}API key or sessionOne logged model.
curl https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models/m-cca3fc61efd08a5fe509f27aead561eb \
-H "Authorization: Bearer $KAIMEI_API_KEY"{
"model": {
"info": {
"model_id": "m-cca3fc61efd08a5fe509f27aead561eb",
"experiment_id": "prj_a82aa8dfcbeb66871420",
"name": "model",
"creation_timestamp_ms": 1796472061188,
"last_updated_timestamp_ms": 1796472061188,
"artifact_uri": "mlflow-artifacts:/prj_a82aa8dfcbeb66871420/models/m-cca3fc61efd08a5fe509f27aead561eb/artifacts",
"status": "LOGGED_MODEL_PENDING",
"tags": [],
"source_run_id": "run_799a8be2d318cb056edb"
},
"data": {
"params": [],
"metrics": []
}
}
}#Finalize a logged model
/mlflow/api/2.0/mlflow/logged-models/{model_id}API key or sessionSets its status, such as LOGGED_MODEL_READY.
curl -X PATCH https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models/m-cca3fc61efd08a5fe509f27aead561eb \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status": "LOGGED_MODEL_READY"}'#Delete a logged model
/mlflow/api/2.0/mlflow/logged-models/{model_id}API key or sessionMarks it deleted.
curl -X DELETE https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models/m-cca3fc61efd08a5fe509f27aead561eb \
-H "Authorization: Bearer $KAIMEI_API_KEY"{}#Tag a logged model
/mlflow/api/2.0/mlflow/logged-models/{model_id}/tagsAPI key or sessionSets tags.
curl -X PATCH https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models/m-cca3fc61efd08a5fe509f27aead561eb/tags \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tags": [{"key": "stage", "value": "candidate"}]}'{}#Untag a logged model
/mlflow/api/2.0/mlflow/logged-models/{model_id}/tags/{tag_key}API key or sessionRemoves one tag.
curl -X DELETE https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models/m-cca3fc61efd08a5fe509f27aead561eb/tags/stage \
-H "Authorization: Bearer $KAIMEI_API_KEY"{}#Log a logged model's params
/mlflow/api/2.0/mlflow/logged-models/{model_id}/paramsAPI key or sessionKept with the model.
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models/m-cca3fc61efd08a5fe509f27aead561eb/params \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"params": [{"key": "max_depth", "value": "6"}]}'{}#List a logged model's artifacts
/mlflow/api/2.0/mlflow/logged-models/{model_id}/artifacts/directoriesAPI key or sessionThe files at artifact_directory_path in the model's artifacts.
curl https://api.kaimei.ai/mlflow/api/2.0/mlflow/logged-models/m-cca3fc61efd08a5fe509f27aead561eb/artifacts/directories \
-H "Authorization: Bearer $KAIMEI_API_KEY"#List artifacts
/mlflow/api/2.0/mlflow-artifacts/artifactsAPI key or sessionThe files and folders under path (<experiment id>/<run id>/artifacts/…).
curl "https://api.kaimei.ai/mlflow/api/2.0/mlflow-artifacts/artifacts?path=prj_a82aa8dfcbeb66871420/run_799a8be2d318cb056edb/artifacts" \
-H "Authorization: Bearer $KAIMEI_API_KEY"{
"files": [
{"path": "model", "is_dir": true}
]
}#Download an artifact
/mlflow/api/2.0/mlflow-artifacts/artifacts/{path}API key or sessionThe file's bytes.
curl https://api.kaimei.ai/mlflow/api/2.0/mlflow-artifacts/artifacts/prj_a82aa8dfcbeb66871420/run_799a8be2d318cb056edb/artifacts/model/MLmodel \
-H "Authorization: Bearer $KAIMEI_API_KEY"#Upload an artifact
/mlflow/api/2.0/mlflow-artifacts/artifacts/{path}API key or sessionThe request body is the file, at most 16 MB. A path written again replaces the file.
curl -X PUT https://api.kaimei.ai/mlflow/api/2.0/mlflow-artifacts/artifacts/prj_a82aa8dfcbeb66871420/run_799a8be2d318cb056edb/artifacts/model/MLmodel \
-H "Authorization: Bearer $KAIMEI_API_KEY"{}#Delete an artifact
/mlflow/api/2.0/mlflow-artifacts/artifacts/{path}API key or sessionDeletes the file.
curl -X DELETE https://api.kaimei.ai/mlflow/api/2.0/mlflow-artifacts/artifacts/prj_a82aa8dfcbeb66871420/run_799a8be2d318cb056edb/artifacts/model/MLmodel \
-H "Authorization: Bearer $KAIMEI_API_KEY"{}#Server info
/mlflow/api/3.0/mlflow/server-infoNo authenticationWhat the artifact service offers. MLflow 3 asks before it moves files: plain uploads and downloads only.
curl https://api.kaimei.ai/mlflow/api/3.0/mlflow/server-info \
-H "Authorization: Bearer $KAIMEI_API_KEY"{
"artifact_serving_enabled": true,
"multipart_uploads_enabled": false,
"multipart_downloads_enabled": false,
"artifacts_presigned_only": false,
"workspaces_enabled": false
}#Any other MLflow route
/mlflow/api/2.0/{path}No authenticationRoutes Kaimei does not serve (the model registry, traces, prompts) answer 404 ENDPOINT_NOT_FOUND with every method, so a client says what is missing instead of failing oddly.
| Method | Path | Answers as |
|---|---|---|
| GET | /mlflow/api/2.0/{path} | Any other MLflow route |
| PUT | /mlflow/api/2.0/{path} | Any other MLflow route |
| PATCH | /mlflow/api/2.0/{path} | Any other MLflow route |
| DELETE | /mlflow/api/2.0/{path} | Any other MLflow route |
curl -X POST https://api.kaimei.ai/mlflow/api/2.0/mlflow/registered-models/create \
-H "Authorization: Bearer $KAIMEI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "fraud-model"}'{
"error_code": "ENDPOINT_NOT_FOUND",
"message": "This server does not serve 'mlflow/registered-models/create'. Kaimei answers MLflow's tracking API: experiments, runs, metrics, params, tags, inputs, logged models and artifacts."
}#The ajax-api mirror
MLflow's web UI and some clients call the same routes under /mlflow/ajax-api/2.0. Kaimei serves each one there too, answering as the route it mirrors.
| Method | Path | Answers as |
|---|---|---|
| POST | /mlflow/ajax-api/2.0/mlflow/experiments/create | Create an experiment |
| GET | /mlflow/ajax-api/2.0/mlflow/experiments/get | Get an experiment |
| GET | /mlflow/ajax-api/2.0/mlflow/experiments/get-by-name | Get an experiment by name |
| POST | /mlflow/ajax-api/2.0/mlflow/experiments/search | Search experiments |
| GET | /mlflow/ajax-api/2.0/mlflow/experiments/search | Search experiments (GET) |
| POST | /mlflow/ajax-api/2.0/mlflow/experiments/update | Rename an experiment |
| POST | /mlflow/ajax-api/2.0/mlflow/experiments/delete | Delete an experiment |
| POST | /mlflow/ajax-api/2.0/mlflow/experiments/restore | Restore an experiment |
| POST | /mlflow/ajax-api/2.0/mlflow/experiments/set-experiment-tag | Tag an experiment |
| POST | /mlflow/ajax-api/2.0/mlflow/experiments/delete-experiment-tag | Untag an experiment |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/create | Create a run |
| GET | /mlflow/ajax-api/2.0/mlflow/runs/get | Get a run |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/update | Update a run |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/delete | Delete a run |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/restore | Restore a run |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/search | Search runs |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/log-metric | Log a metric |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/log-parameter | Log a param |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/set-tag | Set a tag |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/delete-tag | Delete a tag |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/log-batch | Log a batch |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/log-model | Log a model |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/log-inputs | Log inputs |
| POST | /mlflow/ajax-api/2.0/mlflow/runs/outputs | Log outputs |
| GET | /mlflow/ajax-api/2.0/mlflow/metrics/get-history | Get a metric's history |
| GET | /mlflow/ajax-api/2.0/mlflow/artifacts/list | List a run's artifacts |
| POST | /mlflow/ajax-api/2.0/mlflow/logged-models | Create a logged model |
| POST | /mlflow/ajax-api/2.0/mlflow/logged-models/search | Search logged models |
| GET | /mlflow/ajax-api/2.0/mlflow/logged-models/{model_id} | Get a logged model |
| PATCH | /mlflow/ajax-api/2.0/mlflow/logged-models/{model_id} | Finalize a logged model |
| DELETE | /mlflow/ajax-api/2.0/mlflow/logged-models/{model_id} | Delete a logged model |
| PATCH | /mlflow/ajax-api/2.0/mlflow/logged-models/{model_id}/tags | Tag a logged model |
| DELETE | /mlflow/ajax-api/2.0/mlflow/logged-models/{model_id}/tags/{tag_key} | Untag a logged model |
| POST | /mlflow/ajax-api/2.0/mlflow/logged-models/{model_id}/params | Log a logged model's params |
| GET | /mlflow/ajax-api/2.0/mlflow/logged-models/{model_id}/artifacts/directories | List a logged model's artifacts |
| GET | /mlflow/ajax-api/2.0/mlflow-artifacts/artifacts | List artifacts |
| GET | /mlflow/ajax-api/2.0/mlflow-artifacts/artifacts/{path} | Download an artifact |
| PUT | /mlflow/ajax-api/2.0/mlflow-artifacts/artifacts/{path} | Upload an artifact |
| DELETE | /mlflow/ajax-api/2.0/mlflow-artifacts/artifacts/{path} | Delete an artifact |
| GET | /mlflow/ajax-api/2.0/{path} | Any other MLflow route |
| POST | /mlflow/ajax-api/2.0/{path} | Any other MLflow route |
| PUT | /mlflow/ajax-api/2.0/{path} | Any other MLflow route |
| PATCH | /mlflow/ajax-api/2.0/{path} | Any other MLflow route |
| DELETE | /mlflow/ajax-api/2.0/{path} | Any other MLflow route |