Admin API¶
This page describes the admin API, which lets you manage administrative operations in the Driverless AI Python client.
Initialize a client with your server credentials and store them in the variable client.
import driverlessai
client = driverlessai.Client(address='http://localhost:12345', username="py", password="py")
You can check whether the connected user has admin privileges as follows.
client.admin.is_admin
True
Loading all users¶
You can list all the users of Driverless AI as follows.
client.admin.list_users()
['alice', 'bob', 'charlie']
Loading all currently logged in users¶
All of the logged in users of a Driverless AI server can be listed as follows. Note that this functionality is only supported for Driverless AI server version 1.10.5 and later.
client.admin.list_current_users()
['alice', 'bob']
List the datasets of a specified user¶
You can list the datasets created by a specific user as follows.
datasets = client.admin.list_datasets(username="alice")
This returns a list of objects of DatasetProxy and it has the following properties.
dataset = datasets[0]
print("Dataset key : " , dataset.key)
print("Dataset name : " , dataset.name)
print("Dataset owner : " , dataset.owner)
Dataset key : 02fdc4d4-cc7d-11ed-ae20-ac1f6b6b4a0e Dataset name : retail-data.csv Dataset owner : alice
You can also delete a dataset as follows.
dataset.delete()
List the experiments of a specified user¶
You can list all the experiments created by a specific user as follows.
experiments = client.admin.list_experiments(username="alice")
This returns a list of objects of ExperimentProxy and it provides the following methods.
experiment = experiments[0]
print("Completed : " , experiment.is_complete())
print("Running : " , experiment.is_running())
print("Experiment status : " , experiment.status(verbose=1))
Completed : True Running : False Experiment status : Complete 100.00%
Transfer data between users¶
Here, all the data, including datasets and experiments, is transferred to the other user.
client.admin.transfer_data(from_user="alice", to_user="bob")
You can now view the datasets created by Alice under Bob's datasets.
client.admin.list_datasets(username="bob")
[<driverlessai._admin.DatasetProxy at 0x12ac98190>, <driverlessai._admin.DatasetProxy at 0x12ac989a0>]
List scheduled experiments in the DAI server and manipulate execution priorities¶
Here, you have the ability to list the scheduled experiments for a specific user on the DAI server.
scheduled_exps = client.admin.list_scheduled_experiments(user="alice")
/tmp/ipykernel_72777/528868256.py:1: UserWarning: 'Admin.list_scheduled_experiments' is a beta API that is subject to future changes. scheduled_exps = client.admin.list_scheduled_experiments(user="alice")
This API returns a list of ScheduledTask objects, each containing the following properties.
print("Task ID: ", scheduled_exps[5].key)
print("Driverless AI procedure: ", scheduled_exps[5].procedure)
print("Entity ID: ", scheduled_exps[5].entity_id)
print("Task queue: ", scheduled_exps[5].queue)
print("Timeout: ", scheduled_exps[5].timeout)
print("Username: ", scheduled_exps[5].user)
print("Queueing time: ", scheduled_exps[5].queueing_time)
Task ID: 08044682-b12e-11ef-b7d9-ac1f6b00be4b Driverless AI procedure: auto_dl_easy_api_wrapper Entity ID: 07f475a4-b12e-11ef-b7d9-ac1f6b00be4b Task queue: p:gpu Timeout: None Username: alice Queueing time: 1733199673
You are able to modify the execution priority of a specific experiment.
scheduled_exps[5].update_schedule_priority(priority=1)
As a result, this experiment will now be assigned the highest priority in the priority queue.
new_list = client.admin.list_scheduled_experiments(user="alice")
print("1st on GPU: ", new_list[0].entity_id)
/tmp/ipykernel_72777/4107197592.py:1: UserWarning: 'Admin.list_scheduled_experiments' is a beta API that is subject to future changes. new_list = client.admin.list_scheduled_experiments(user="alice")
1st on GPU: 07f475a4-b12e-11ef-b7d9-ac1f6b00be4b
Additionally, you have the capability to reorder the execution priorities of multiple scheduled experiments.
client.admin.reorder_experiment_schedule(
[
{
"username": new_list[1].user,
"key": new_list[1].entity_id
},
{
"username": new_list[0].user,
"key": new_list[0].entity_id
}
]
)
Get details of a specific user¶
You can retrieve detailed information of a specific user as follows. Note that this functionality is only supported for Driverless AI server version 2.3.0 and later.
# Retrieve details of a specific user (Driverless AI 2.3.0+)
user = client.admin.get_user(username="alice")
print("Username :", user.username)
print("Datasets :", user.datasets_count)
print("Experiments :", user.experiments_count)
print("Visualizations :", user.visualizations_count)
print("Interpretations :", user.interpretations_count)
print("Projects :", user.projects_count)
print("Custom recipes :", user.custom_recipes_count)
print("User directory :", user.user_directory_path)
print("User directory size (bytes) :", user.user_directory_size)
print("Experiments quota :", user.experiments_quota)
Username : alice Datasets : 5 Experiments : 3 Visualizations : 8 Interpretations : 1 Projects : 1 Custom recipes : 0 User directory : /home/alice User directory size (bytes) : 987654321 Experiments quota : 10
List the interpretations of a specified user¶
You can list the interpretations created by a specific user as follows. Note that this functionality is only supported for Driverless AI server version 1.11.1 and later.
# List interpretations (Driverless AI 1.11.1+)
interpretations = client.admin.list_interpretations(username="alice")
print("Num interpretations:", len(interpretations))
if interpretations:
interp = interpretations[0]
print("Key :", interp.key)
print("Name :", interp.name)
print("Owner :", interp.owner)
print("Running :", interp.is_running())
print("Status :", interp.status(verbose=1))
# Access linked entities and settings
print("Dataset :", getattr(interp.dataset, "key", None))
print("Experiment :", getattr(interp.experiment, "key", None))
print("Run duration (s) :", interp.run_duration)
print("Has settings :", bool(interp.settings))
Num interpretations: 1 Key : interp-001 Name : Interpretation A Owner : alice Running : False Status : Complete 100.00% Dataset : ds-train-001 Experiment : exp-001 Run duration (s) : 12.34 Has settings : True
List the projects of a specified user¶
You can list the projects created by a specific user as follows. Note that this functionality is only supported for Driverless AI server version 1.11.1 and later.
# List projects (Driverless AI 1.11.1+)
projects = client.admin.list_projects(username="alice")
print("Num projects:", len(projects))
if projects:
proj = projects[0]
print("Key :", proj.key)
print("Name :", proj.name)
print("Owner :", proj.owner)
print("Description :", proj.description)
# Linked datasets and experiments
ds = proj.datasets
print("Train datasets :", [getattr(d, "key", None) for d in ds["train_datasets"]])
print("Validation datasets :", [getattr(d, "key", None) for d in ds["validation_datasets"]])
print("Test datasets :", [getattr(d, "key", None) for d in ds["test_datasets"]])
print("Experiments :", [e.key for e in (proj.experiments or [])])
Num projects: 1 Key : prj-001 Name : Fraud Project Owner : alice Description : Fraud model exploration Train datasets : ['ds-train-001', 'ds-train-002'] Validation datasets : ['ds-val-001'] Test datasets : ['ds-test-001'] Experiments : ['exp-001', 'exp-002']
List the visualizations of a specified user¶
You can list the visualizations created by a specific user as follows. Note that this functionality is only supported for Driverless AI server version 1.11.1 and later.
# List visualizations (Driverless AI 1.11.1+)
visualizations = client.admin.list_visualizations(username="alice")
print("Num visualizations:", len(visualizations))
if visualizations:
viz = visualizations[0]
print("Key :", viz.key)
print("Name :", viz.name)
print("Owner :", viz.owner)
print("Running :", viz.is_running())
print("Status :", viz.status(verbose=1))
print("Dataset :", getattr(viz.dataset, "key", None))
Num visualizations: 1 Key : viz-001 Name : AutoViz A Owner : alice Running : False Status : Complete 100.00% Dataset : ds-train-001
List the model diagnostics of a specified user¶
You can list the model diagnostics created by a specific user as follows. Note that this functionality is only supported for Driverless AI server version 1.11.1 and later.
# List model diagnostics (Driverless AI 1.11.1+)
model_diagnostics = client.admin.list_model_diagnostics(username="alice")
print("Num model diagnostics:", len(model_diagnostics))
if model_diagnostics:
md = model_diagnostics[0]
print("Key :", md.key)
print("Name :", md.name)
print("Owner :", md.owner)
print("Running :", md.is_running())
print("Status :", md.status(verbose=1))
print("Experiment :", getattr(md.experiment, "key", None))
print("Test dataset :", getattr(md.test_dataset, "key", None))
print("Scores :", md.scores)
Num model diagnostics: 1
Key : md-001
Name : ModelDiag A
Owner : alice
Running : False
Status : Complete 100.00%
Experiment : exp-001
Test dataset : ds-test-001
Scores : {'AUC': {'score': 0.912, 'mean': 0.905, 'sd': 0.01}, 'LogLoss': {'score': 0.34, 'mean': 0.35, 'sd': 0.02}}
List server logs and download a log file¶
You can list the server logs and optionally download a log file as follows. Note that this functionality is only supported for Driverless AI server version 1.10.5 and later.
# List server logs (Driverless AI 1.10.5+)
logs = client.admin.list_server_logs()
print("Num logs:", len(logs))
if logs:
log = logs[0]
print("Path :", log.file_path)
print("Size (bytes) :", log.size)
print("Created :", log.created)
print("Last modified :", log.last_modified)
# Download the log file to the current directory
# downloaded_path = log.download(dst_dir=".")
# print("Downloaded to:", downloaded_path)
Num logs: 1 Path : logs/dai.log Size (bytes) : 123456 Created : 2025-11-01 10:00:00 Last modified : 2025-11-01 12:00:00
List running tasks and abort a task¶
All of the currently running tasks on the Driverless AI server can be listed as follows. You can optionally filter by user. Aborting tasks is supported on Driverless AI server version 1.11.1 and later.
# List running tasks (optionally filter by user)
running = client.admin.list_running_tasks() # or client.admin.list_running_tasks(user="alice")
print("Num running tasks:", len(running))
if running:
task = running[0]
print("Task key :", task.key)
print("User :", task.user)
print("Procedure :", task.procedure)
print("Worker :", task.worker)
# Abort (Driverless AI 1.11.1+): uncomment to abort your own tasks
# task.abort()
Num running tasks: 1 Task key : task-001 User : alice Procedure : train_experiment Worker : worker-0
Get runtime insights for running experiments¶
You can retrieve system insights for currently running experiments as follows. Note that this functionality is only supported for Driverless AI server version 2.0 and later.
# System insights for running experiments (Driverless AI 2.0+)
insights = client.admin.get_runtime_experiment_insights()
print("Num running experiments:", len(insights))
if insights:
ri = insights[0]
print("Entity ID :", ri.entity_id)
print("Username :", ri.username)
print("CPU usage :", ri.cpu_usage)
print("Memory usage (bytes) :", ri.memory_usage)
print("GPU usage :", ri.gpu_usage)
print("Disk usage (bytes) :", ri.disk_usage)
print("Creation timestamp :", ri.creation_timestamp)
print("Worker info :", ri.worker_info)
# From an ExperimentProxy (only if running)
# if experiments and experiments[0].is_running():
# ri2 = experiments[0].runtime_insights
# print("Experiment runtime CPU usage :", ri2.cpu_usage)
Num running experiments: 1
Entity ID : exp-001
Username : alice
CPU usage : 0.72
Memory usage (bytes) : 2147483648
GPU usage : {'memory': 4294967296, 'usage': 0.55}
Disk usage (bytes) : 10485760
Creation timestamp : 2025-11-04 11:11:08
Worker info : {'name': 'worker-0', 'ip': '10.0.0.5'}