All Cheat Sheets

AI/ML Cheat Sheet

Multi-cloud reference for AWS, Azure, and Google Cloud AI/ML services

Amazon SageMaker

AWS

Key Commands & CLI Operations

CommandDescription
aws sagemaker create-training-job --training-job-name xgb-model-1 --algorithm-specification TrainingImage=IMAGE_URI,TrainingInputMode=File --role-arn ROLE_ARN --input-data-config file://input.json --output-data-config S3OutputPath=s3://bkt/models/ --resource-config InstanceType=ml.m5.2xlarge,InstanceCount=1,VolumeSizeInGB=30 --stopping-condition MaxRuntimeInSeconds=3600Submit distributed ML model training job
aws sagemaker create-endpoint-config --endpoint-config-name ep-cfg-v1 --production-variants VariantName=AllTraffic,ModelName=my-model,InitialInstanceCount=1,InstanceType=ml.t2.mediumCreate endpoint deployment config
aws sagemaker create-endpoint --endpoint-name prod-endpoint --endpoint-config-name ep-cfg-v1Deploy real-time inference endpoint

Architectural Key Facts

  • Comprehensive end-to-end MLOps platform for preparing, building, training, tuning, and deploying ML models.
  • SageMaker Studio provides fully managed web-based IDEs with collaborative Jupyter notebooks.
  • SageMaker Autopilot automatically trains and tunes the best machine learning models with full Python code transparency.
  • Managed Spot Training reduces model training costs by up to 90% using EC2 spot instances and automatic checkpointing.
  • Real-time endpoints support automated autoscaling, multi-model endpoints (MME), and Serverless Inference for intermittent traffic.

Production Limits & Quotas

Item / DimensionLimit / Quota
Real-time endpoint synchronous payload limit6 MB (use Asynchronous Inference for up to 1 GB)
Synchronous invocation timeout60 seconds
Max training job duration30 days

Amazon Bedrock

AWS

Key Commands & CLI Operations

CommandDescription
aws bedrock list-foundation-models --by-provider anthropicList available foundation models
aws bedrock-runtime invoke-model --model-id anthropic.claude-3-sonnet-20240229-v1:0 --body '{"anthropic_version":"bedrock-2023-05-31","max_tokens":1000,"messages":[{"role":"user","content":"Summarize data engineering"}]}' response.jsonInvoke Claude foundation model

Architectural Key Facts

  • Fully managed service offering leading foundation models (FMs) from AI21, Anthropic, Cohere, Meta, Mistral, and Amazon via unified API.
  • Serverless execution with no infrastructure to manage; enterprise security ensures prompts and data are never used to train base models.
  • Bedrock Knowledge Bases connects FMs directly to enterprise data sources in S3, OpenSearch, and Aurora for automated RAG.
  • Bedrock Agents orchestrate multi-step business workflows by breaking user requests into reasoning steps and invoking APIs.
  • Bedrock Guardrails enforces content filters, PII redaction, and prompt injection defense across all LLM interactions.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max input context windowUp to 200k+ tokens depending on model architecture
Streaming responsesSupported via `InvokeModelWithResponseStream`

Azure Machine Learning

Azure

Key Commands & CLI Operations

CommandDescription
az ml workspace create -g myrg -n ml-workspaceCreate Azure ML workspace
az ml job create -f job.yml -g myrg -w ml-workspaceSubmit automated ML training pipeline job
az ml online-endpoint create -n inference-ep -g myrg -w ml-workspaceDeploy real-time managed online endpoint

Architectural Key Facts

  • Enterprise-grade MLOps platform for automated machine learning, custom model training, deployment, and lifecycle governance.
  • Automated ML (AutoML) explores algorithms, engineers features, and tunes hyperparameters with full explainability and code transparency.
  • Managed Online Endpoints handle real-time scoring with built-in Blue/Green traffic splitting and autoscaling.
  • Responsible AI dashboard evaluates model fairness, error analysis, data drift, and counterfactuals.
  • Integrates natively with MLflow for tracking experiment metrics, artifact storage, and model registration.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max endpoints per workspace100 online endpoints (expandable)
Payload size limit for online scoring10 MB
Pipeline execution timeout30 days

Azure OpenAI Service

Azure

Key Commands & CLI Operations

