All Cheat Sheets
Explore Deep Dive Guide
Explore Deep Dive Guide
Explore Deep Dive Guide
AI/ML Cheat Sheet
Multi-cloud reference for AWS, Azure, and Google Cloud AI/ML services
AI/ML — Multi-Cloud Cheat Sheet
Cloud Arena | cloudarena.com
Amazon SageMaker
AWSKey Commands & CLI Operations
| Command | Description | |
|---|---|---|
| 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=3600 | Submit 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.medium | Create endpoint deployment config | |
| aws sagemaker create-endpoint --endpoint-name prod-endpoint --endpoint-config-name ep-cfg-v1 | Deploy 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 / Dimension | Limit / Quota |
|---|---|
| Real-time endpoint synchronous payload limit | 6 MB (use Asynchronous Inference for up to 1 GB) |
| Synchronous invocation timeout | 60 seconds |
| Max training job duration | 30 days |
Amazon Bedrock
AWSKey Commands & CLI Operations
| Command | Description | |
|---|---|---|
| aws bedrock list-foundation-models --by-provider anthropic | List 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.json | Invoke 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 / Dimension | Limit / Quota |
|---|---|
| Max input context window | Up to 200k+ tokens depending on model architecture |
| Streaming responses | Supported via `InvokeModelWithResponseStream` |
Azure Machine Learning
AzureKey Commands & CLI Operations
| Command | Description | |
|---|---|---|
| az ml workspace create -g myrg -n ml-workspace | Create Azure ML workspace | |
| az ml job create -f job.yml -g myrg -w ml-workspace | Submit automated ML training pipeline job | |
| az ml online-endpoint create -n inference-ep -g myrg -w ml-workspace | Deploy 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 / Dimension | Limit / Quota |
|---|---|
| Max endpoints per workspace | 100 online endpoints (expandable) |
| Payload size limit for online scoring | 10 MB |
| Pipeline execution timeout | 30 days |
Azure OpenAI Service
AzureKey Commands & CLI Operations
| Command | Description | |
|---|---|---|
| az cognitiveservices account create -n openai-hub -g myrg --kind OpenAI --sku S0 -l eastus | Provision 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 Standard | Deploy 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 / Dimension | Limit / Quota |
|---|---|
| Standard TPM (Tokens Per Minute) | Varies by model tier (e.g. 50k to 500k TPM soft quota) |
| Max prompt context window | Up to 128k tokens on GPT-4o |
Vertex AI
Google CloudKey Commands & CLI Operations
| Command | Description | |
|---|---|---|
| gcloud ai endpoints create --display-name=my-endpoint --region=us-central1 | Create an endpoint | |
| gcloud ai models upload --display-name=my-model --container-image-uri=... --region=us-central1 | Upload a model | |
| gcloud ai endpoints deploy-model ENDPOINT_ID --model=MODEL_ID --region=us-central1 | Deploy model to endpoint | |
| gcloud ai custom-jobs create --display-name=my-job --worker-pool-spec=... --region=us-central1 | Submit 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 / Dimension | Limit / Quota |
|---|---|
| Max endpoints per project | 100 |
| Max models per project | 100 |
| Max online prediction payload size | 1.5 MB |
AutoML
Google CloudKey Commands & CLI Operations
| Command | Description | |
|---|---|---|
| gcloud ai datasets create --display-name=my-dataset --metadata-schema-uri=... --region=us-central1 | Create Vertex dataset | |
| gcloud ai datasets import DATASET_ID --import-files=gs://bucket/data.csv --region=us-central1 | Import 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 / Dimension | Limit / Quota |
|---|---|
| Max nodes for Tabular training | Depends on budget (1-1000 node hours) |
| Max rows in Tabular dataset | 100 million |
| Max image size for Vision | 30 MB |
Vertex AI Pipelines
Google CloudKey Commands & CLI Operations
| Command | Description | |
|---|---|---|
| gcloud ai pipeline-jobs submit --pipeline-spec=pipeline.json --display-name=my-pipeline --region=us-central1 | Submit a pipeline job | |
| gcloud ai pipeline-jobs describe JOB_ID --region=us-central1 | View pipeline details | |
| gcloud ai pipeline-jobs cancel JOB_ID --region=us-central1 | Cancel 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 / Dimension | Limit / Quota |
|---|---|
| Max pipeline parameters | 100 |
| Max artifact size passed via metadata | 10 MB (use GCS for large files) |
| Max pipeline execution duration | 7 days |