konfai-mcp

v1.9.0
konfai-mcp Checked 1 hour ago Published 5 days ago

Standalone MCP server package for KonfAI experimentation workflows

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

design_config_strategy Design Config Strategy

A config-writing plan from the task, the dataset root(s), the group roles and the modeling intent: dataset summary, config plan, customisation options, unresolved questions, compatible example templates. A group's role (input or target) cannot be read off its name: settle it here with the user. Writes nothing. Next: initialize_session, then write_workflow_config.

ParameterTypeDescription
task *stringUser task description (e.g. 'segment the liver on CT'); must be non-empty.
dataset_dirstringSingle dataset root path (provide this or dataset_dirs).
dataset_dirsOne or several dataset root paths (string or list) merged into the strategy.
examplestringExample template name to anchor the plan (must exist under examples/).
extensionstringFormat token for the dataset entry hints (default: first detected extension).
group_rolesobjectMapping of dataset group name -> role: 'input', 'target', or 'support'.
modeling_intentstringSpatial modeling mode driving the patching considerations (default 'undecided').
workflowsWorkflow name(s) to plan for: train/prediction/evaluation/transform (string or list; default: every workflow that has a config file).

inspect_object_signature Inspect Object Signature

Signature, defaults, doc and contract hints of any configurable classpath: built-in, local File:Class, external package.module:Class, or a declarative .yml model (its hyperparameters, loss-attachable leaves and how to adapt it, with the file's content: no read_file needed). Parsed statically, never built. Next: write_workflow_config, check_config.

ParameterTypeDescription
classpath *stringBuiltin name, local 'File:Class' (resolved in the session workspace, parsed statically), or installed 'package.module:Class' (imported in an isolated subprocess).

list_components List Components

Built-in KonfAI components of one kind (model, loss, metric, transform, augmentation, scheduler, ...): name, where it goes in the YAML, the classpath to inspect. Next: inspect_object_signature.

ParameterTypeDescription
kind *stringComponent kind, one of ['transform', 'augmentation', 'criterion', 'reduction', 'scheduler', 'model', 'block']; aliases accepted (loss/metric -> criterion, plurals).

describe_konfai_capabilities Describe Konfai Capabilities

What KonfAI can do and which tool to reach for: the four workflows, the component kinds, the extension model, which actions are safe and which destroy data. Start here when orienting. Next: list_apps to reuse a model, inspect_dataset to train one.

describe_config_schema Describe Config Schema

Top-level schema of a workflow config (train, prediction, evaluation, transform), generated from KonfAI's own classes: each field's literal yaml_key, type, default, whether required, and the classpath to drill into with inspect_object_signature. Next: write_workflow_config.

ParameterTypeDescription
workflow *stringWorkflow whose schema to describe: evaluation -> Evaluation.yml (Evaluator), prediction -> Prediction.yml (Predictor), train -> Config.yml (Trainer), transform -> Transform.yml (Transformer). Aliases…
pathstringDot-separated YAML keys drilling into a nested config level (e.g. 'Dataset.Patch' or 'Model'); omit for the top level.

describe_extension_points Describe Extension Points

How to add a component of a kind (loss, metric, model, transform, augmentation, scheduler, pretrained model): the base class, the required methods, the YAML reference syntaxes (builtin, File:Class, package.module:Class) and the gotcha. Next: check_component, write_session_file.

ParameterTypeDescription
kindstringExtension kind: loss/metric/model/augmentation/transform/scheduler/pretrained (aliases accepted); omit for all.

list_apps List Apps

Published KonfAI apps from the catalogue (shipped, workspace file, KONFAI_MCP_APP_CATALOG), HuggingFace repos expanded. Use first when the user wants a result from an existing model: an app can do any task, judge the fit from its description. Imports nothing. Next: describe_app, else design_config_strategy.

ParameterTypeDescription
force_updatebooleanRefresh cached HuggingFace listings instead of reusing the local cache.
include_summarybooleanAlso resolve each app's manifest for display_name/short_description/inputs/outputs (slower, best-effort).
reposarrayAd-hoc override list of app references / HuggingFace repo ids checked instead of the catalogue.

run_app Run App

Run a published app as published on the user's data: action infer, evaluate (the app's own Evaluation.yml against gt), uncertainty, or pipeline (all three). A registration app runs through impact-reg-konfai: inputs [[fixed...], [moving...]] plus optional masks; outputs <output>/P000/Transform.h5 (fixed point to moving point, mm) and P000/Moved on the fixed grid; score it with run_registration_evaluate. set_parameters takes tunables by name or by full dotted config path. TRUST GATE: allow_untrusted_code=True required (imports the app's code, installs its requirements). Local and HuggingFace app…

ParameterTypeDescription
action *stringinfer: predictions; evaluate: score the inputs against gt with the app's evaluation config; uncertainty: maps from multi-channel inference stacks; pipeline: infer, then evaluate when gt is given, then…
inputs *arrayInput GROUPS: one inner list per input channel/modality, each a list of file or directory paths, paired by order across groups (evaluate: the predictions; uncertainty: the inference stacks).
ref *stringApp id 'repo_id:app_name' or local app folder path (local/HuggingFace apps only), '#preset' after it to run one of the app's presets (describe_app lists them).
allow_untrusted_codebooleanMust be True: resolving the app imports its Python code and pip-installs its requirements.
batch_sizeintegerinfer, pipeline: Force the inference batch size (overrides the app's config, whose `batch_size: 0` measures it on the GPU).
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); set without gpu, the run stays on CPU.
ensembleintegerinfer, pipeline: Number of checkpoints to ensemble; 0 with no ensemble_models uses every app checkpoint.
ensemble_modelsarrayinfer, pipeline: Explicit checkpoint names to ensemble (see describe_app checkpoints; overrides ensemble).
evaluation_filestringevaluate: which evaluation config of the app to run (default 'Evaluation.yml').
force_updatebooleanRe-download the app files instead of reusing the local cache.
gpuarrayGPU indices to run on (default: every visible GPU); an empty list forces CPU.
gtarrayevaluate, pipeline: ground-truth volumes as GROUPS, paired with inputs by order.
maskarrayevaluate, pipeline: Mask volumes as GROUPS restricting the evaluated region. Registration infer: two groups, [fixed masks, moving masks], paired with inputs.
max_voxelsintegerinfer: Voxels a pass holds before KonfAI resamples or tiles it (default: sized from the free GPU memory and the RAM budget).
outputstringOutput directory inside the session workspace (default: a unique directory under AppOutputs/, AppEvaluations/, AppUncertainties/ or AppPipelines/).
patch_sizearrayinfer, pipeline: Force the inference patch size (overrides the app's config default).
set_parametersobjectinfer, pipeline: Model tuning NAME->VALUE overrides (e.g. {'iterations': 300}); see describe_app(parameters=True). A dotted config path works too (e.g. {'Predictor.Dataset.groups_src.Volume_0.groups_d…
timeout_snumberwait: seconds before returning the current status with timed_out=true.
ttaintegerinfer, pipeline: Number of test-time augmentations (0 disables; see the app's maximum_tta).
uncertaintybooleaninfer: keep the multi-channel inference stacks an uncertainty action consumes (default False); pipeline: run the uncertainty stage (default True).
uncertainty_filestringuncertainty: which uncertainty config of the app to run (default 'Uncertainty.yml').
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.

run_registration_evaluate Run Registration Evaluate

Score a registration against what the pair has: labels (Dice), landmarks (TRE in mm, fixed points pushed through the transform), same-modality images (MAE), and a field's folded-voxel fraction. Pass the ORIGINAL moving data: the transform warps it. Every list holds one path per case, paired by order (or a single path reused for every case). Run with and without transforms to report the gain. A tracked impact-reg-konfai job, no trust gate; Evaluation_summary.json holds the aggregates.

ParameterTypeDescription
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); set without gpu, the run stays on CPU.
fixed_imagesarrayFixed images, for MAE.
fixed_landmarksarrayFixed landmark files (.fcsv/.json/.txt), for TRE.
fixed_segarrayFixed label maps, for Dice.
gpuarrayGPU indices to run on (default: every visible GPU); an empty list forces CPU.
maskarrayFixed-grid masks restricting MAE.
moving_imagesarrayORIGINAL moving images, for MAE (same modality only).
moving_landmarksarrayMoving landmark files, the same points in order, for TRE.
moving_segarrayORIGINAL moving label maps, for Dice.
outputstringOutput directory (default: a unique dir under the session workspace AppEvaluations/).
timeout_snumberwait: seconds before returning the current status with timed_out=true.
transformsarrayThe registration's Transform.h5 (from run_app's infer output, <case>/Transform.h5). Omit it to score the pair as it is: the misalignment before registration.
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.

run_scout_inspection Run Scout Inspection

Have KonfAI Scout inspect one result visually (segmentation, registration or synthesis): a vision model looks at slices, zooms and overlays, measures regions with KonfAI Eval and reports localised defects with evidence, as a tracked job under Scout/<name>. Images reach a cloud model only with allow_cloud_images=True. Next: get_job_status(wait=True), read_scout_report.

ParameterTypeDescription
inputs *objectHost paths by role. segmentation: image, prediction, truth, mask. registration: fixed, moving, field (a displacement image in mm on the fixed grid) or transform (an ITK transform file), fixed_labels,…
task *stringsegmentation, registration or synthesis.
allow_cloud_imagesbooleanAuthorise sending images of the case to a cloud API.
base_urlstringAn OpenAI-compatible server (a local VLM) for the openai provider.
depthstringquick: a cheap first pass; deep: more calls, more effort, a blind second reading.
evaluationarrayKonfAI Eval Metric_*.json files whose values for this case Scout starts from.
labelsobjectLabel value -> name, e.g. {'1': 'liver'}.
local_providerbooleanThe base_url is a server on this machine or network.
max_usdnumberCost limit, when the model's price is known.
modestringactive exploration, or a fixed set of views.
modelstringThe model id; the provider's default when omitted.
namestringThe inspection's name (default: task and first input's stem).
notesstringWhat the model should know: modality, dataset, the method inspected.
providerstringanthropic (Claude, API key), openai (GPT or an OpenAI-compatible local server), claude-code (Claude under this machine's Claude Code login), codex (GPT under its Codex login), mock (no model).

fidopt_table Fidopt Table

A FidOpt dataset's board (fidopt table --json): one line per method and machine, published scores and local rows.

ParameterTypeDescription
dataset *stringA FidOpt dataset name.
researchbooleanThe research board (every licence) instead of the official one.

fidopt_run Fidopt Run

Launch one FidOpt operation as a tracked job: check, run or tune a method on a dataset's cases (only the operations KONFAI_MCP_FIDOPT_ALLOWED permits); scout='PROVIDER[:MODEL]' adds Scout's inspection of the scored outputs. Next: get_job_status(wait=True), fidopt_table.

ParameterTypeDescription
method *stringmethods/<name>, <name>@<variant>, or identity.
operation *stringThe FidOpt operation.
casesarrayCase names (run: --case each; check: the case after --on).
datasetstringThe dataset (optional for check: the synthetic convention check).
extraarrayFurther fidopt flags (e.g. --family NAME, --try LABEL=SETTINGS).
scoutstringPROVIDER or PROVIDER:MODEL: inspect the scored outputs with Scout.
scout_allow_cloudbooleanAuthorise Scout to send images to a cloud API.
timeout_snumberwait: seconds before returning the current status with timed_out=true.
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.

fine_tune_app Fine Tune App

Fine-tune a published app's checkpoint on the user's dataset without authoring a config (epochs, it_validation, lr, batch_size as parameters; set_parameters for the model's tunables), as a tracked job that writes a runnable app bundle to output. TRUST GATE: allow_untrusted_code=True. Next: get_job_status(wait=True), then run_app on the bundle.

ParameterTypeDescription
dataset *stringKonfAI-style dataset directory to fine-tune on (must exist).
ref *stringApp id 'repo_id:app_name' or local app folder path (local/HuggingFace apps only), '#preset' after it to run one of the app's presets (describe_app lists them).
allow_untrusted_codebooleanMust be True: resolving the app imports its Python code and pip-installs its requirements.
batch_sizeintegerTraining batch-size override (written to Trainer.Dataset.batch_size); omit to keep the app config's value.
config_filestringWhich train config of the app to use (default 'Config.yml').
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); set without gpu, the run stays on CPU.
epochsintegerNumber of training epochs (must be > 0; default 10).
force_updatebooleanRe-download the app files instead of reusing the local cache.
gpuarrayGPU indices to run on (default: every visible GPU); an empty list forces CPU.
it_validationintegerIterations between validation/checkpoint steps (KonfAI it_validation; default 1000).
lrnumberLearning-rate override; omit to keep the app config's value.
modelsarrayWhich app checkpoints to fine-tune (default: the app's first advertised checkpoint).
namestringRun name of the fine-tune training (default 'Finetune').
outputstringDestination for the produced app bundle (default: a unique dir under the session workspace AppBundles/).
set_parametersobjectNAME->VALUE overrides baked into the training config before fine-tuning. A bare NAME is a model parameter (see describe_app(parameters=True), e.g. {'iterations': 300}); any other config key needs its…
timeout_snumberwait: seconds before returning the current status with timed_out=true.
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.

package_app_from_session Package App From Session

Package a model trained in this session into a runnable app bundle (app.json, config, checkpoint, optional Model.py, requirements, support_files, ONNX export) that describe_app and run_app consume. Does not upload.

ParameterTypeDescription
description *stringFull app description written into app.json.
display_name *stringHuman-readable app name written into app.json.
name *stringBundle folder name (sanitized to a filesystem-safe form).
checkpointsarrayCheckpoint paths to package (default: discovered from the session Checkpoints/).
configsarrayConfig paths to package (default: the session Prediction.yml/Config.yml).
mc_dropoutintegerMC-dropout sample count declared in app.json (default 0).
model_pystringPath to a Model.py to ship with the bundle.
onnxbooleanAlso export every packaged checkpoint for the portable runtime inside the bundle (default False). One checkpoint writes model.onnx + manifest.json; several (or test-time copies, or a Mask reading a ne…
onnx_in_channelsintegerInput channel count for the ONNX export's dummy input.
onnx_patch_sizearrayPatch size for the ONNX export's dummy input.
outputstringDestination directory for the bundle (default: the session workspace AppBundles/).
requirementsstringPath to a requirements.txt to ship with the bundle.
short_descriptionstringShort description for app.json (default: display_name).
support_filesobjectExplicit bundle-relative destination -> workspace-relative source mappings for helper files, packages or asset directories, e.g. {'helpers': 'helpers', 'assets': 'assets'}. Directories copy recursivel…
ttaintegerMaximum test-time-augmentation count declared in app.json (default 0).

prepare_dataset_aliases Prepare Dataset Aliases

Copy, symlink or move dataset files under new group names when the content is right but the filenames do not match the intended config. Reports the created paths and missing_by_case. Next: inspect_dataset.

ParameterTypeDescription
dataset_dir *stringHost path of the KonfAI-style dataset to alias in place.
rename_map *objectMapping source group name -> target group name (e.g. {'IMG': 'CT'}), applied per case.
allow_destructivebooleanMust be True to confirm mode='move' (the source filename disappears).
modestringHow aliases are materialised (default 'copy'); 'move' additionally needs allow_destructive=True.
overwritebooleanReplace an existing target file instead of skipping it (default False).

initialize_session Initialize Session

Create or reset the current session workspace, optionally seeded from an example template (read_file('templates://list') lists them; include_support_files=True copies its local .py). DESTRUCTIVE with overwrite=True: deletes Checkpoints/ and Predictions/ too; use session(action='create') for a fresh name instead. Next: write_workflow_config.

ParameterTypeDescription
from_examplestringExample template name to seed workflow files from (see templates://list).
include_support_filesbooleanAlso copy the example's local .py support files (required when its model/loss lives in a local .py).
overwritebooleanDESTRUCTIVE: True deletes the entire existing workspace (Checkpoints/Predictions included) before recreating it.
workflowsWorkflow files to seed from the example: train/prediction/evaluation/transform (string or list). Default: train, or every workflow config of an example that has no training config. A workflow the exam…

write_session_file Write Session File

Write one support file into the current session (Model.py, Loss.py, a transform, a manifest). Not validated. Next: inspect_object_signature, check_config.

ParameterTypeDescription
content *stringFull file content to write (trailing whitespace is normalized to one newline).
relative_path *stringDestination path relative to the session workspace (parent dirs are created).
overwritebooleanReplace an existing file (default True); False raises if the file exists.

get_run_metrics Get Run Metrics

Full evaluation metrics (per-case values and aggregates) of one run or app trial, from Evaluations/<run>/Metric_<split>.json. Does not rerun evaluation.

ParameterTypeDescription
run_name *stringThe run's train_name (the Evaluations/<run_name> folder): or an app-trial label as returned by leaderboard.
sessionstringRead another session's run without switching (default: the current session).
splitstringMetric split, uppercased to Metric_<SPLIT>.json (default 'TRAIN'; a miss lists available splits).

compare_runs Compare Runs

Two runs metric by metric on aligned cases: means, per-case deltas, a direction-aware winner (loss-like metrics count lower as better). Reads their Metric_<split>.json.

ParameterTypeDescription
run_a *stringtrain_name or app-trial label of the baseline run (deltas are reported as B minus A).
run_b *stringtrain_name or app-trial label of the run compared against run_a.
metricstringCase-insensitive metric-name suffix filter (default: every metric common to both runs).
sessionstringRead another session's runs without switching (default: the current session).
splitstringThe Metric_<SPLIT>.json to read; an evaluation run writes TRAIN whatever cases it scored (default 'TRAIN').

read_training_curves Read Training Curves

A run's training curves (scalars over iterations) from its TensorBoard event files, downsampled to max_points. Needs the tensorboard package.

ParameterTypeDescription
run_name *stringThe run's train_name (the Statistics/<run_name> folder).
max_pointsintegerDownsampling cap per curve; the last event is always kept (default 200).
sessionstringRead another session's run without switching (default: the current session).
tagsarraySubstring filters on scalar tag names (default: every tag).

export_run_record Export Run Record

The reproducibility record of one run in one payload: the job manifest (command, devices, environment with package versions), the launch-time config snapshots, the resolved config, every split's metrics and a log tail.

ParameterTypeDescription
job_idstringExact job to export (takes precedence over run_name).
log_linesintegerNumber of log lines in the returned tail (default 100).
run_namestringRun to export (its newest recorded job is used); provide this or job_id.

diff_run_configs Diff Run Configs

Unified diff of the exact configs two jobs ran with, from their immutable launch-time snapshots.

ParameterTypeDescription
job_id_a *stringJob whose config snapshot is the diff's 'from' side.
job_id_b *stringJob whose config snapshot is the diff's 'to' side.
filenamestringWhich snapshotted config file to diff (default 'Config.yml').

describe_model_outputs Describe Model Outputs

The addressable module paths of the session config's networks: the exact keys outputs_criterions and outputs_dataset accept (terminal=true marks output heads). Built side-effect-free. Next: write_workflow_config, check_config.

ParameterTypeDescription
config_filestringAlternate train config filename in the session workspace (workflow='train' only).
workflowstringWorkflow whose model to build: 'train', 'prediction', or 'evaluation' (case-insensitive; default 'train').

delete_run Delete Run

Delete one run's outputs of a kind (train: its Statistics and Checkpoints; prediction, evaluation, uncertainty: its folder; transform: its plan and log only), jailed to the session. Never a config or the dataset.

ParameterTypeDescription
kind *stringWhich output to remove: train (Statistics + Checkpoints), prediction, evaluation, uncertainty, transform (its log and plan only, never the transformed data), or 'all' to remove every output of that ru…
run_name *stringThe run to delete (a train_name, e.g. 'MR2CT_01').

summarize_session Summarize Session

One compact snapshot of the current session: readiness, jobs, metric summaries, and on request the leaderboard, a log tail and a config validation. Next: check_config or a run_* tool.

ParameterTypeDescription
include_leaderboardbooleanInclude a top-5 leaderboard for the chosen split/metric (default True).
include_log_tailbooleanInclude the latest session log tail (default False).
include_validationbooleanAlso validate the present configs (slower; default False keeps the payload lean).
leaderboard_metricstringMetric filter for the embedded leaderboard (default: every available metric).
leaderboard_splitstringThe Metric_<SPLIT>.json the leaderboard reads; an evaluation run writes TRAIN whatever cases it scored (default 'TRAIN').
log_linesintegerNumber of log lines when include_log_tail=True (default 50).

write_workflow_config Write Workflow Config

Write one workflow YAML (train, prediction, evaluation, transform) into the session and check it against KonfAI's schema: schema_errors lists every mistake with the nearest valid key; the file is written either way. Next: fix every error and write again, then check_config.

ParameterTypeDescription
content *stringFull YAML content; the top-level root key must match the workflow.
workflow *stringWhich config file to write: evaluation -> Evaluation.yml (Evaluator), prediction -> Prediction.yml (Predictor), train -> Config.yml (Trainer), transform -> Transform.yml (Transformer).
overwritebooleanReplace an existing config (default True); False raises if the file exists.

leaderboard Leaderboard

Ranked metrics across the session's completed runs, one metric and split, direction-aware, with the available metrics and splits. Next: get_run_metrics, compare_runs.

ParameterTypeDescription
directionstringOverride the ranking direction inferred from the metric name; applies to every metric in the payload.
limitintegerMaximum rows per leaderboard (default 20).
metricstringMetric to rank by (default: one leaderboard per available metric).
sessionstringRank another session's runs without switching (default: the current session).
splitstringMetric split, maps to Metric_<SPLIT>.json (default 'TRAIN'; a miss lists available splits).

run_train Run Train

Launch a training job from the session Config.yml (after check_config). Omitting gpu trains on CPU. Returns a job payload, or a blocker payload naming what is missing. Next: read_live_metrics, get_job_status(wait=True).

ParameterTypeDescription
clusterobjectSLURM submission via submitit: exactly the keys {name, memory, num_nodes, time_limit}; omit to run locally.
config_filestringAlternate train config filename in the session workspace (e.g. 'Config_GAN.yml'; default Config.yml).
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process.
gpuGPU index or indices; omit for CPU (excludes cpu).
overwritebooleanOverwrite existing run outputs without prompting (KonfAI --overwrite).
quietbooleanQuiet console output (KonfAI --quiet).
single_processbooleanInline, one process (no DDP spawn, no GPU setup).
tensorboardbooleanLaunch TensorBoard alongside the run (KonfAI --tensorboard).
timeout_snumberwait: seconds before returning the current status with timed_out=true.
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.

run_resume Run Resume

Resume a training from a checkpoint (model, optimizer, scheduler and counters restored), or warm-start a fine-tune with weights_only=True (weights only; prefer fine_tune_app for an app used as published). Resumes the newest checkpoint of the configured run and trains up to the live config's epochs. Returns a job payload or a blocker.

ParameterTypeDescription
config_filestringAlternate train config filename in the session workspace (e.g. 'Config_GAN.yml'; default Config.yml).
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process.
gpuGPU index or indices; omit for CPU (excludes cpu).
lrnumberLearning-rate override; omit to continue the restored schedule.
modelstringCheckpoint to resume from: a path (workspace-relative or absolute) or an http(s) URL (default: the configured run's newest checkpoint).
overwritebooleanOverwrite existing run outputs without prompting (KonfAI --overwrite).
quietbooleanQuiet console output (KonfAI --quiet).
single_processbooleanInline, one process (no DDP spawn, no GPU setup).
tensorboardbooleanLaunch TensorBoard alongside the run (KonfAI --tensorboard).
timeout_snumberwait: seconds before returning the current status with timed_out=true.
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.
weights_onlybooleanWarm-start a fine-tune: load only the checkpoint's model weights and restart epoch/iteration/optimizer from scratch (the fine-tune-from-app path). Requires a local checkpoint, not a URL.

run_batch Run Batch

Run several training configs sequentially server-side (a sweep, fold training), blocking until the batch ends, with per-run outcomes. Each config needs a distinct train_name. Next: leaderboard, compare_runs.

ParameterTypeDescription
config_files *arrayTrain config filenames in the session workspace, run sequentially (each needs a distinct train_name).
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process.
gpuGPU index or indices; omit for CPU (excludes cpu).
overwritebooleanOverwrite existing run outputs without prompting (KonfAI --overwrite).
poll_interval_snumberSeconds between job status polls while waiting on each run (default 0.5).
quietbooleanSuppress console output for a quieter execution (KonfAI --quiet; default True).
single_processbooleanRun each workflow inline in one process (no DDP spawn, no GPU setup).
stop_on_errorbooleanStop the batch at the first failed or blocked run (default True).

generate_folds Generate Folds

Split a dataset into K cross-validation folds: one case-list file per fold in the session, plus the subset stanzas to paste into each config ('folds/fold_0.txt' keeps those cases, '~file' the others). Next: write per-fold configs with distinct train_name, then run_batch.

ParameterTypeDescription
dataset_dir *stringHost path of the dataset whose case directories are split into folds.
kintegerNumber of folds (>= 2; default 5).
seedintegerShuffle seed for the case-to-fold assignment (default 0).

preview_volume Preview Volume

One slice of a volume as a PNG (any SimpleITK-readable file), windowed between the 1st and 99th percentile and downsampled, for a visual check of a case or a prediction; the plane's min, max, mean and unique values come with it (a black image is a constant plane). Reads only.

ParameterTypeDescription
path *stringHost path of a SimpleITK-readable volume file (mha/nii.gz/...).
axisintegerAxis to slice along in the array's [Z,Y,X] order: 0 = depth (default), 1, or 2.
max_sizeintegerMaximum output edge in pixels; larger planes are strided down (default 512).
slice_indexintegerSlice to render along the chosen axis (clamped to the volume; default: the middle slice).

run_prediction Run Prediction

Launch a prediction job from the session Prediction.yml with a checkpoint of the session (models picks which). Returns a job payload or a blocker. Next: get_job_status(wait=True).

ParameterTypeDescription
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process.
gpuGPU index or indices; omit for CPU (excludes cpu).
modelsCheckpoint path(s) to predict with (string or list; default: the configured run's newest checkpoint).
overwritebooleanOverwrite existing prediction outputs without prompting (KonfAI --overwrite).
quietbooleanQuiet console output (KonfAI --quiet).
single_processbooleanInline, one process (no DDP spawn, no GPU setup).
timeout_snumberwait: seconds before returning the current status with timed_out=true.
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.

run_evaluation Run Evaluation

Launch an evaluation job from the session Evaluation.yml on existing predictions. Returns a job payload or a blocker. Next: get_job_status(wait=True), leaderboard.

ParameterTypeDescription
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process.
gpuGPU index or indices; omit for CPU (excludes cpu).
overwritebooleanOverwrite existing evaluation outputs without prompting (KonfAI --overwrite).
quietbooleanQuiet console output (KonfAI --quiet).
single_processbooleanInline, one process (no DDP spawn, no GPU setup).
timeout_snumberwait: seconds before returning the current status with timed_out=true.
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.

cancel_job Cancel Job

Stop a running job: requests cancellation and waits briefly for a clean shutdown. Artifacts are kept.

ParameterTypeDescription
job_id *stringJob to cancel (as returned by a run_* launch or get_job_status).
wait_snumberSeconds to wait for a clean shutdown before the process group is killed (default 5).

read_job_log Read Job Log

A job's console or runtime log: the last max_lines, or the lines matching a regex, to find the traceback. Next: check_config then the matching run_* tool, or cancel_job.

ParameterTypeDescription
job_id *stringJob whose log to read.
grepstringRegex applied per line over a bounded window of the last max(20*max_lines, 2000) lines before the tail is taken.
max_linesintegerMaximum lines returned after filtering (default 200).
sourcestring'auto' prefers the runtime log except for failed jobs (their traceback lives in the console job log); 'job'/'runtime' force one.

read_live_metrics Read Live Metrics

Parsed runtime metrics of a running or finished training (latest snapshot, recent entries, per-stage summaries) instead of raw log lines. Does not block.

ParameterTypeDescription
job_idstringExact job to read (default: the latest job of the given kind).
kindstringJob kind used to discover the latest job when job_id is omitted (default 'train').
max_entriesintegerRecent metric entries returned (default 6; by_stage holds the latest per stage).

inspect_dataset Inspect Dataset

Groups, entry hints, ambiguities and sampled statistics (shapes channel-first) of one dataset root (include_stats=False for a fast structure scan, groups=[one] for focused statistics). browse=True returns instead a bounded file tree with candidate roots, for a path with nested cohorts or an unclear layout. Next: design_config_strategy.

ParameterTypeDescription
dataset_dir *stringThe dataset root; with browse=True, any folder to explore.
browsebooleanReturn a bounded file tree with candidate dataset roots instead of the group analysis.
depthintegerbrowse: folder depth of the tree.
extensionstringFile extension to read; detected when omitted.
groupsarrayRestrict the statistics to these groups.
include_statsbooleanSampled statistics (False: structure only, fast).
max_cases_per_groupintegerCases sampled per group for the statistics.
max_entriesintegerbrowse: entries listed at most.
seedintegerSampling seed.

read_file Read File

Read a bounded text range of one file. A relative path reads the current session (configs, support code, config snapshots, evaluation JSON). An absolute path reads a dataset's small text file: CSV or TSV (with columns and rows), JSON or YAML sidecar, case list, .mhd/.nhdr header, or a Transform.h5 summarised (type, parameters or displacement statistics). template=<example name> reads a file shipped with that template. A resource URI (docs://patching, guide://tool-index, template://Segmentation/summary...) reads that resource, for a client that cannot read resources itself. Binary files are ref…

ParameterTypeDescription
path *stringRelative to the session, or absolute for a dataset file; with template, the file name inside that template; a resource URI (docs://..., guide://..., template://...) reads that resource.
max_charsintegerCharacters returned at most.
max_linesintegerLines returned at most from a dataset file.
offsetintegerCharacter offset to start from.
templatestringAn example template name: read one of its files.

check_component Check Component

Pre-flight a component before wiring it into a config. Without kind: whether the classpath's top-level package is importable (version, licence, install hint), checked without importing it here. With kind: smoke-test the classpath on dummy tensors in an isolated subprocess (a transform's shape contract, a criterion's return and backward). The smoke test runs the code: only on code you or the user wrote.

ParameterTypeDescription
classpath *string`package.module:Class`, a session `File:Class`, or a bare package name; without kind only its top-level package is checked.
init_kwargsobjectSmoke test: constructor keyword arguments.
kindstringContract to exercise in a smoke test; omit for the import pre-flight.
shapearraySmoke test: dummy tensor shape, channel-first (default [1, 8, 8, 8]).

check_config Check Config

Check the session's workflow config. level 'review': schema and semantic checks only (blocking_issues, warnings; no runtime object built). 'instantiate' builds the KonfAI objects, 'setup' also the dataloader, 'train_step' runs one forward and backward on one batch (train only): each in an isolated subprocess, nothing launched; every level includes the review's findings, one call is enough. Next: run_train, run_prediction, run_evaluation, or fix the config.

ParameterTypeDescription
config_filestringinstantiate and deeper: an alternate train config file of the session.
levelstringreview: schema and semantics, no runtime object; instantiate, setup, train_step: built in an isolated subprocess, each deeper than the last.
modelsarrayinstantiate and deeper: checkpoint paths for a prediction or evaluation.
workflowWhich workflow config to check; 'all' checks every present config (instantiate and deeper).

run_transform Run Transform

Batch-process a dataset with the session Transform.yml chain: read, transform, write. dry_run=True plans it first, always: it measures STREAM, LOAD, WHOLE-VOLUME, SKIP or REFUSED per case (touching the output stores) and over_budget says what the run would refuse. The run replans, skips what exists (overwrite recomputes) and refuses a case that fits neither streaming nor memory_budget. Returns a job payload. Next: get_job_status(wait=True), inspect_dataset on the output.

ParameterTypeDescription
config_filestringAlternate transform config in the session (e.g. Transform_masks.yml; default Transform.yml).
cpuintegerWorker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process.
dry_runbooleanPlan only: every case's verdict and the budget; nothing of the deliverable is written.
gpuGPU index or indices; omit for CPU (excludes cpu).
overwritebooleanRecompute outputs that already exist.
quietbooleanSuppress the console output.
single_processbooleanRun inline in one process (no DDP spawn).
timeout_snumberwait: seconds before returning the current status with timed_out=true.
waitbooleanBlock until the job ends (or timeout_s expires) and return its final status instead of the launch payload.

session Session

Manage session workspaces: action 'list' (says whether a host pinned the session); 'create' (name; switches to it; from_example seeds it in the same call, else the workspace is empty until initialize_session); 'switch' (name); 'delete' (the current one; force cancels its jobs); 'import' (adopt an on-disk KonfAI experiment from source_dir: its configs and code, its artifacts linked, copied or left out). create, switch and delete are refused while a job runs or when a host UI pinned the session. Next: initialize_session, summarize_session.

ParameterTypeDescription
action *stringWhat to do.
forcebooleandelete: cancel the active jobs first.
from_examplestringcreate: seed the new session from this example template in the same call.
include_artifactsstringimport: how Checkpoints, Predictions, Evaluations, Statistics and Dataset come along.
namestringcreate, switch: the session name.
overwritebooleanimport: replace files already in the session.
source_dirstringimport: the experiment directory to adopt.
switchbooleancreate: make the new session current.
workflowscreate with from_example: the workflow configs to seed.

get_job_status Get Job Status

The state of one job (job_id) or of every job of the session (no job_id). wait=True blocks until the job ends or timeout_s expires (timed_out=true then, not an error). The payload names next_actions and the job's log resource.

ParameterTypeDescription
job_idstringThe job; omitted: every job of the session.
poll_interval_snumberwait: polling interval in seconds.
timeout_snumberwait: seconds before returning the current status with timed_out=true.
waitbooleanBlock until the job ends or timeout_s expires.

control_training Control Training

Steer a RUNNING training without restarting it: lr and it_validation are applied at its next poll boundary and recorded in the run's config snapshot; validate_now=True runs a validation pass at the next iteration. POSIX, local jobs; a no-op when nothing runs.

ParameterTypeDescription
it_validationintegerNew validation interval, in iterations.
job_idstringThe training job; omitted: the running one.
kindstringJob kind to target when job_id is omitted.
lrnumberNew learning rate, applied now and kept by a running scheduler.
validate_nowbooleanRun a validation pass at the next iteration.

describe_app Describe App

One app's manifest: description, input and output modalities, inference, evaluation and uncertainty capabilities, checkpoints, terminology. parameters=True adds its tunable model parameters with their constraints (imports the app's code in an isolated subprocess: needs allow_untrusted_code=True). Next: run_app, fine_tune_app, fetch_app.

ParameterTypeDescription
ref *stringApp reference: a local bundle path, a HuggingFace repo or repo/app.
allow_untrusted_codebooleanparameters: confirm the app's code may be imported, in an isolated subprocess.
force_updatebooleanRe-download a cached HuggingFace app.
parametersbooleanAdd the app's tunable model parameters and their constraints (imports its code).

fetch_app Fetch App

Bring a published app into the session. Without path: import it as a normal experiment (configs, code and checkpoints copied, requirements installed) for config surgery, custom losses or run_resume(weights_only=True); TRUST GATE allow_untrusted_code=True. With path: export it as a local editable bundle there, set_parameters baked in, no code import; refuses to replace a file unless overwrite=True. Local and HuggingFace apps only.

ParameterTypeDescription
ref *stringApp reference: a local bundle path, a HuggingFace repo or repo/app.
allow_untrusted_codebooleanimport: confirm the app's code may be copied and run and its requirements installed.
display_namestringDisplay name of the copy.
force_updatebooleanRe-download a cached HuggingFace app.
overwritebooleanexport: replace files already in the destination.
pathstringExport the app as an editable bundle in this folder; omitted: import it into the session.
set_parametersobjectModel parameter name->value overrides baked into the copied config.

app_sources App Sources

Edit the workspace app catalogue that list_apps merges: action 'add' persists an app path or HuggingFace repo across sessions, 'remove' drops it. Does not validate the reference: describe_app does.

ParameterTypeDescription
action *stringadd persists the reference; remove drops it.
ref *stringAn app bundle path or a HuggingFace repo id.

read_scout_report Read Scout Report

A finished Scout inspection by name: verdict, observations (kind, defect, severity, confidence, box in mm, cited views and measurements), measurements, views, usage, budget; no image bytes. Without name: the session's inspections listed.

ParameterTypeDescription
namestringThe inspection's name; omitted: the session's inspections.

fidopt_catalog Fidopt Catalog

FidOpt's benchmark catalogue through its own code: one line per dataset (task, anatomy, modalities, cases; task= and anatomy= narrow it) and the methods of the task; with dataset=<name>, that dataset's descriptor (cases, truth, labels, licence) and the methods of its task. corpus lists the dataset folders built here (FIDOPT_DATA); a derived dataset reads its source's. Downloads nothing. Next: fidopt_table, fidopt_run.

ParameterTypeDescription
anatomystringKeep the datasets whose anatomy mentions this word.
datasetstringOne dataset's name for its descriptor; omitted: every dataset.
methodsbooleanInclude the methods (of the task, or of the dataset's task).
taskstringRestrict the datasets (and the methods) to one task.