Skip to main content

Curiosity

Python API and named command

The implementation is src/curiosity_meds/curiosity_meds.py, with configuration in config.py. Both concrete classes are public package exports:

from curiosity_meds import Curiosity, CuriosityConfig

algorithm = Curiosity(CuriosityConfig())

Run typed requests through meds_algorithm.StepRunner.run(...) so validation, measurements and publication apply. Calling an implementation method directly bypasses that execution contract. After installation, the algorithm's own curiosity-meds command runs the CLI:

curiosity-meds commands --profile zero_shot_materialized

Curiosity-0826 generative medical event model: Qwen2 decoder pretrained on tokenized MEDS timelines, zero-shot task prediction by Monte Carlo generation of future timelines.

This repository declares the zero_shot_materialized profiles under version 4 of the minimal MEDS algorithm contract. The contract standardizes MEDS input, command meanings and arguments, artifact envelopes, final predictions, measurements, MEDS-DEV packaging, and operational interfaces. The algorithm owns every computational choice and every intermediate payload.

Algorithm profile commands

  • zero_shot_materialized: preprocess_data → pretrain → infer_trajectories → predict_zero_shot_materialized
curiosity-meds profiles
curiosity-meds commands --profile zero_shot_materialized
curiosity-meds <step> --profile <profile> key=value ...

Each profile has algorithms/<profile>/model.yaml. Multiple profiles share one Python package and one registry; select one explicitly for each run. STUB_PROFILES tracks implementation status separately. Read Software contract for exact class responsibilities and step inputs.

Intermediate artifacts may be tensors, files, databases, external-system references, or any other implementation-owned representation. Generic tests inspect only their manifest.yaml envelopes. They must not assume batches, Lightning, PyTorch, Parquet intermediate data, or iteration order.

Profile runner (prototype)

Install uv sync --extra orchestration --extra test, then fill the input paths and new output directory in configs/runs/run.yaml. Algorithm settings belong under algorithm; core validates them using this repository's concrete Config class.

uv run curiosity-meds run --dry-run
uv run curiosity-meds run execution=local
# Use a NEW output_dir and configure your cluster's resources before submission:
uv run curiosity-meds run execution=slurm output_dir=/runs/new-cluster-run

A dry run prints all resolved arguments, paths, configuration and resources without writing files or submitting jobs. Local execution uses fresh subprocesses; Submitit submits separate dependent SLURM jobs. See the shared runner guide for stage subsets, artifact reuse, resource configuration and prototype limitations. The existing per-step CLI and shell launcher remain available for comparison. This prototype does not implement Hydra multirun, multi-node training or checkpoint/resume.

Publishing this algorithm

Follow the release guide for package metadata, one-time PyPI Trusted Publisher setup, installed-wheel checks, and version-tag publication. All profiles ship in the meds-algorithm-curiosity distribution. Tests run in CI; publishing is an explicit workflow dispatch after implementation.

Inputs and predicates

  • external_meds_dir is the standard MEDS dataset boundary.
  • external_index_dir supplies only (subject_id, prediction_time) to inference and scoring.
  • external_labels_dir supplies permitted training targets or explicit in-context examples.
  • external_evaluation_labels_dir, when supplied, is used only to attach truth after scores are fixed.
  • external_predicates_file supplies dataset-specific predicates when useful. For MIMIC-IV, reuse the predicates from MEDS-DEV. This repository decides whether and how to interpret them.

A command that consumes predicates records their absolute path and SHA-256 digest in its manifest. Predicates do not imply a standard feature representation.

Implementing the algorithm

Read AGENTS.md, SPEC.md, and docs/IMPLEMENTATION_GUIDE.md completely before changing implementation files. The implementation source recorded when this repository was generated is:

https://arxiv.org/abs/2611.15710v1, building on https://arxiv.org/abs/2508.12104v3 (papers only; no code released)

The algorithm-owned surface is src/curiosity_meds/curiosity_meds.py (the typed algorithm), src/curiosity_meds/config.py (its immutable configuration), algorithms/<profile>/model.yaml, and tests/e2e.py. Implement the selected profile methods, define exact intermediate compatibility checks in validate_inputs, finalize MEDS-DEV command strings, and complete the report. Remove a profile from STUB_PROFILES only after it runs end to end. Complete every declared profile.

For each generated test and its purpose, read the test guide.

Configuration and execution ownership

Declare typed fields/defaults in CuriosityConfig, with validate() for constraints. Pass config_file=/path/config.yaml to a step for a JSON/YAML values mapping; unknown fields fail. Core saves the complete resolved config and original typed request as config.json and request.json in each published artifact. These JSON envelopes can be reloaded with the corresponding explicit classes.

