MedAnvil

Contents

  • Getting Started
    • Prerequisites
      • AWS Permissions
    • ⚠️ Medical AI Safety Notice
    • Installation
      • 1. Clone the repository
      • 2. Create a virtual environment
      • 3. Install dependencies
      • 4. Copy environment files
    • Quick Setup
    • Configuration
      • .env — General config
      • .env.local — Account-specific config
    • First Launch
    • Initial Setup
      • Option A: Configure AWS via environment variables
      • Option B: Configure AWS via the UI
      • Sync existing resources from AWS
    • Docker Setup
    • Quick Start Workflow
      • Step 1 — Connect to AWS
      • Step 2 — Prepare training data in S3
      • Step 3 — Train a model
      • Step 4 — Deploy the model
      • Step 5 — Run inference
      • Step 6 — Monitor (optional)
    • Next Steps
    • Troubleshooting
  • Configuration
    • 1. Environment Files
      • Initial setup
    • 2. General Config (.env)
      • Example .env
    • 3. Account-Specific Config (.env.local)
      • Example .env.local
    • 4. AWS Credentials
      • Method 1: Environment variables (.env or .env.local)
      • Method 2: AWS credentials file (~/.aws/credentials)
      • Method 3: Dashboard UI
      • Credential priority
    • 5. Runtime Config API
      • Response
      • How it works
      • Frontend usage
    • 6. Docker Configuration
      • docker-compose.yml
      • Environment variables in Docker
      • Volume mounts
      • Exposed ports
    • 7. SageMaker IAM Role
      • Role creation script
      • Default role name
      • Trust policy
      • Managed policies attached
      • Inline MLflow policy
      • When to use which approach
      • Creating the role manually
      • After role creation
    • 8. ECR Repositories
      • Repository names
      • Prerequisites
      • Build and push commands
      • What the training image contains
      • After building
      • Verifying images
    • Quick Reference
      • Minimal setup (local development)
      • Full setup (training + deployment)
  • MedML Training Dashboard — User Guide
    • Training Guide
      • Available Models
      • Data Format
      • Launching a SageMaker Training Job
      • MLflow Integration
      • Fine-Tuning from a Previous Job
      • Job Management
      • Custom Models
      • Local Training
    • Deployment Guide
      • Prerequisites
      • Deploy a Model
      • Real-Time vs Async Endpoints
      • Endpoint Scaling
      • Active Endpoint Badge
      • Enable Data Capture at Deploy Time
      • Import an Existing Endpoint
      • Sync from AWS
      • Delete an Endpoint
      • Model Archive Requirements
      • Troubleshooting
    • Inference Guide
      • Prerequisites
      • Invoking an Endpoint
      • Supported Input Formats
      • Response Formats
      • Async Endpoint Inference
      • CLI Tools
      • Troubleshooting
    • Evaluation Guide
      • Prerequisites
      • Test Data Format
      • Submit an Evaluation Job
      • Output Artifacts
      • Viewing Results
      • Sync from AWS
      • Tips
    • Monitoring Guide
      • Overview
      • Step 1 — Enable Data Capture
      • Step 2 — View Captured Traffic (Capture Viewer)
      • Step 3 — Run a Data Quality Baseline
      • Step 4 — Create a Monitoring Schedule
      • Schedule Management
      • Schedule Expressions
      • Troubleshooting
    • Fairness Analysis Guide
      • Overview
      • What It Extracts
      • Running a Fairness Scan
      • Understanding the Results
      • Bias Auditing Workflow
      • Limitations
    • Report Generation Guide
      • Overview
      • Prerequisites
      • Generate a Report
      • Available Sections
      • List Available Jobs
      • Tips
    • Prerequisites
    • Sections
    • Typical Workflow
  • API Reference
    • GET /api/config
    • GET /health
    • /api/aws — AWS Credentials & S3 Browsing
      • GET /api/aws/status
      • POST /api/aws/configure
      • GET /api/aws/buckets
      • GET /api/aws/buckets/{bucket_name}/objects
    • /api/training — Models, Training Jobs, SageMaker
      • GET /api/training/models
      • POST /api/training/models/upload-code
      • POST /api/training/models/import
      • GET /api/training/models/imported
      • GET /api/training/models/imported/{model_id}
      • POST /api/training/start
      • GET /api/training/jobs
      • GET /api/training/jobs/{job_id}
      • GET /api/training/jobs/{job_id}/metrics
      • POST /api/training/jobs/{job_id}/stop
      • POST /api/training/sagemaker/validate
      • POST /api/training/sagemaker/start
      • GET /api/training/sagemaker/jobs
      • GET /api/training/sagemaker/jobs/{job_name}/status
      • POST /api/training/sagemaker/jobs/{job_name}/stop
      • GET /api/training/sagemaker/jobs/{job_name}/result
      • DELETE /api/training/sagemaker/jobs/{job_name}
      • POST /api/training/sagemaker/jobs/{job_name}/archive
      • POST /api/training/sagemaker/jobs/{job_name}/comment
      • DELETE /api/training/sagemaker/jobs/{job_name}/artifacts
      • POST /api/training/sagemaker/finetune
      • GET /api/training/sagemaker/mlflow-url
      • POST /api/training/sagemaker/sync
    • /api/deployment — SageMaker Endpoint Deployment
      • POST /api/deployment/deploy
      • GET /api/deployment/deployments
      • GET /api/deployment/deployments/{endpoint_name}/status
      • DELETE /api/deployment/deployments/{endpoint_name}
      • POST /api/deployment/invoke-async
      • POST /api/deployment/sync
    • /api/inference — Real-time Endpoint Invocation
      • POST /api/inference/invoke
      • POST /api/inference/invoke-local
      • GET /api/inference/endpoints
    • /api/evaluation — Endpoint Evaluation via Processing Jobs
      • POST /api/evaluation/submit
      • GET /api/evaluation/jobs
      • GET /api/evaluation/jobs/{job_name}
      • DELETE /api/evaluation/jobs/{job_name}
      • POST /api/evaluation/jobs/{job_name}/download-results
      • GET /api/evaluation/jobs/{job_name}/plots
      • GET /api/evaluation/jobs/{job_name}/subgroup-metrics
      • POST /api/evaluation/sync
    • /api/monitoring — SageMaker Model Monitor
      • GET /api/monitoring/capture-summary
      • POST /api/monitoring/data-capture
      • POST /api/monitoring/baseline/data-quality
      • POST /api/monitoring/schedules/data-quality
      • POST /api/monitoring/schedules/model-quality
      • GET /api/monitoring/schedules
      • GET /api/monitoring/baselines
      • GET /api/monitoring/schedules/{schedule_name}
      • DELETE /api/monitoring/schedules/{schedule_name}
      • DELETE /api/monitoring/baselines/{job_name}
    • /api/fairness — Demographic Analysis
      • POST /api/fairness/scan
    • /api/report — Paper / Report Generation
      • GET /api/report/jobs
      • POST /api/report/generate
  • Deployment Guide
    • Prerequisites
    • Docker Image Architecture
    • ECR Repository Setup
    • Base Image Authentication
    • Base Image Selection
      • Training image
      • Inference image
    • Building Training Images
      • Using setup.sh (recommended)
      • Using build_and_push.sh
      • Dockerfile.sagemaker structure
    • Building Inference Images
      • Using build_and_push_inference.sh
      • Dockerfile.inference structure
      • model.tar.gz Structure
    • Deploying the Dashboard
      • Local Development
      • Docker (with MLflow + TensorBoard)
      • Using start.sh
      • Production Considerations
    • Transferring to Another Machine
    • Troubleshooting
      • 403 Forbidden during Docker build
      • Image tag not found
      • SageMaker training job fails immediately
      • Endpoint creation stuck in Creating
  • Custom Model Workflow
    • What You Provide (Zip File)
    • The Key Contract: model_def.py
    • MODELS Dict Fields
    • Step-by-Step Workflow
    • Optional Files
      • inference.py (custom serving hooks)
      • train.py (custom training loop)
      • requirements.txt (extra dependencies)
      • sample_config.json (suggested hyperparameters)
    • What You Don’t Need to Worry About
    • Data Format Requirements
      • Classification
      • Segmentation
    • Validation
    • Example: Adding a 3D ResNet for Classification
  • Development Guide
    • Project Structure
    • Code Conventions
      • Schemas
      • Routers
      • Services
      • Error Handling
      • Logging
      • Environment Variables
    • Adding a New Model Architecture
    • Adding a New API Endpoint
      • Step 1: Define the schema (if needed)
      • Step 2: Add service logic
      • Step 3: Add the router endpoint
      • Step 4: Register the router (if new file)
      • Step 5: Add tests
    • Testing
      • Unit Tests (pytest + moto)
      • Integration Tests
    • Security
      • Pre-commit Hook for Secret Detection
      • CI/CD Workflow (scrub-check)
      • Frontend XSS Prevention (escapeHtml)
      • Subresource Integrity (SRI)
      • No Hardcoded Credentials
    • Common Development Tasks
      • Running the app locally
      • Running with Docker
      • Rebuilding SageMaker images after code changes
      • Syncing state from AWS
      • Adding a new JS file
MedAnvil
  • Search


© Copyright 2026, MedAnvil Team.

Built with Sphinx using a theme provided by Read the Docs.