Skip to main content

A pre-clinical Edge-AI SDK for diabetes management validation.

Project description

IINTS-AF SDK

PyPI version Open In Colab Python Package CI Coverage Docs Coverage Site

Intelligent Insulin Titration System for Artificial Pancreas

IINTS-AF is a safety-first simulation and validation platform for insulin dosing algorithms. It lets you test AI or classical controllers on virtual patients, enforce deterministic safety constraints, and generate audit-ready clinical reports before anything touches a real patient.

In one session you can:

  • Run a clinic-safe preset and compare against PID and standard pump baselines
  • Import real-world CGM CSV into a standard schema + scenario JSON
  • Use the bundled demo CGM data pack (zero setup)
  • Export a clean PDF report plus full audit trail (JSONL/CSV)
  • Stress-test sensor noise, pump limits, and human-in-the-loop interventions
  • Generate patient profiles with ISF/ICR + dawn phenomenon

Who it’s for:

  • Diabetes researchers and clinicians validating new control strategies
  • ML engineers benchmarking AI controllers with medical safety rails
  • Developers building decision-support systems for closed-loop insulin delivery

Installation

Install the SDK directly via PyPI:

pip install iints-sdk-python35

Quick Start (CLI)

iints quickstart --project-name iints_quickstart
cd iints_quickstart
iints presets run --name baseline_t1d --algo algorithms/example_algorithm.py

One-line full run (CSV + audit + PDF + baseline):

iints run-full --algo algorithms/example_algorithm.py \
  --scenario-path scenarios/clinic_safe_baseline.json \
  --output-dir results/run_full

By default, runs write to results/<run_id>/ and include config.json, run_metadata.json, and run_manifest.json.

Import real-world CGM data:

iints import-data --input-csv data/my_cgm.csv --output-dir results/imported

Try the bundled demo data pack:

iints import-demo --output-dir results/demo_import

Official real-world datasets (download on demand):

iints data list
iints data info aide_t1d
iints data fetch aide_t1d
iints data cite aide_t1d

Some datasets require approval and are marked as request in the registry. iints data info prints BibTeX + citation text for easy referencing.

Offline sample dataset (no download required):

iints data fetch sample --output-dir data_packs/sample

Nightscout import (optional dependency):

pip install iints-sdk-python35[nightscout]
iints import-nightscout --url https://your-nightscout.example --output-dir results/nightscout_import

Scenario generator:

iints scenarios generate --name "Random Stress Test" --output-path scenarios/generated_scenario.json
iints scenarios migrate --input-path scenarios/legacy.json

Parallel batch runs:

iints run-parallel --algo algorithms/example_algorithm.py --scenarios-dir scenarios --output-dir results/batch

Interactive run wizard:

iints run-wizard

Algorithm registry:

iints algorithms list
iints algorithms info "PID Controller"

Or run the full demo workflow (import + run + report) in one script:

python3 examples/demo_quickstart_flow.py

Quick Start (Python)

import iints
from iints.core.algorithms.pid_controller import PIDController

outputs = iints.run_simulation(
    algorithm=PIDController(),
    scenario="scenarios/example_scenario.json",
    patient_config="default_patient",
    duration_minutes=720,
    seed=42,
    output_dir="results/quick_run",
)

Notebook Guide

Hands-on Jupyter notebooks live in examples/notebooks/

  • Quickstart end-to-end run
  • Presets + scenario validation
  • Safety supervisor behavior
  • Audit trail + PDF report export
  • Baseline comparison + clinical metrics
  • Sensor/pump models + human-in-the-loop
  • Optional Torch/LSTM usage
  • Ablation study (with/without Supervisor)

AI Research Track (Predictor)

IINTS-AF includes an optional research pipeline to train a glucose predictor that feeds the Safety Supervisor with a 30-120 minute forecast. The predictor never doses insulin; it only provides a forecast signal.

Install research extras:

pip install iints-sdk-python35[research]

Train a starter predictor:

python research/synthesize_dataset.py --runs 25 --output data/synthetic.parquet
python research/train_predictor.py --data data/synthetic.parquet --config research/configs/predictor.yaml --out models

Integrate:

from iints.research import load_predictor_service
predictor = load_predictor_service("models/predictor.pt")
outputs = iints.run_simulation(..., predictor=predictor)

Documentation

  • Product manual: docs/COMPREHENSIVE_GUIDE.md
  • Notebook index: examples/notebooks/README.md
  • Technical README: docs/TECHNICAL_README.md
  • API Stability: API_STABILITY.md
  • Research track: research/README.md

Related Work & Inspiration

We borrow techniques from the broader CGM/APS ecosystem, while differentiating with a safety‑first, audit‑ready workflow:

Ethics & Safety

This SDK is for research and validation. It is not a medical device and does not provide clinical dosing advice.

“Code shouldn’t be a secret when it’s managing a life.” — Bobbaers Rune

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

iints_sdk_python35-0.1.19.tar.gz (880.0 kB view details)

Uploaded Source

Built Distribution

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

iints_sdk_python35-0.1.19-py3-none-any.whl (915.4 kB view details)

Uploaded Python 3

File details

Details for the file iints_sdk_python35-0.1.19.tar.gz.

File metadata

  • Download URL: iints_sdk_python35-0.1.19.tar.gz
  • Upload date:
  • Size: 880.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for iints_sdk_python35-0.1.19.tar.gz
Algorithm Hash digest
SHA256 6d34b9564496fa84d9838bc64c1dbd5fb1e06e6b568331494e5250ee1d29657a
MD5 13d2d0f5028694d94cd149e14a63c890
BLAKE2b-256 6fbd47a1842e9c93e32ebc5a446416dbb9671d5828b00ce52ab09ebc7a1c9bc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for iints_sdk_python35-0.1.19.tar.gz:

Publisher: publish-pypi.yml on python35/IINTS-SDK

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

File details

Details for the file iints_sdk_python35-0.1.19-py3-none-any.whl.

File metadata

File hashes

Hashes for iints_sdk_python35-0.1.19-py3-none-any.whl
Algorithm Hash digest
SHA256 f34840c30cc16ba62a59901d0d498b1827402cd9499e4545cd8d1533c7e71c0c
MD5 347e9dc894a4c671a78f4673b2664c42
BLAKE2b-256 b628d376834ef6d3d90d913a632b15b62186ba43261662ba7666d518cf90b8d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for iints_sdk_python35-0.1.19-py3-none-any.whl:

Publisher: publish-pypi.yml on python35/IINTS-SDK

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