AI

AI/ML development patterns and best practices. Trigger: When working with AI/ML development or model training.

odjaramillo 9a993b2 6 files · 14.6 KB Updated

File contents

Critical Patterns

Model Development (REQUIRED)

# ✅ ALWAYS: Version your models and data
from datetime import datetime

model_config = {
    "version": "1.2.0",
    "trained_at": datetime.now().isoformat(),
    "dataset_hash": compute_hash(training_data),
    "hyperparameters": {...}
}

Reproducibility (REQUIRED)

# ✅ ALWAYS: Set seeds for reproducibility
import random
import numpy as np
import torch

def set_seed(seed: int = 42):
    random.seed(seed)
    np.random.seed(seed)
    torch.manual_seed(seed)
    if torch.cuda.is_available():
        torch.cuda.manual_seed_all(seed)

Decision Tree

Need classification?       → Start with simple baseline
Need embeddings?           → Use pre-trained models
Need fine-tuning?          → Start with small learning rate
Need deployment?           → Consider ONNX export
Need monitoring?           → Track drift metrics

Resources

  • ML Development: ml-development.md
  • Cognee Integration: cognee/

odjaramillo/custom-rules/tree/main/registry/skills/ai commit 9a993b2e8c

Frequently asked questions

npx skillmds@latest add odjaramillo/ai