konfai-mcp
v1.9.0Standalone 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.
| Parameter | Type | Description |
|---|---|---|
task * | string | User task description (e.g. 'segment the liver on CT'); must be non-empty. |
dataset_dir | string | Single dataset root path (provide this or dataset_dirs). |
dataset_dirs | One or several dataset root paths (string or list) merged into the strategy. | |
example | string | Example template name to anchor the plan (must exist under examples/). |
extension | string | Format token for the dataset entry hints (default: first detected extension). |
group_roles | object | Mapping of dataset group name -> role: 'input', 'target', or 'support'. |
modeling_intent | string | Spatial modeling mode driving the patching considerations (default 'undecided'). |
workflows | Workflow 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.
| Parameter | Type | Description |
|---|---|---|
classpath * | string | Builtin 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.
| Parameter | Type | Description |
|---|---|---|
kind * | string | Component 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.
| Parameter | Type | Description |
|---|---|---|
workflow * | string | Workflow whose schema to describe: evaluation -> Evaluation.yml (Evaluator), prediction -> Prediction.yml (Predictor), train -> Config.yml (Trainer), transform -> Transform.yml (Transformer). Aliases… |
path | string | Dot-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.
| Parameter | Type | Description |
|---|---|---|
kind | string | Extension 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.
| Parameter | Type | Description |
|---|---|---|
force_update | boolean | Refresh cached HuggingFace listings instead of reusing the local cache. |
include_summary | boolean | Also resolve each app's manifest for display_name/short_description/inputs/outputs (slower, best-effort). |
repos | array | Ad-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…
| Parameter | Type | Description |
|---|---|---|
action * | string | infer: 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 * | array | Input 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 * | string | App 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_code | boolean | Must be True: resolving the app imports its Python code and pip-installs its requirements. |
batch_size | integer | infer, pipeline: Force the inference batch size (overrides the app's config, whose `batch_size: 0` measures it on the GPU). |
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); set without gpu, the run stays on CPU. |
ensemble | integer | infer, pipeline: Number of checkpoints to ensemble; 0 with no ensemble_models uses every app checkpoint. |
ensemble_models | array | infer, pipeline: Explicit checkpoint names to ensemble (see describe_app checkpoints; overrides ensemble). |
evaluation_file | string | evaluate: which evaluation config of the app to run (default 'Evaluation.yml'). |
force_update | boolean | Re-download the app files instead of reusing the local cache. |
gpu | array | GPU indices to run on (default: every visible GPU); an empty list forces CPU. |
gt | array | evaluate, pipeline: ground-truth volumes as GROUPS, paired with inputs by order. |
mask | array | evaluate, pipeline: Mask volumes as GROUPS restricting the evaluated region. Registration infer: two groups, [fixed masks, moving masks], paired with inputs. |
max_voxels | integer | infer: Voxels a pass holds before KonfAI resamples or tiles it (default: sized from the free GPU memory and the RAM budget). |
output | string | Output directory inside the session workspace (default: a unique directory under AppOutputs/, AppEvaluations/, AppUncertainties/ or AppPipelines/). |
patch_size | array | infer, pipeline: Force the inference patch size (overrides the app's config default). |
set_parameters | object | infer, 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_s | number | wait: seconds before returning the current status with timed_out=true. |
tta | integer | infer, pipeline: Number of test-time augmentations (0 disables; see the app's maximum_tta). |
uncertainty | boolean | infer: keep the multi-channel inference stacks an uncertainty action consumes (default False); pipeline: run the uncertainty stage (default True). |
uncertainty_file | string | uncertainty: which uncertainty config of the app to run (default 'Uncertainty.yml'). |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); set without gpu, the run stays on CPU. |
fixed_images | array | Fixed images, for MAE. |
fixed_landmarks | array | Fixed landmark files (.fcsv/.json/.txt), for TRE. |
fixed_seg | array | Fixed label maps, for Dice. |
gpu | array | GPU indices to run on (default: every visible GPU); an empty list forces CPU. |
mask | array | Fixed-grid masks restricting MAE. |
moving_images | array | ORIGINAL moving images, for MAE (same modality only). |
moving_landmarks | array | Moving landmark files, the same points in order, for TRE. |
moving_seg | array | ORIGINAL moving label maps, for Dice. |
output | string | Output directory (default: a unique dir under the session workspace AppEvaluations/). |
timeout_s | number | wait: seconds before returning the current status with timed_out=true. |
transforms | array | The 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. |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
inputs * | object | Host 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 * | string | segmentation, registration or synthesis. |
allow_cloud_images | boolean | Authorise sending images of the case to a cloud API. |
base_url | string | An OpenAI-compatible server (a local VLM) for the openai provider. |
depth | string | quick: a cheap first pass; deep: more calls, more effort, a blind second reading. |
evaluation | array | KonfAI Eval Metric_*.json files whose values for this case Scout starts from. |
labels | object | Label value -> name, e.g. {'1': 'liver'}. |
local_provider | boolean | The base_url is a server on this machine or network. |
max_usd | number | Cost limit, when the model's price is known. |
mode | string | active exploration, or a fixed set of views. |
model | string | The model id; the provider's default when omitted. |
name | string | The inspection's name (default: task and first input's stem). |
notes | string | What the model should know: modality, dataset, the method inspected. |
provider | string | anthropic (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.
| Parameter | Type | Description |
|---|---|---|
dataset * | string | A FidOpt dataset name. |
research | boolean | The 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.
| Parameter | Type | Description |
|---|---|---|
method * | string | methods/<name>, <name>@<variant>, or identity. |
operation * | string | The FidOpt operation. |
cases | array | Case names (run: --case each; check: the case after --on). |
dataset | string | The dataset (optional for check: the synthetic convention check). |
extra | array | Further fidopt flags (e.g. --family NAME, --try LABEL=SETTINGS). |
scout | string | PROVIDER or PROVIDER:MODEL: inspect the scored outputs with Scout. |
scout_allow_cloud | boolean | Authorise Scout to send images to a cloud API. |
timeout_s | number | wait: seconds before returning the current status with timed_out=true. |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
dataset * | string | KonfAI-style dataset directory to fine-tune on (must exist). |
ref * | string | App 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_code | boolean | Must be True: resolving the app imports its Python code and pip-installs its requirements. |
batch_size | integer | Training batch-size override (written to Trainer.Dataset.batch_size); omit to keep the app config's value. |
config_file | string | Which train config of the app to use (default 'Config.yml'). |
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); set without gpu, the run stays on CPU. |
epochs | integer | Number of training epochs (must be > 0; default 10). |
force_update | boolean | Re-download the app files instead of reusing the local cache. |
gpu | array | GPU indices to run on (default: every visible GPU); an empty list forces CPU. |
it_validation | integer | Iterations between validation/checkpoint steps (KonfAI it_validation; default 1000). |
lr | number | Learning-rate override; omit to keep the app config's value. |
models | array | Which app checkpoints to fine-tune (default: the app's first advertised checkpoint). |
name | string | Run name of the fine-tune training (default 'Finetune'). |
output | string | Destination for the produced app bundle (default: a unique dir under the session workspace AppBundles/). |
set_parameters | object | NAME->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_s | number | wait: seconds before returning the current status with timed_out=true. |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
description * | string | Full app description written into app.json. |
display_name * | string | Human-readable app name written into app.json. |
name * | string | Bundle folder name (sanitized to a filesystem-safe form). |
checkpoints | array | Checkpoint paths to package (default: discovered from the session Checkpoints/). |
configs | array | Config paths to package (default: the session Prediction.yml/Config.yml). |
mc_dropout | integer | MC-dropout sample count declared in app.json (default 0). |
model_py | string | Path to a Model.py to ship with the bundle. |
onnx | boolean | Also 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_channels | integer | Input channel count for the ONNX export's dummy input. |
onnx_patch_size | array | Patch size for the ONNX export's dummy input. |
output | string | Destination directory for the bundle (default: the session workspace AppBundles/). |
requirements | string | Path to a requirements.txt to ship with the bundle. |
short_description | string | Short description for app.json (default: display_name). |
support_files | object | Explicit bundle-relative destination -> workspace-relative source mappings for helper files, packages or asset directories, e.g. {'helpers': 'helpers', 'assets': 'assets'}. Directories copy recursivel… |
tta | integer | Maximum 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.
| Parameter | Type | Description |
|---|---|---|
dataset_dir * | string | Host path of the KonfAI-style dataset to alias in place. |
rename_map * | object | Mapping source group name -> target group name (e.g. {'IMG': 'CT'}), applied per case. |
allow_destructive | boolean | Must be True to confirm mode='move' (the source filename disappears). |
mode | string | How aliases are materialised (default 'copy'); 'move' additionally needs allow_destructive=True. |
overwrite | boolean | Replace 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.
| Parameter | Type | Description |
|---|---|---|
from_example | string | Example template name to seed workflow files from (see templates://list). |
include_support_files | boolean | Also copy the example's local .py support files (required when its model/loss lives in a local .py). |
overwrite | boolean | DESTRUCTIVE: True deletes the entire existing workspace (Checkpoints/Predictions included) before recreating it. |
workflows | Workflow 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.
| Parameter | Type | Description |
|---|---|---|
content * | string | Full file content to write (trailing whitespace is normalized to one newline). |
relative_path * | string | Destination path relative to the session workspace (parent dirs are created). |
overwrite | boolean | Replace 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.
| Parameter | Type | Description |
|---|---|---|
run_name * | string | The run's train_name (the Evaluations/<run_name> folder): or an app-trial label as returned by leaderboard. |
session | string | Read another session's run without switching (default: the current session). |
split | string | Metric 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.
| Parameter | Type | Description |
|---|---|---|
run_a * | string | train_name or app-trial label of the baseline run (deltas are reported as B minus A). |
run_b * | string | train_name or app-trial label of the run compared against run_a. |
metric | string | Case-insensitive metric-name suffix filter (default: every metric common to both runs). |
session | string | Read another session's runs without switching (default: the current session). |
split | string | The 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.
| Parameter | Type | Description |
|---|---|---|
run_name * | string | The run's train_name (the Statistics/<run_name> folder). |
max_points | integer | Downsampling cap per curve; the last event is always kept (default 200). |
session | string | Read another session's run without switching (default: the current session). |
tags | array | Substring 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.
| Parameter | Type | Description |
|---|---|---|
job_id | string | Exact job to export (takes precedence over run_name). |
log_lines | integer | Number of log lines in the returned tail (default 100). |
run_name | string | Run 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.
| Parameter | Type | Description |
|---|---|---|
job_id_a * | string | Job whose config snapshot is the diff's 'from' side. |
job_id_b * | string | Job whose config snapshot is the diff's 'to' side. |
filename | string | Which 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.
| Parameter | Type | Description |
|---|---|---|
config_file | string | Alternate train config filename in the session workspace (workflow='train' only). |
workflow | string | Workflow 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.
| Parameter | Type | Description |
|---|---|---|
kind * | string | Which 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 * | string | The 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.
| Parameter | Type | Description |
|---|---|---|
include_leaderboard | boolean | Include a top-5 leaderboard for the chosen split/metric (default True). |
include_log_tail | boolean | Include the latest session log tail (default False). |
include_validation | boolean | Also validate the present configs (slower; default False keeps the payload lean). |
leaderboard_metric | string | Metric filter for the embedded leaderboard (default: every available metric). |
leaderboard_split | string | The Metric_<SPLIT>.json the leaderboard reads; an evaluation run writes TRAIN whatever cases it scored (default 'TRAIN'). |
log_lines | integer | Number 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.
| Parameter | Type | Description |
|---|---|---|
content * | string | Full YAML content; the top-level root key must match the workflow. |
workflow * | string | Which config file to write: evaluation -> Evaluation.yml (Evaluator), prediction -> Prediction.yml (Predictor), train -> Config.yml (Trainer), transform -> Transform.yml (Transformer). |
overwrite | boolean | Replace 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.
| Parameter | Type | Description |
|---|---|---|
direction | string | Override the ranking direction inferred from the metric name; applies to every metric in the payload. |
limit | integer | Maximum rows per leaderboard (default 20). |
metric | string | Metric to rank by (default: one leaderboard per available metric). |
session | string | Rank another session's runs without switching (default: the current session). |
split | string | Metric 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).
| Parameter | Type | Description |
|---|---|---|
cluster | object | SLURM submission via submitit: exactly the keys {name, memory, num_nodes, time_limit}; omit to run locally. |
config_file | string | Alternate train config filename in the session workspace (e.g. 'Config_GAN.yml'; default Config.yml). |
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process. |
gpu | GPU index or indices; omit for CPU (excludes cpu). | |
overwrite | boolean | Overwrite existing run outputs without prompting (KonfAI --overwrite). |
quiet | boolean | Quiet console output (KonfAI --quiet). |
single_process | boolean | Inline, one process (no DDP spawn, no GPU setup). |
tensorboard | boolean | Launch TensorBoard alongside the run (KonfAI --tensorboard). |
timeout_s | number | wait: seconds before returning the current status with timed_out=true. |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
config_file | string | Alternate train config filename in the session workspace (e.g. 'Config_GAN.yml'; default Config.yml). |
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process. |
gpu | GPU index or indices; omit for CPU (excludes cpu). | |
lr | number | Learning-rate override; omit to continue the restored schedule. |
model | string | Checkpoint to resume from: a path (workspace-relative or absolute) or an http(s) URL (default: the configured run's newest checkpoint). |
overwrite | boolean | Overwrite existing run outputs without prompting (KonfAI --overwrite). |
quiet | boolean | Quiet console output (KonfAI --quiet). |
single_process | boolean | Inline, one process (no DDP spawn, no GPU setup). |
tensorboard | boolean | Launch TensorBoard alongside the run (KonfAI --tensorboard). |
timeout_s | number | wait: seconds before returning the current status with timed_out=true. |
wait | boolean | Block until the job ends (or timeout_s expires) and return its final status instead of the launch payload. |
weights_only | boolean | Warm-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.
| Parameter | Type | Description |
|---|---|---|
config_files * | array | Train config filenames in the session workspace, run sequentially (each needs a distinct train_name). |
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process. |
gpu | GPU index or indices; omit for CPU (excludes cpu). | |
overwrite | boolean | Overwrite existing run outputs without prompting (KonfAI --overwrite). |
poll_interval_s | number | Seconds between job status polls while waiting on each run (default 0.5). |
quiet | boolean | Suppress console output for a quieter execution (KonfAI --quiet; default True). |
single_process | boolean | Run each workflow inline in one process (no DDP spawn, no GPU setup). |
stop_on_error | boolean | Stop 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.
| Parameter | Type | Description |
|---|---|---|
dataset_dir * | string | Host path of the dataset whose case directories are split into folds. |
k | integer | Number of folds (>= 2; default 5). |
seed | integer | Shuffle 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.
| Parameter | Type | Description |
|---|---|---|
path * | string | Host path of a SimpleITK-readable volume file (mha/nii.gz/...). |
axis | integer | Axis to slice along in the array's [Z,Y,X] order: 0 = depth (default), 1, or 2. |
max_size | integer | Maximum output edge in pixels; larger planes are strided down (default 512). |
slice_index | integer | Slice 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).
| Parameter | Type | Description |
|---|---|---|
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process. |
gpu | GPU index or indices; omit for CPU (excludes cpu). | |
models | Checkpoint path(s) to predict with (string or list; default: the configured run's newest checkpoint). | |
overwrite | boolean | Overwrite existing prediction outputs without prompting (KonfAI --overwrite). |
quiet | boolean | Quiet console output (KonfAI --quiet). |
single_process | boolean | Inline, one process (no DDP spawn, no GPU setup). |
timeout_s | number | wait: seconds before returning the current status with timed_out=true. |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process. |
gpu | GPU index or indices; omit for CPU (excludes cpu). | |
overwrite | boolean | Overwrite existing evaluation outputs without prompting (KonfAI --overwrite). |
quiet | boolean | Quiet console output (KonfAI --quiet). |
single_process | boolean | Inline, one process (no DDP spawn, no GPU setup). |
timeout_s | number | wait: seconds before returning the current status with timed_out=true. |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
job_id * | string | Job to cancel (as returned by a run_* launch or get_job_status). |
wait_s | number | Seconds 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.
| Parameter | Type | Description |
|---|---|---|
job_id * | string | Job whose log to read. |
grep | string | Regex applied per line over a bounded window of the last max(20*max_lines, 2000) lines before the tail is taken. |
max_lines | integer | Maximum lines returned after filtering (default 200). |
source | string | '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.
| Parameter | Type | Description |
|---|---|---|
job_id | string | Exact job to read (default: the latest job of the given kind). |
kind | string | Job kind used to discover the latest job when job_id is omitted (default 'train'). |
max_entries | integer | Recent 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.
| Parameter | Type | Description |
|---|---|---|
dataset_dir * | string | The dataset root; with browse=True, any folder to explore. |
browse | boolean | Return a bounded file tree with candidate dataset roots instead of the group analysis. |
depth | integer | browse: folder depth of the tree. |
extension | string | File extension to read; detected when omitted. |
groups | array | Restrict the statistics to these groups. |
include_stats | boolean | Sampled statistics (False: structure only, fast). |
max_cases_per_group | integer | Cases sampled per group for the statistics. |
max_entries | integer | browse: entries listed at most. |
seed | integer | Sampling 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…
| Parameter | Type | Description |
|---|---|---|
path * | string | Relative 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_chars | integer | Characters returned at most. |
max_lines | integer | Lines returned at most from a dataset file. |
offset | integer | Character offset to start from. |
template | string | An 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.
| Parameter | Type | Description |
|---|---|---|
classpath * | string | `package.module:Class`, a session `File:Class`, or a bare package name; without kind only its top-level package is checked. |
init_kwargs | object | Smoke test: constructor keyword arguments. |
kind | string | Contract to exercise in a smoke test; omit for the import pre-flight. |
shape | array | Smoke 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.
| Parameter | Type | Description |
|---|---|---|
config_file | string | instantiate and deeper: an alternate train config file of the session. |
level | string | review: schema and semantics, no runtime object; instantiate, setup, train_step: built in an isolated subprocess, each deeper than the last. |
models | array | instantiate and deeper: checkpoint paths for a prediction or evaluation. |
workflow | Which 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.
| Parameter | Type | Description |
|---|---|---|
config_file | string | Alternate transform config in the session (e.g. Transform_masks.yml; default Transform.yml). |
cpu | integer | Worker processes on CPU (KonfAI --cpu; 1 is one plain process); excludes gpu. Both omitted: one CPU process. |
dry_run | boolean | Plan only: every case's verdict and the budget; nothing of the deliverable is written. |
gpu | GPU index or indices; omit for CPU (excludes cpu). | |
overwrite | boolean | Recompute outputs that already exist. |
quiet | boolean | Suppress the console output. |
single_process | boolean | Run inline in one process (no DDP spawn). |
timeout_s | number | wait: seconds before returning the current status with timed_out=true. |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do. |
force | boolean | delete: cancel the active jobs first. |
from_example | string | create: seed the new session from this example template in the same call. |
include_artifacts | string | import: how Checkpoints, Predictions, Evaluations, Statistics and Dataset come along. |
name | string | create, switch: the session name. |
overwrite | boolean | import: replace files already in the session. |
source_dir | string | import: the experiment directory to adopt. |
switch | boolean | create: make the new session current. |
workflows | create 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.
| Parameter | Type | Description |
|---|---|---|
job_id | string | The job; omitted: every job of the session. |
poll_interval_s | number | wait: polling interval in seconds. |
timeout_s | number | wait: seconds before returning the current status with timed_out=true. |
wait | boolean | Block 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.
| Parameter | Type | Description |
|---|---|---|
it_validation | integer | New validation interval, in iterations. |
job_id | string | The training job; omitted: the running one. |
kind | string | Job kind to target when job_id is omitted. |
lr | number | New learning rate, applied now and kept by a running scheduler. |
validate_now | boolean | Run 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.
| Parameter | Type | Description |
|---|---|---|
ref * | string | App reference: a local bundle path, a HuggingFace repo or repo/app. |
allow_untrusted_code | boolean | parameters: confirm the app's code may be imported, in an isolated subprocess. |
force_update | boolean | Re-download a cached HuggingFace app. |
parameters | boolean | Add 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.
| Parameter | Type | Description |
|---|---|---|
ref * | string | App reference: a local bundle path, a HuggingFace repo or repo/app. |
allow_untrusted_code | boolean | import: confirm the app's code may be copied and run and its requirements installed. |
display_name | string | Display name of the copy. |
force_update | boolean | Re-download a cached HuggingFace app. |
overwrite | boolean | export: replace files already in the destination. |
path | string | Export the app as an editable bundle in this folder; omitted: import it into the session. |
set_parameters | object | Model 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.
| Parameter | Type | Description |
|---|---|---|
action * | string | add persists the reference; remove drops it. |
ref * | string | An 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.
| Parameter | Type | Description |
|---|---|---|
name | string | The 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.
| Parameter | Type | Description |
|---|---|---|
anatomy | string | Keep the datasets whose anatomy mentions this word. |
dataset | string | One dataset's name for its descriptor; omitted: every dataset. |
methods | boolean | Include the methods (of the task, or of the dataset's task). |
task | string | Restrict the datasets (and the methods) to one task. |