CommandDescription
az cognitiveservices account create -n openai-hub -g myrg --kind OpenAI --sku S0 -l eastusProvision Azure OpenAI service account
az cognitiveservices account deployment create -g myrg -n openai-hub --deployment-name gpt-4o --model-name gpt-4o --model-version '2024-05-13' --model-format OpenAI --sku-capacity 50 --sku-name StandardDeploy GPT-4o model with provisioned throughput

Architectural Key Facts

  • Provides REST API access to OpenAI's powerful language models (GPT-4o, GPT-4 Turbo, DALL-E, Whisper, Embeddings).
  • Enterprise security guarantees: Customer prompts and training data are never shared with other customers or used to train OpenAI base models.
  • Virtual network private endpoints and Microsoft Entra ID authentication protect API access behind corporate boundaries.
  • Azure AI Content Safety provides built-in detection and mitigation of harmful content, jailbreak attempts, and hate speech.
  • Provisioned Throughput Units (PTUs) provide predictable, reserved model capacity for latency-sensitive mission-critical applications.

Production Limits & Quotas

Item / DimensionLimit / Quota
Standard TPM (Tokens Per Minute)Varies by model tier (e.g. 50k to 500k TPM soft quota)
Max prompt context windowUp to 128k tokens on GPT-4o

Vertex AI

Google Cloud
Explore Deep Dive Guide

Key Commands & CLI Operations

CommandDescription
gcloud ai endpoints create --display-name=my-endpoint --region=us-central1Create an endpoint
gcloud ai models upload --display-name=my-model --container-image-uri=... --region=us-central1Upload a model
gcloud ai endpoints deploy-model ENDPOINT_ID --model=MODEL_ID --region=us-central1Deploy model to endpoint
gcloud ai custom-jobs create --display-name=my-job --worker-pool-spec=... --region=us-central1Submit custom training job

Architectural Key Facts

  • Unified platform for MLOps: build, deploy, and scale machine learning models.
  • Includes Vertex Feature Store for organizing and serving ML features.
  • Vertex Model Registry acts as a central repository for lifecycle management of models.
  • Supports both custom training with any framework (TensorFlow, PyTorch, Scikit-learn) and AutoML.
  • Generative AI Studio integrated for PaLM/Gemini model fine-tuning and prompting.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max endpoints per project100
Max models per project100
Max online prediction payload size1.5 MB

AutoML

Google Cloud
Explore Deep Dive Guide

Key Commands & CLI Operations

CommandDescription
gcloud ai datasets create --display-name=my-dataset --metadata-schema-uri=... --region=us-central1Create Vertex dataset
gcloud ai datasets import DATASET_ID --import-files=gs://bucket/data.csv --region=us-central1Import data for AutoML

Architectural Key Facts

  • Train high-quality models with minimal machine learning expertise.
  • Supports Vision (Image classification/Object detection), Video, Natural Language, and Tabular data.
  • Automatically performs feature engineering, model selection, and hyperparameter tuning.
  • Models can be exported to Edge devices (AutoML Edge) or deployed to the cloud.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max nodes for Tabular trainingDepends on budget (1-1000 node hours)
Max rows in Tabular dataset100 million
Max image size for Vision30 MB

Vertex AI Pipelines

Google Cloud
Explore Deep Dive Guide

Key Commands & CLI Operations

CommandDescription
gcloud ai pipeline-jobs submit --pipeline-spec=pipeline.json --display-name=my-pipeline --region=us-central1Submit a pipeline job
gcloud ai pipeline-jobs describe JOB_ID --region=us-central1View pipeline details
gcloud ai pipeline-jobs cancel JOB_ID --region=us-central1Cancel a running pipeline

Architectural Key Facts

  • Serverless MLOps orchestration for building repeatable ML pipelines.
  • Supports pipelines compiled with Kubeflow Pipelines (KFP) SDK or TensorFlow Extended (TFX).
  • Automatically tracks metadata (Artifacts, Executions) in Vertex ML Metadata.
  • Highly cost-effective: you only pay for the compute used by the pipeline steps, not for the orchestration itself.

Production Limits & Quotas

Item / DimensionLimit / Quota
Max pipeline parameters100
Max artifact size passed via metadata10 MB (use GCS for large files)
Max pipeline execution duration7 days