Algorithm methods receive typed requests, write payloads into request.output.directory (staging), and return PayloadMetadata. create_repository().run(...) constructs a fresh algorithm and delegates to core's runner. It owns measurements, prediction validation, optional post-score truth attachment, metadata and publication. Never publish from inside algorithm methods or write the reserved metadata files. Reopen fitted artifacts on each step. Test config/request round trips and execution in a fresh process.

Verification

uv run pytest -rs
uv run pytest -m meds_dev -rs
uv run pytest -m real_data -rs
  • The default suite runs the local end-to-end adapter and contract tests.
  • meds_dev registers algorithms/<profile>/model.yaml, installs this repository from requirements.txt in an isolated environment, and executes MEDS-DEV's real command slots.
  • real_data runs the full selected algorithm profile on the MEDS-DEV MIMIC-IV demo, the pinned mortality/in_icu/first_24h task, and MEDS-DEV's MIMIC predicates. Set MEDS_DEMO_DIR to reuse an existing demo and MEDS_DEV_DIR to reuse a checkout.

Automatic provisioning pins MEDS-DEV PR #330's tested commit, which has the {predicates_path} passthrough (PR #325) and the {task_criteria_path} passthrough this zero-shot algorithm needs. Set MEDS_DEV_REF to use another revision containing those capabilities. A checkout supplied through MEDS_DEV_DIR is checked and fails clearly if it cannot populate them.

Both integration tiers explicitly algorithm_stub-skip until implementation is complete. A completed port must have zero algorithm_stub skips and must account for every other skip using -rs output.

These commands are gates, not an unordered checklist. Follow the canonical staged workflow in docs/IMPLEMENTATION_GUIDE.md: local, MEDS-DEV, pre-demo report and human review, MIMIC-IV demo, demo report and human review, authorized full-data run, then final report and GitHub synchronization. Full-data cluster jobs run only from a clean, pushed commit and use the reviewed shared task bundle for the selected dataset (for example, MIMIC-IV or NWICU in MEDS format), built upstream from clinical ACES tasks or randomly sampled code-by-horizon tasks. The provided real_data test remains the MIMIC-IV demo regardless of that choice.

Final predictions must conform to MEDS evaluation, contain unique (subject_id, prediction_time) keys, and exactly cover the requested evaluation index. Tests compare the actual key sets; self-reported manifest counts are not accepted as evidence. Row order is never an association mechanism.

Measurements

Every command manifest records monotonic wall time and sampled live process-tree memory. On Linux, peak PSS from /proc/*/smaps_rollup is the primary comparison metric; aggregate RSS is retained as a diagnostic. The measurement method and sampling interval are explicit. GPU measurements and SLURM MaxRSS, when available, are separate metrics. Missing measurements are null; observed zero is 0. Time and memory are evidence, not portable test thresholds.

Cluster execution and GitHub communication

$EDITOR slurm/config.sh
PROFILE=zero_shot_materialized ./slurm/submit.sh --dry-run
PROFILE=zero_shot_materialized ./slurm/submit.sh
scripts/github-sync.sh <run-id>

SLURM follows the selected algorithm profile and chains stages by successful dependencies. Structured evidence belongs under runs/<run-id>/; raw logs, datasets, checkpoints, and credentials do not. GitHub synchronization pushes a runs/curiosity_meds/<run-id> branch and optionally opens a draft PR. A failed push leaves the result committed and recoverable locally.

Metadata

Release files for meds-algorithm-curiosity 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meds-algorithm-curiosity 0.1.2
File Size Uploaded Provenance Actions
meds_algorithm_curiosity-0.1.2.tar.gz 153.1 kB With provenance Details for meds_algorithm_curiosity-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for meds-algorithm-curiosity 0.1.2
File Interpreter ABI Platform Actions
meds_algorithm_curiosity-0.1.2-py3-none-any.whl Python 3 none any Details for meds_algorithm_curiosity-0.1.2-py3-none-any.whl

Total release size: 187.0 kB

Release files / meds_algorithm_curiosity-0.1.2.tar.gz

Download URL meds_algorithm_curiosity-0.1.2.tar.gz
Size 153.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b4bbe19bf2a99704800e64b75ef66cb9bb3f7256aea3d6cfde8cba098d5db896
BLAKE2b-256 checksum
How to use checksums
d9294ac8d7c1cb7c5854955eabbfd830e7052d0e3c6ecd0341fb83908151cb0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Release files / meds_algorithm_curiosity-0.1.2-py3-none-any.whl

Download URL meds_algorithm_curiosity-0.1.2-py3-none-any.whl
Size 33.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3b1d02f7f8715b1785816a0e2a2adb8b210db37892263eeb35482617816f516
BLAKE2b-256 checksum
How to use checksums
637f4d030a44da183cc00818ce25311f2c9ac95c374d5fbf729827318d5445b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

Security for meds-algorithm-curiosity 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for meds_algorithm_curiosity-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page