Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>ML GuardNew to Visual Studio Code? Get it now.
ML Guard

ML Guard

Shubham Shrivas

|
1 install
| (0) | Free
A specialized VS Code extension for AI/ML Engineers, Data Scientists, and MLOps Engineers to detect common mistakes in Python ML projects.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ML Guard

A specialized VS Code extension for AI/ML Engineers, Data Scientists, and MLOps Engineers to detect common mistakes in Python ML projects.

Features

  • Workspace Scanning: Analyze all Python files in your workspace
  • File Scanning: Scan individual Python files
  • ML-Specific Checks: Detect data leakage, missing validation, poor practices
  • Scoring System: Get a score from 0-100 based on code quality
  • Auto Fixes: Apply safe automatic fixes for common issues
  • Export Reports: Generate JSON, Markdown, or HTML reports
  • Dashboard: Interactive webview dashboard

Installation

  1. Clone this repository
  2. Run npm install in the extension directory
  3. Press F5 to launch extension development host
  4. The extension will be installed in the development environment

Usage

Commands

  • ML Guard: Scan Workspace - Scan all Python files in workspace
  • ML Guard: Scan Current File - Scan the currently open Python file
  • ML Guard: Export Report - Export scan results
  • ML Guard: Auto Fix Safe Issues - Apply automatic fixes
  • ML Guard: Open Dashboard - Open the interactive dashboard

Context Menu

Right-click on any Python file in the explorer and select "Scan with ML Guard".

Configuration

Configure ML Guard through VS Code settings:

  • mlguard.pythonPath: Path to Python executable
  • mlguard.autoScan: Automatically scan files on save
  • mlguard.severityFilter: Filter issues by severity
  • mlguard.enableFastAPIChecks: Enable FastAPI checks
  • mlguard.enableTorchChecks: Enable PyTorch checks

Checks Performed

Data Science

  • Target column used in features
  • Data leakage after scaling
  • Missing null handling
  • Duplicate rows ignored
  • No feature encoding

ML Checks

  • Missing train_test_split
  • No random_state
  • No cross validation
  • No metrics calculation
  • Accuracy only on imbalanced data

Deep Learning

  • model.train()/eval() misuse
  • No torch.no_grad()
  • GPU not used when available
  • Missing seed
  • No checkpoint saving

FastAPI Model Serving

  • Model loaded on every request
  • No startup preload
  • No health endpoint
  • No exception handling
  • Blocking inference

MLOps

  • requirements.txt missing
  • No Dockerfile
  • No tests
  • No logging
  • No MLflow/model registry

Performance

  • pandas iterrows loops
  • Nested loops
  • Repeated file reads
  • Unnecessary copies

Publishing

  1. Update package.json with your publisher name
  2. Run vsce package to create .vsix file
  3. Run vsce publish to publish to marketplace

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft