← Back to Home

📖 WarpGBM MCP Usage Guide

Complete guide for developers and AI agents

💡 Want the Python package? For production ML workflows, use WarpGBM directly (91+ ⭐) | Python Agent Guide

🚀 Quick Start

Train a model in 3 steps:

1. Check Service Health

curl https://warpgbm.ai/healthz

2. Train a Model

curl -X POST https://warpgbm.ai/train \
  -H "Content-Type: application/json" \
  -d '{
    "X": [[1,2,3], [4,5,6], [7,8,9]],
    "y": [0, 1, 2],
    "model_type": "lightgbm",
    "objective": "multiclass",
    "num_class": 3,
    "num_trees": 100
  }'

3. Make Predictions

curl -X POST https://warpgbm.ai/predict_from_artifact \
  -H "Content-Type: application/json" \
  -d '{
    "artifact_id": "<artifact_id_from_training>",
    "X": [[2,3,4], [5,6,7]]
  }'

🐍 MCP Service vs Python Package

Feature MCP Service Python Package
Install None needed pip install git+...
GPU Cloud (pay-per-use) Your GPU (free)
Features Train, predict, upload Full API + cross-val + feature importance
Best For Quick experiments Production pipelines

View WarpGBM on GitHub →

🔧 Available Endpoints

GET /healthz

Check service health and GPU availability

GET /models

List all available model backends (warpgbm, lightgbm)

POST /train

Train a gradient boosting model. Returns a portable model artifact.

Required: X, y

Optional: model_type, objective, num_trees, learning_rate, etc.

POST /predict_from_artifact

Make predictions using a trained model artifact.

Required: X, and either artifact_id or model_artifact

POST /upload_data

Upload CSV or Parquet files for training. Returns structured X and y arrays.

Required: file_content (base64), file_format, target_column

POST /feedback

Submit feedback about the service (bugs, feature requests, etc.)

Required: feedback_type, message

🤖 Model Types

WarpGBM (GPU)

LightGBM (CPU)

📊 Working with Large Datasets

For datasets too large to send as JSON arrays, use the data upload endpoint:

Upload CSV Example

import base64
import requests

# Read your CSV file
with open('data.csv', 'rb') as f:
    file_content = base64.b64encode(f.read()).decode()

response = requests.post(
    'https://warpgbm.ai/upload_data',
    json={
        'file_content': file_content,
        'file_format': 'csv',
        'target_column': 'target',
        'feature_columns': ['feat1', 'feat2', 'feat3']  # optional
    }
)

# Response includes X, y arrays ready for training
data = response.json()
print(f"Loaded {data['num_samples']} samples, {data['num_features']} features")

💰 X402 Payment Protocol

This service supports X402 micropayments on Base network:

Payment is optional for demo/testing. See /.well-known/x402 for details.

🔗 MCP Integration

For AI agents using the MCP protocol:

❓ Need Help?

Resources: