Skip to main content

A Modular and configurable Deep Learning framework with YAML and PyTorch

Project description

License PyPI version Python CI Documentation Status Paper

🧠 KonfAI

KonfAI Logo

KonfAI is a modular deep learning framework for medical imaging built around YAML-driven workflows.

It lets you define complete pipelines, from data loading to prediction and evaluation, through configuration instead of orchestration scripts.

  • reproducible workflows with explicit configs and outputs
  • modular components for datasets, transforms, models, losses, and metrics
  • designed for research, experimentation, and agent-driven workflows

KonfAI has been used in several top-performing challenge projects: 🔗 SynthRAD2025 – Task 1🔗 SynthRAD2025 – Task 2🔗 CURVAS PDACVI 2025🔗 TrackRAD 2025🔗 Panther🔗 CURVAS

Paper:

KonfAI: A Modular and Fully Configurable Framework for Deep Learning in Medical Imaging


🚀 Why KonfAI?

Most frameworks focus on models. KonfAI focuses on pipelines.

  • 🧩 Compose full workflows from modular components
  • 🔁 Iterate without rewriting Python scripts
  • 📦 Turn experiments into reusable KonfAI Apps
  • 🤖 Use KonfAI as a backend for LLM-driven experimentation through KonfAI-MCP

⚡ Quickstart

Install and run your first workflow:

git clone https://github.com/vboussot/KonfAI.git
cd KonfAI
python -m pip install -e .
cd examples/Segmentation

python -m pip install -U "huggingface_hub[cli]"
hf download VBoussot/konfai-demo \
  --repo-type dataset \
  --include "Segmentation/**" \
  --local-dir Dataset
mv Dataset/Segmentation/* Dataset/
rmdir Dataset/Segmentation
rm -rf Dataset/.cache

This downloads a small public demo subset and prepares the layout expected by the example:

Dataset/
├── 1PC006/
│   ├── CT.mha
│   └── SEG.mha
└── ...
  • CT is the input image
  • SEG is the segmentation label map

Then launch the first training run:

konfai TRAIN -y --gpu 0 --config Config.yml

Then:

konfai PREDICTION -y --gpu 0 --config Prediction.yml --models Checkpoints/SEG_BASELINE/<checkpoint>.pt
konfai EVALUATION -y --config Evaluation.yml

If you do not have a GPU available, replace --gpu 0 with --cpu 1.

Edit these files first:

  • Config.yml → training
  • Prediction.yml → exported outputs
  • Evaluation.yml → metrics on saved predictions

Notebook entry points:

  • examples/Segmentation/Segmentation_demo.ipynb
  • examples/Synthesis/Synthesis_demo.ipynb

For editable installs and optional extras such as server or cluster, see:


🤖 Agent-Ready by Design

KonfAI is designed to serve as a deterministic backend for LLM-driven experimentation.

Through KonfAI-MCP Server, agents can:

  • inspect datasets
  • generate or refine configurations
  • launch experiments
  • analyze results and iterate

All executions remain:

  • reproducible
  • structured
  • grounded in YAML workflows

👉 KonfAI bridges the gap between LLM reasoning and real experimental execution.


📦 KonfAI Apps

A KonfAI App is a self-contained workflow package built with KonfAI.

It can expose:

  • inference
  • evaluation
  • uncertainty estimation
  • full pipelines
  • fine-tuning

Apps live in apps/ and can be used through:

Interface Entry point
🖥️ CLI konfai-apps
🐍 Python API konfai_apps.KonfAIApp
🌐 Remote server konfai-apps-server + konfai-apps --host ...
🧠 3D Slicer SlicerKonfAI

Use Apps when a workflow is already stable and you want a cleaner user-facing interface than the low-level YAML CLI.


📚 Documentation

The README is only the entry point. The full documentation is available here:


🐳 Docker

KonfAI ships a Docker setup for CLI-oriented workflows.

Example:

docker run --rm -it \
  --gpus all \
  -v "$(pwd):/workspace" \
  -w /workspace \
  vboussot/konfai TRAIN --gpu 0 -c examples/Synthesis/Config.yml

🤝 Contributing

Contributions are welcome.

Typical ways to help:

  • improve examples and notebooks
  • clarify documentation
  • add tests for real user paths
  • extend models, transforms, or apps

Local setup:

git clone https://github.com/vboussot/KonfAI.git
cd KonfAI
python -m pip install -e .
python -m pip install pytest pre-commit

Useful commands:

pytest -q
pre-commit run --all-files
make -C docs html

Contributor guide:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

konfai-1.5.5.tar.gz (7.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

konfai-1.5.5-py3-none-any.whl (7.0 MB view details)

Uploaded Python 3

File details

Details for the file konfai-1.5.5.tar.gz.

File metadata

  • Download URL: konfai-1.5.5.tar.gz
  • Upload date:
  • Size: 7.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for konfai-1.5.5.tar.gz
Algorithm Hash digest
SHA256 fdd1cb8029aab75b9197726a815d54b438819b8c9e1c2506428abac60a6dddbd
MD5 1bb8e272e0ed8996e898f847270597fd
BLAKE2b-256 fcf2c8dc41e986756f8a83a1722d07dbdc83737b72f9b416345a9a51ae1e8bb7

See more details on using hashes here.

Provenance

The following attestation bundles were made for konfai-1.5.5.tar.gz:

Publisher: publish.yml on vboussot/KonfAI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file konfai-1.5.5-py3-none-any.whl.

File metadata

  • Download URL: konfai-1.5.5-py3-none-any.whl
  • Upload date:
  • Size: 7.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for konfai-1.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 66fd09d788321e94992c93b017cab9eafbf1f6a46015344253a4b335d06b72b7
MD5 7b162ab8432956c330c881d75cdefdc9
BLAKE2b-256 333d75bc397cba21c3c9cbfa2cf92cbb130f7fb5dd5a832f7473d4019c6782e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for konfai-1.5.5-py3-none-any.whl:

Publisher: publish.yml on vboussot/KonfAI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page