A pre-clinical Edge-AI SDK for diabetes management validation.
Project description
IINTS-AF SDK
IINTS-AF is a safety-first SDK for insulin-algorithm research. It lets you simulate, validate, and report results with reproducible artifacts.
Docs (GitHub Pages): python35.github.io/IINTS-SDK
What You Can Do
- Run virtual patient simulations.
- Test algorithm safety gates (deterministic supervisor).
- Add optional AI glucose forecasting.
- Validate datasets before training/evaluation.
- Generate audit-ready CSV/JSON/PDF/HTML outputs.
Quick Start
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
pip install iints-sdk-python35
iints doctor --smoke-run
iints quickstart --project-name iints_quickstart
cd iints_quickstart
iints presets run --name baseline_t1d --algo algorithms/example_algorithm.py
AI Assistant (Ministral 3 Open-Weight via Ollama)
The SDK now includes a research-only AI assistant layer for explanations and run summaries. It is gated by MDMP verification before any LLM call is allowed.
Use an active virtual environment for the full flow:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
python -m pip install -e ".[mdmp]"
Run the open local Mistral model locally with Ollama:
python -m pip install -e ".[mdmp]"
ollama pull ministral-3:8b
iints ai models
Recommended first-time setup:
ollama pull ministral-3:8b
iints ai local-check --model ministral-3:8b
local-check now performs a tiny generation smoke-test by default, so it verifies both model presence and real inference readiness.
Recommended flow:
iints quickstart --project-name iints_quickstart
cd iints_quickstart
iints presets run --name baseline_t1d --algo algorithms/example_algorithm.py
iints ai prepare results/<run_id>
iints ai report results/<run_id>
Direct JSON mode still works if you already have your own payloads and signed MDMP artifact:
iints ai explain results/step.json \
--mdmp-cert results/report.signed.mdmp
Notes:
- AI analysis is blocked if the MDMP artifact is invalid.
- Minimum required MDMP grade defaults to
research_grade. - The SDK now targets the open local
Ministral 3Ollama model by default. - Users can choose a larger or smaller local Mistral-family model with
--model .... - Large JSON payloads are clipped automatically before prompt generation to keep local inference stable.
iints ai prepare <run_dir>now creates AI-ready JSON payloads and, when MDMP is installed, a local development certificate plus keypair in<run_dir>/ai/.- If Ollama closes the connection during generation, the SDK now surfaces an explicit recovery hint and points users toward
ministral-3:3bfor lower-memory systems. - After
iints ai prepare, you can pointiints ai explain|trends|anomalies|reportdirectly at the run directory. - Output is research-only and not medical advice.
Troubleshooting:
- If
iints ai ...saysNo such command 'ai', your environment usually still has a legacyiintspackage installed alongsideiints-sdk-python35. - Run
iints-sdk-doctorfirst. - If it reports a conflict, repair the environment with:
python -m pip uninstall -y iints iints-sdk-python35
python -m pip install -U "iints-sdk-python35[mdmp]==1.1.3"
hash -r
MDMP (Short)
MDMP is the data-quality protocol used by IINTS.
Contract: defines expected columns, types, units, and bounds.Validation: checks a dataset against the contract.Fingerprint + Grade: writes deterministic hashes and a grade (draft,research_grade,clinical_grade).Visualizer: builds a single-file HTML report for audits.
Use the dedicated namespace:
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 visualizer results/mdmp_report.json --output-html results/mdmp_dashboard.html
Use standalone MDMP backend (optional):
export IINTS_MDMP_BACKEND=mdmp_core
Staleness / lineage checks (standalone MDMP CLI):
mdmp fingerprint-record data/my_cgm.csv --output-json results/fingerprint.json --expires-days 365
mdmp fingerprint-check results/fingerprint.json data/my_cgm.csv
mdmp lineage-card-refresh results/mdmp_model_card.yaml
mdmp registry init --registry registry/mdmp_registry.json
mdmp registry push --registry registry/mdmp_registry.json --report results/mdmp_report.json
Dual Repo Workflow
- SDK repo:
python35/IINTS-SDK - MDMP repo:
python35/MDMP
Local helper scripts:
tools/dev/dual_repo_status.shtools/dev/dual_repo_commit_push.sh
Full process: docs/DUAL_REPO_WORKFLOW.md
MDMP sync CI gate:
.github/workflows/mdmp-sync.yml- Uses private-repo checkout when
MDMP_REPO_TOKENis configured. - Falls back to
mdmp-protocolfrom PyPI when checkout is unavailable. - Auto dependency updates for MDMP are handled via Dependabot (
.github/dependabot.yml).
Tools Layout
Repository helpers are now grouped by purpose:
scripts/: simple user-facing shortcuts like test, lint, and demo entrypointstools/ci/: CI gates and policy checkstools/dev/: maintainer workflows and multi-repo helperstools/docs/: manual and documentation builderstools/data/: dataset import and conversion utilitiestools/analysis/: plotting, diagnostics, and report helperstools/assets/: branding and asset generation helpers
Reference: tools/README.md
Typical Workflow
- Prepare or import data.
- Validate data with MDMP.
- Run simulation or forecast evaluation.
- Review report artifacts and metrics.
Key Commands
iints run-full --algo algorithms/example_algorithm.py --scenario-path scenarios/clinic_safe_baseline.json --output-dir results/run_full
iints scorecard --algo algorithms/example_algorithm.py --profile research_default --output-dir results/scorecard
iints study-ready --algo algorithms/example_algorithm.py --output-dir results/study_ready
iints sources --output-json results/source_manifest.json
Documentation
- Docs site: python35.github.io/IINTS-SDK
- Plain guide: docs/PLAIN_LANGUAGE_GUIDE.md
- Comprehensive guide: docs/COMPREHENSIVE_GUIDE.md
- MDMP draft: docs/MDMP.md
- Demos: examples/demos
- Notebooks: examples/notebooks
Safety Notice
For research use only. Not a medical device. No clinical dosing advice.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iints_sdk_python35-1.1.3.tar.gz.
File metadata
- Download URL: iints_sdk_python35-1.1.3.tar.gz
- Upload date:
- Size: 939.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d61a4ef721c8f5a625cec540a0409c2c60cc79748a4ce1cac1bff4878888c5ce
|
|
| MD5 |
33fcfc2cbca6c6154f61a4e9232e2fbc
|
|
| BLAKE2b-256 |
9d2d62a247bf44261c3da37991efd7c9ddff2c158370a4e6c972002f615abd04
|
Provenance
The following attestation bundles were made for iints_sdk_python35-1.1.3.tar.gz:
Publisher:
publish-pypi.yml on python35/IINTS-SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iints_sdk_python35-1.1.3.tar.gz -
Subject digest:
d61a4ef721c8f5a625cec540a0409c2c60cc79748a4ce1cac1bff4878888c5ce - Sigstore transparency entry: 1123944774
- Sigstore integration time:
-
Permalink:
python35/IINTS-SDK@2194818104c72ec38bcd9af371b5de7a0c263171 -
Branch / Tag:
refs/tags/v1.1.3 - Owner: https://github.com/python35
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2194818104c72ec38bcd9af371b5de7a0c263171 -
Trigger Event:
push
-
Statement type:
File details
Details for the file iints_sdk_python35-1.1.3-py3-none-any.whl.
File metadata
- Download URL: iints_sdk_python35-1.1.3-py3-none-any.whl
- Upload date:
- Size: 986.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b310ca0a1efdf4d4c76e4418fecb3ad31a8d5bdcb98b6adc6a4cf60144e73dad
|
|
| MD5 |
de095a51d93ed1647ba9805abee02a9f
|
|
| BLAKE2b-256 |
efa116406f434ea0ba3d029d7f91ff8bb01658d68468a99aa558a0a15e015b7c
|
Provenance
The following attestation bundles were made for iints_sdk_python35-1.1.3-py3-none-any.whl:
Publisher:
publish-pypi.yml on python35/IINTS-SDK
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
iints_sdk_python35-1.1.3-py3-none-any.whl -
Subject digest:
b310ca0a1efdf4d4c76e4418fecb3ad31a8d5bdcb98b6adc6a4cf60144e73dad - Sigstore transparency entry: 1123944822
- Sigstore integration time:
-
Permalink:
python35/IINTS-SDK@2194818104c72ec38bcd9af371b5de7a0c263171 -
Branch / Tag:
refs/tags/v1.1.3 - Owner: https://github.com/python35
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2194818104c72ec38bcd9af371b5de7a0c263171 -
Trigger Event:
push
-
Statement type: