ml-cv-specialist
Deep expertise in ML/CV model selection, training pipelines, and inference architecture. Use when designing machine learning systems, computer vision pipelines, or AI-powered features.
What this skill does
# ML/CV Specialist
Provides specialized guidance for machine learning and computer vision system design, model selection, and production deployment.
## When to Use
- Selecting ML models for specific use cases
- Designing training and inference pipelines
- Optimizing ML system performance and cost
- Evaluating build vs. API for ML capabilities
- Planning data pipelines for ML workloads
## ML System Design Framework
### Model Selection Decision Tree
```
Use Case Identified
│
├─► Text/Language Tasks
│ ├─► Classification → BERT, DistilBERT, or API (OpenAI, Claude)
│ ├─► Generation → GPT-4, Claude, Llama (self-hosted)
│ ├─► Embeddings → OpenAI Ada, sentence-transformers
│ └─► Search/RAG → Vector DB + Embeddings + LLM
│
├─► Computer Vision Tasks
│ ├─► Classification → ResNet, EfficientNet, ViT
│ ├─► Object Detection → YOLOv8, DETR, Faster R-CNN
│ ├─► Segmentation → SAM, Mask R-CNN, U-Net
│ ├─► OCR → Tesseract, PaddleOCR, Cloud Vision API
│ └─► Face Recognition → InsightFace, DeepFace
│
├─► Audio Tasks
│ ├─► Speech-to-Text → Whisper, DeepSpeech, Cloud APIs
│ ├─► Text-to-Speech → ElevenLabs, Coqui TTS
│ └─► Audio Classification → PANNs, AudioSet models
│
└─► Structured Data
├─► Tabular → XGBoost, LightGBM, CatBoost
├─► Time Series → Prophet, ARIMA, Transformer-based
└─► Recommendations → Two-tower, matrix factorization
```
---
## API vs. Self-Hosted Decision
### When to Use APIs
| Factor | API Preferred | Self-Hosted Preferred |
|--------|---------------|----------------------|
| **Volume** | < 10K requests/month | > 100K requests/month |
| **Latency** | > 500ms acceptable | < 100ms required |
| **Customization** | General use case | Domain-specific fine-tuning |
| **Data Privacy** | Non-sensitive data | PII, HIPAA, financial |
| **Team Expertise** | No ML engineers | ML team available |
| **Budget** | Predictable per-call costs | High volume justifies infra |
### Cost Comparison Framework
```markdown
## API Costs (Example: OpenAI GPT-4)
- Input: $0.03/1K tokens
- Output: $0.06/1K tokens
- Average request: 500 input + 200 output tokens
- Cost per request: $0.027
- 100K requests/month: $2,700
## Self-Hosted Costs (Example: Llama 70B)
- GPU instance: $3/hour (A100 40GB)
- Throughput: ~50 requests/minute = 3K/hour
- Cost per request: $0.001
- 100K requests/month: $100 + $500 engineering time
## Break-even Analysis
- < 50K requests: API likely cheaper
- > 50K requests: Self-hosted may be cheaper
- Factor in: engineering time, ops burden, model quality
```
---
## Training Pipeline Architecture
### Standard ML Pipeline
```
┌─────────────────────────────────────────────────────────────┐
│ DATA LAYER │
├─────────────────────────────────────────────────────────────┤
│ Data Sources → ETL → Feature Store → Training Data │
│ (S3, DBs) (Airflow) (Feast) (Versioned) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ TRAINING LAYER │
├─────────────────────────────────────────────────────────────┤
│ Experiment Tracking → Training Jobs → Model Registry │
│ (MLflow, W&B) (SageMaker) (MLflow, S3) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ SERVING LAYER │
├─────────────────────────────────────────────────────────────┤
│ Model Server → Load Balancer → Monitoring │
│ (TorchServe) (K8s/ELB) (Prometheus) │
└─────────────────────────────────────────────────────────────┘
```
### Component Selection Guide
| Component | Options | Recommendation |
|-----------|---------|----------------|
| **Feature Store** | Feast, Tecton, SageMaker | Feast (open source), Tecton (enterprise) |
| **Experiment Tracking** | MLflow, Weights & Biases, Neptune | MLflow (free), W&B (best UX) |
| **Training Orchestration** | Kubeflow, SageMaker, Vertex AI | SageMaker (AWS), Vertex (GCP) |
| **Model Registry** | MLflow, SageMaker, custom S3 | MLflow (standard) |
| **Model Serving** | TorchServe, TFServing, Triton | Triton (multi-framework) |
---
## Inference Architecture Patterns
### Pattern 1: Synchronous API
Best for: Low-latency requirements, simple integration
```
Client → API Gateway → Model Server → Response
│
Load Balancer
│
┌──────┴──────┐
│ │
Model Pod Model Pod
```
**Latency targets**:
- P50: < 100ms
- P95: < 300ms
- P99: < 500ms
### Pattern 2: Asynchronous Processing
Best for: Long-running inference, batch processing
```
Client → API → Queue (SQS) → Worker → Result Store → Webhook/Poll
│
S3/Redis
```
**Use when**:
- Inference > 5 seconds
- Batch processing required
- Variable load patterns
### Pattern 3: Edge Inference
Best for: Privacy, offline capability, ultra-low latency
```
┌─────────────────────────────────────────┐
│ EDGE DEVICE │
│ ┌─────────┐ ┌─────────────────────┐ │
│ │ Camera │───▶│ Optimized Model │ │
│ └─────────┘ │ (ONNX, TFLite) │ │
│ └─────────────────────┘ │
│ │ │
│ Local Result │
└─────────────────────────────────────────┘
│
Sync to Cloud
(non-blocking)
```
**Model optimization for edge**:
- Quantization (INT8): 4x smaller, 2-3x faster
- Pruning: 50-90% sparsity possible
- Distillation: Smaller model, similar accuracy
- ONNX/TFLite: Optimized runtime
---
## Computer Vision Pipeline Design
### Real-Time Video Processing
```
Camera Stream → Frame Extraction → Preprocessing → Model → Postprocessing → Output
│ │ │ │ │
RTSP/ 1-30 FPS Resize, Batch or NMS, tracking,
WebRTC normalize single annotation
```
**Performance optimization**:
- Process every Nth frame (skip frames)
- Resize to model input size early
- Batch frames when latency allows
- Use GPU preprocessing (NVIDIA DALI)
### Object Detection System
```markdown
## Pipeline Components
1. **Input Processing**
- Video decode: FFmpeg, OpenCV
- Frame buffer: Ring buffer for temporal context
- Preprocessing: NVIDIA DALI (GPU), OpenCV (CPU)
2. **Detection**
- Model: YOLOv8 (speed), DETR (accuracy)
- Batch size: 1-8 depending on latency requirements
- Confidence threshold: 0.5-0.7 typical
3. **Post-processing**
- NMS (Non-Maximum Suppression)
- Tracking: SORT, DeepSORT, ByteTrack
- Smoothing: Kalman filter for stable boxes
4. **Output**
- Annotations: Bounding boxes, labels, confidence
- Events: Trigger on detection (webhook, queue)
- Storage: Frame + metadata to S3/DB
```
---
## LLM Integration Patterns
### RAG (Retrieval-Augmented Generation)
```
User Query → Embedding → Vector Search → Context Retrieval → LLM → Response
│
Vector DB
(Pinecone, Weaviate,
Chroma, pgvector)
```
**Vector DB Selection**:
| Database | Best For | Limitations |
|----------|----------|-------------|
| **Pinecone** | Managed, scale | Cost at scale |
| **Weaviate** | Self-hosted, features | Operational overhead |
| **Chroma** | Simple, local dev | Not for production scale |
| **pgvector** | PostgrRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.