Skip to main content

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

Project description

IINTS-AF SDK

PyPI version Python Package CI Docs Site Site

IINTS-AF is a safety-first simulation SDK for insulin algorithm research. It helps you test controllers, validate safety behavior, and generate audit-ready artifacts.

New here? Start with: docs/PLAIN_LANGUAGE_GUIDE.md

What You Get

  • Virtual patient simulation for insulin strategies.
  • Deterministic safety supervision (hard rules).
  • Optional AI glucose predictor as advisory signal.
  • Audit outputs: CSV, JSON, PDF reports.
  • Validation and scorecard tooling for repeatable benchmarks.
  • Transparent evidence manifest linked to peer-reviewed sources (iints sources).

Open Logic (Dual-Guard)

IINTS-AF is built as layered logic, not black-box control:

  1. InputValidator
    Filters biologically implausible glucose input and applies fail-soft fallback.
  2. LSTM Predictor (optional)
    Forecasts future glucose; advisory only.
  3. IndependentSupervisor
    Deterministically validates every dose request and overrides unsafe actions.

Install

pip install iints-sdk-python35

Research extras:

pip install iints-sdk-python35[research]

Quick Start (CLI)

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

Clinical-trial scaffold (MDMP-ready):

iints init --project-name iints_trial --template clinical-trial
cd iints_trial
iints data contract-run contracts/clinical_mdmp_contract.yaml data/demo/diabetes_cgm.csv \
  --output-json audit/contract_data_report.json \
  --min-mdmp-grade research_grade --fail-on-noncompliant
iints data mdmp-visualizer audit/contract_data_report.json --output-html audit/mdmp_dashboard.html

One full run with artifacts:

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

Dual-Guard run with predictor:

iints run-full \
  --algo algorithms/example_algorithm.py \
  --predictor models/hupa_finetuned_v2/predictor.pt \
  --scenario-path scenarios/clinic_safe_baseline.json \
  --output-dir results/dual_guard

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",
)

Most Used Commands

# Environment and validation checks
iints doctor --smoke-run
iints study-ready --algo algorithms/example_algorithm.py --output-dir results/study_ready
iints validation-profiles
iints validate-run --results-csv results/run_full/results.csv --profile research_default
iints contract-verify --output-json results/contract_report.json
iints data contract-template --output-path data_contract.yaml
iints data contract-run data_contract.yaml data/my_cgm.csv --output-json results/contract_data_report.json
iints data contract-run data_contract.yaml data/my_cgm.csv --min-mdmp-grade research_grade --fail-on-noncompliant
iints data synthetic-mirror data/my_cgm.csv data_contract.yaml --output-csv data/synthetic_mirror.csv --output-json results/synthetic_mirror_report.json
iints data mdmp-visualizer results/contract_data_report.json --output-html results/mdmp_dashboard.html
iints mdmp template --output-path mdmp_contract.yaml
iints mdmp validate mdmp_contract.yaml data/my_cgm.csv --output-json results/mdmp_report.json
iints mdmp synthetic-mirror data/my_cgm.csv mdmp_contract.yaml --output-csv data/synthetic_mirror.csv --output-json results/synthetic_mirror_report.json
iints mdmp visualizer results/mdmp_report.json --output-html results/mdmp_dashboard.html
iints replay-check --algo algorithms/example_algorithm.py --output-json results/replay_check.json
iints golden-benchmark --algo algorithms/example_algorithm.py --output-json results/golden_benchmark.json

# Scenario bank benchmark
iints scorecard --algo algorithms/example_algorithm.py --profile research_default --output-dir results/scorecard

# Research diagnostics
iints research audit-split --data data_packs/public/OhioT1DM/processed/ohio_merged.csv
iints research evaluate-forecast --input-csv results/dual_guard/results.csv
iints research evaluate-forecast --input-csv results/dual_guard/results.csv --gate-profile research_default
iints research registry-list --registry models/registry.json
iints research registry-promote --registry models/registry.json --run-id <run-id> --stage validated

iints study-ready produces a complete bundle by default:

  • simulation outputs
  • validation_report.json
  • sources_manifest.json
  • SUMMARY.md (human-readable quick review)

iints data contract-run writes deterministic fingerprints plus an MDMP grade:

  • draft
  • research_grade
  • clinical_grade

iints data mdmp-visualizer turns a contract report JSON into a shareable single-file HTML dashboard for audit review.

iints data synthetic-mirror generates a privacy-safe synthetic dataset that keeps schema and broad statistical behavior, then validates it with the same MDMP gates.

MDMP as Separate Protocol Surface

MDMP now has a dedicated namespace:

  • Python imports: iints.mdmp
  • CLI commands: iints mdmp ...

The older iints data ... MDMP commands remain supported for backward compatibility.

MDMP Auto-Guardians enforce quality gates directly in Python pipelines:

import pandas as pd
from iints import mdmp_gate

@mdmp_gate("contracts/clinical_mdmp_contract.yaml", min_grade="clinical_grade")
def process(df: pd.DataFrame) -> int:
    return len(df)

Demos and Notebooks

Documentation

Evidence and Provenance

The SDK ships a source manifest grounded in peer-reviewed diabetes literature and standards.

iints sources
iints sources --category trial --output-json results/source_manifest.json

Safety Notice

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

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.22.tar.gz (922.5 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.22-py3-none-any.whl (965.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iints_sdk_python35-0.1.22.tar.gz
  • Upload date:
  • Size: 922.5 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.22.tar.gz
Algorithm Hash digest
SHA256 9d6e5d01464a79c1619ab0fdde08b8038566f34ba46e6e9377a90e3423c1af2e
MD5 1b5f471374aebbaf7f46c39f3ad00c39
BLAKE2b-256 f3db5a5adb1ba60bb55c445b8962eac180608c6bef73cd0bf36c7cda142239b2

See more details on using hashes here.

Provenance

The following attestation bundles were made for iints_sdk_python35-0.1.22.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.22-py3-none-any.whl.

File metadata

File hashes

Hashes for iints_sdk_python35-0.1.22-py3-none-any.whl
Algorithm Hash digest
SHA256 802de659d19ce2309c72b3ab3bc0d7c94078ac5cac6064a618a5506f08ed4588
MD5 f391e83f7707e7e30b2ce16e7708bbd4
BLAKE2b-256 f0950a4510f897963864be86b51652c0f102bf2a069d56f41d06b0b92e6fa819

See more details on using hashes here.

Provenance

The following attestation bundles were made for iints_sdk_python35-0.1.22-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