Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
itallstartedwithaidea avatar

Ml Model Integration

  • 53 installs
  • 31 repo stars
  • Updated April 12, 2026
  • itallstartedwithaidea/agent-skills

ML Model Integration is an agent skill that discovers, evaluates, deploys, and fine-tunes HuggingFace Hub models for inference pipelines.

About

ML Model Integration encodes how a solo builder navigates HuggingFace Hub without drowning in architecture jargon or picking a model that violates license or GPU budget. The skill walks discovery—filtering by task such as summarization, classification, or speech—and forces explicit tradeoffs on size, license, and hardware before you commit. Evaluation covers running inference on representative data and recording latency and quality so you can justify a choice in a one-person roadmap. Deployment branches cover the pragmatic paths indie teams use: a local Transformers pipeline for dev, managed Inference API for fast ship, or TGI/vLLM when you need control and throughput. Fine-tuning via LoRA adapters is included for domain-specific tweaks without renting a cluster for weeks. Pair it with your backend or agent-tooling skills when exposing models as API routes or tool calls in Claude Code or Cursor.

  • End-to-end HuggingFace Hub workflow: discovery, evaluation, deployment, and fine-tuning
  • Search and filter models by task type, license, and size against 500,000+ registry entries
  • Compare candidates with benchmark runs measuring latency and output quality
  • Deployment paths: local Transformers, HuggingFace Inference API, TGI, or vLLM self-host
  • LoRA fine-tuning guidance for domain adaptation without full retraining

Ml Model Integration by the numbers

  • 53 all-time installs (skills.sh)
  • +3 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #7,039 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/itallstartedwithaidea/agent-skills --skill ml-model-integration

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs53
repo stars31
Security audit2 / 3 scanners passed
Last updatedApril 12, 2026
Repositoryitallstartedwithaidea/agent-skills

What it does

Find, benchmark, and wire HuggingFace models into your app or agent with sane license, hardware, and deployment choices.

Who is it for?

Best when you're adding ML features to SaaS, agents, or internal tools and want structured HuggingFace selection and deployment—not random notebook copy-paste.

Skip if: Pure research paper reproduction with custom training clusters, or teams with zero interest in HuggingFace ecosystems.

When should I use this skill?

Discovering, evaluating, or deploying HuggingFace models; configuring local or API inference; or planning LoRA fine-tuning for domain adaptation.

What you get

You leave with a justified model choice, an inference configuration (local or API), and optional LoRA fine-tuning steps wired for your stack.

  • Shortlisted models with evaluation notes
  • Inference deployment configuration
  • Fine-tuning plan when domain adaptation is required

By the numbers

  • 500,000+ models on HuggingFace Hub

Files

SKILL.mdMarkdownGitHub ↗

ML Model Integration

Part of Agent Skills™ by googleadsagent.ai™

Description

ML Model Integration provides workflows for discovering, evaluating, and deploying machine learning models from HuggingFace Hub. The agent searches the model registry by task type, evaluates candidates on benchmark datasets, configures inference pipelines for local or API-based execution, and orchestrates fine-tuning workflows for domain adaptation.

HuggingFace Hub hosts 500,000+ models across hundreds of task types: text generation, image classification, object detection, speech recognition, translation, summarization, and more. Navigating this landscape requires understanding model architectures, license compatibility, hardware requirements, and benchmark performance. This skill encodes that knowledge, helping the agent select the right model for the right task at the right cost.

The skill covers the complete model lifecycle: discovery (searching by task, filtering by license and size), evaluation (running inference on test data, measuring latency and quality), deployment (local Transformers pipeline, HuggingFace Inference API, or self-hosted with TGI/vLLM), and fine-tuning (LoRA adapters for domain-specific customization with minimal training data).

Use When

  • Selecting a model for a specific ML task (classification, generation, detection)
  • Setting up inference pipelines locally or via API
  • Fine-tuning a pre-trained model on domain-specific data
  • Evaluating model quality against custom benchmarks
  • Deploying models to production with optimized serving
  • The user asks about HuggingFace, Transformers, or model selection

How It Works

graph TD
    A[Task Definition] --> B[Search HuggingFace Hub]
    B --> C[Filter: License, Size, Downloads]
    C --> D[Shortlist Top-3 Candidates]
    D --> E[Evaluate on Benchmark Data]
    E --> F{Quality Sufficient?}
    F -->|Yes| G[Deploy as Inference Pipeline]
    F -->|No| H[Fine-tune with LoRA]
    H --> I[Evaluate Fine-tuned Model]
    I --> G
    G --> J{Deployment Target}
    J -->|Local| K[Transformers Pipeline]
    J -->|API| L[HuggingFace Inference API]
    J -->|Self-Hosted| M[TGI / vLLM Server]

The workflow starts with task definition, not model selection. The agent searches for models matching the task, evaluates candidates, and only resorts to fine-tuning if off-the-shelf performance is insufficient.

Implementation

from transformers import pipeline, AutoModelForSequenceClassification, AutoTokenizer
from huggingface_hub import HfApi, ModelFilter
from peft import LoraConfig, get_peft_model, TaskType
import torch

def discover_models(task: str, min_downloads: int = 1000, license: str = "apache-2.0") -> list[dict]:
    api = HfApi()
    models = api.list_models(
        filter=ModelFilter(task=task, library="transformers"),
        sort="downloads",
        direction=-1,
        limit=20,
    )
    results = []
    for m in models:
        if m.downloads >= min_downloads:
            results.append({
                "id": m.modelId,
                "downloads": m.downloads,
                "likes": m.likes,
                "tags": m.tags,
                "pipeline_tag": m.pipeline_tag,
            })
    return results[:10]

def setup_inference(model_id: str, task: str, device: str = "auto") -> pipeline:
    return pipeline(
        task=task,
        model=model_id,
        device_map=device,
        torch_dtype=torch.float16,
    )

def evaluate_model(pipe, test_data: list[dict], label_key: str = "label") -> dict:
    correct = 0
    total = len(test_data)
    latencies = []

    for item in test_data:
        import time
        start = time.time()
        pred = pipe(item["text"])
        latencies.append((time.time() - start) * 1000)

        if pred[0]["label"] == item[label_key]:
            correct += 1

    return {
        "accuracy": correct / total,
        "avg_latency_ms": sum(latencies) / len(latencies),
        "p95_latency_ms": sorted(latencies)[int(0.95 * len(latencies))],
        "total_samples": total,
    }

def finetune_lora(
    base_model: str,
    train_dataset,
    output_dir: str,
    num_epochs: int = 3,
    lora_rank: int = 16,
):
    model = AutoModelForSequenceClassification.from_pretrained(base_model)
    tokenizer = AutoTokenizer.from_pretrained(base_model)

    lora_config = LoraConfig(
        task_type=TaskType.SEQ_CLS,
        r=lora_rank,
        lora_alpha=32,
        lora_dropout=0.1,
        target_modules=["q_proj", "v_proj"],
    )
    model = get_peft_model(model, lora_config)
    trainable = sum(p.numel() for p in model.parameters() if p.requires_grad)
    total = sum(p.numel() for p in model.parameters())
    print(f"Trainable: {trainable:,} / {total:,} ({100 * trainable / total:.1f}%)")

    from transformers import Trainer, TrainingArguments
    args = TrainingArguments(
        output_dir=output_dir,
        num_train_epochs=num_epochs,
        per_device_train_batch_size=8,
        learning_rate=2e-4,
        save_strategy="epoch",
        logging_steps=50,
        fp16=True,
    )
    trainer = Trainer(model=model, args=args, train_dataset=train_dataset, tokenizer=tokenizer)
    trainer.train()
    model.save_pretrained(output_dir)

Best Practices

  • Always define the task before searching for models—do not pick a model and find a task for it
  • Filter by license compatibility (Apache-2.0, MIT) before evaluating performance
  • Evaluate on your own data, not just published benchmarks—domain matters
  • Use LoRA for fine-tuning to reduce training cost by 90% versus full fine-tuning
  • Quantize models (GPTQ, AWQ, bitsandbytes) for inference on consumer hardware
  • Pin model revisions by commit hash to ensure reproducible inference

Platform Compatibility

PlatformSupportNotes
CursorFullPython + Transformers
VS CodeFullJupyter + ML tooling
WindsurfFullML workflow support
Claude CodeFullPipeline script generation
ClineFullModel integration
aiderPartialCode generation only

Related Skills

  • Programmatic Video
  • Web Asset Generation
  • React Best Practices
  • Batch Processing

Keywords

huggingface transformers model-selection inference-pipeline fine-tuning lora model-evaluation ml-deployment

---

© 2026 googleadsagent.ai™ | Agent Skills™ | MIT License

Related skills

How it compares

Structured model lifecycle skill for HuggingFace—not a single-purpose MCP connector or a generic "call OpenAI" integration.

FAQ

Who is ml-model-integration for?

Developers integrating pretrained or fine-tuned models from HuggingFace into apps, APIs, or agent tools with clear evaluation and deploy steps.

When should I use ml-model-integration?

In Build when adding ML inference; in Ship when hardening deployment and latency; in Operate when switching hosting (API vs self-hosted TGI/vLLM) or adapting models with LoRA.

Is ml-model-integration safe to install?

Model pulls and API keys can touch network and secrets—check the Security Audits panel on this page and restrict agent permissions before running deploy commands.

AI & Agent Buildingllmautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.