梯度提升云服务

WarpGBM MCP 是一项基于GPU加速的梯度提升决策树(GBDT)云服务,提供快速训练和预测功能,适用于AI代理和开发者进行机器学习和数据分析。

  • by jefferythewind
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 jefferythewind/warpgbm-mcp-service

使用说明

⚡ WarpGBM MCP 服务

GPU加速的梯度提升作为云MCP服务
在A10G GPU上进行训练 • 获取 artifact_id 对于<100ms的缓存预测 • 下载便携式工件

🌐 实时服务 • API 文档 • 🤖 代理指南 • 🐍 Python 包


🎯 这是什么?

将您的GBDT工作负载外包给世界上最快的GPU实现方案。

WarpGBM MCP是一种 无状态云服务 这使得AI代理能够即时访问GPU加速的梯度提升算法。基于 WarpGBM (91+ ⭐),此服务支持在NVIDIA A10G GPU上进行训练,同时您可获取便携式模型文件,并享受智能5分钟缓存带来的便利。

🏗️ 工作原理(智能缓存工作流程)

graph LR
    A[Train on GPU] --> B[Get artifact_id + model]
    B --> C[5min Cache]
    C --> D[<100ms Predictions]
    B --> E[Download Artifact]
    E --> F[Use Anywhere]
  1. 火车提交您的数据 → 在A10G GPU上训练 → 获取结果 artifact_id + 便携式文物
  2. 快速路径使用 artifact_id → 低于100毫秒的缓存预测(有效期5分钟)
  3. 慢行道使用 model_artifact_joblib → 任意地点下载并使用

建筑学🔒 无状态 • 🚀 无需模型存储 • 💾 您拥有自己的成果


⚡ 快速启动

对于人工智能代理(MCP)

添加到您的MCP设置中(例如。, .cursor/mcp.json):

{
  "mcpServers": {
    "warpgbm": {
      "url": "https://warpgbm.ai/mcp/sse"
    }
  }
}

开发者(REST API)

# 1. Train a model
curl -X POST https://warpgbm.ai/train \
  -H "Content-Type: application/json" \
  -d '{
    "X": [[5.1,3.5,1.4,0.2], [6.7,3.1,4.4,1.4], ...],
    "y": [0, 1, 2, ...],
    "model_type": "warpgbm",
    "objective": "multiclass"
  }'

# Response includes artifact_id for fast predictions
# {"artifact_id": "abc-123", "model_artifact_joblib": "H4sIA..."}

# 2. Make fast predictions (cached, <100ms)
curl -X POST https://warpgbm.ai/predict_from_artifact \
  -H "Content-Type: application/json" \
  -d '{
    "artifact_id": "abc-123",
    "X": [[5.0,3.4,1.5,0.2]]
  }'

🚀 主要特点

特性 描述
🎯 多模型 WarpGBM(GPU)+ LightGBM(CPU)
⚡ 智能缓存 artifact_id → 5分钟缓存 → <100毫秒推理时间
📦(一个包裹或箱子的图标) 便携式文物 下载joblib模型,随处可用
🤖 MCP Native 为AI代理提供直接工具集成
💰 X402 支付 可选的微支付(基础网络)
🔒 无状态的 无数据存储,模型归您所有
🌐 已准备好投入生产 在 Modal 上部署,使用自定义域名

🐍 Python 包与 MCP 服务

这个仓库是MCP服务的封装(或包装)层。 对于生产级机器学习工作流程,建议考虑使用 WarpGBM Python 包 直接地;直接

特性 MCP 服务(本仓库) Python 包
--------- ------------------------ ----------------
** ** GPU
云端(按使用量付费) 您的GPU(免费) **
REST API 参数 完整的 Python API ** ** 特点/功能
训练、预测、上传 + 交叉验证、回调函数、特征重要性 **
快速实验、演示 生产管线、研究 **

**| 每次训练0.01美元 | 免费(您的硬件) |**使用此MCP服务来
快速测试、原型制作,无本地GPU的代理使用Python包来


生产机器学习(或生产中的机器学习应用)、研究、成本节约、全面掌控

📡 可用的终端节点

核心端点 | 方法 | 终点 | 描述 | |--------|----------|-------------| GET | /models | | 列出可用的模型后端 | POST | /train | | 训练模型,获取artifact_id + 模型 | POST | /predict_from_artifact | | 快速预测(artifact_id 或模型) | POST | /predict_proba_from_artifact | | 概率预测 | POST | /upload_data | | 上传CSV/Parquet文件用于训练 | POST | /feedback | | 提交反馈以改进服务 | GET | /healthz |

| 带GPU状态的健康检查 |

MCP集成 | 方法 | 终点 | 描述 | |--------|----------|-------------| SSE | /mcp/sse | | MCP Server-Sent Events 端点 | GET | /.well-known/mcp.json | | MCP能力清单 | GET | /.well-known/x402 |


| X402 价格清单 |

# 1. Train WarpGBM on Iris (60 samples recommended for proper binning)
curl -X POST https://warpgbm.ai/train \
  -H "Content-Type: application/json" \
  -d '{
  "X": [[5.1,3.5,1.4,0.2], [4.9,3,1.4,0.2], [4.7,3.2,1.3,0.2], [4.6,3.1,1.5,0.2], [5,3.6,1.4,0.2],
        [7,3.2,4.7,1.4], [6.4,3.2,4.5,1.5], [6.9,3.1,4.9,1.5], [5.5,2.3,4,1.3], [6.5,2.8,4.6,1.5],
        [6.3,3.3,6,2.5], [5.8,2.7,5.1,1.9], [7.1,3,5.9,2.1], [6.3,2.9,5.6,1.8], [6.5,3,5.8,2.2],
        [7.6,3,6.6,2.1], [4.9,2.5,4.5,1.7], [7.3,2.9,6.3,1.8], [6.7,2.5,5.8,1.8], [7.2,3.6,6.1,2.5],
        [5.1,3.5,1.4,0.2], [4.9,3,1.4,0.2], [4.7,3.2,1.3,0.2], [4.6,3.1,1.5,0.2], [5,3.6,1.4,0.2],
        [7,3.2,4.7,1.4], [6.4,3.2,4.5,1.5], [6.9,3.1,4.9,1.5], [5.5,2.3,4,1.3], [6.5,2.8,4.6,1.5],
        [6.3,3.3,6,2.5], [5.8,2.7,5.1,1.9], [7.1,3,5.9,2.1], [6.3,2.9,5.6,1.8], [6.5,3,5.8,2.2],
        [7.6,3,6.6,2.1], [4.9,2.5,4.5,1.7], [7.3,2.9,6.3,1.8], [6.7,2.5,5.8,1.8], [7.2,3.6,6.1,2.5],
        [5.1,3.5,1.4,0.2], [4.9,3,1.4,0.2], [4.7,3.2,1.3,0.2], [4.6,3.1,1.5,0.2], [5,3.6,1.4,0.2],
        [7,3.2,4.7,1.4], [6.4,3.2,4.5,1.5], [6.9,3.1,4.9,1.5], [5.5,2.3,4,1.3], [6.5,2.8,4.6,1.5],
        [6.3,3.3,6,2.5], [5.8,2.7,5.1,1.9], [7.1,3,5.9,2.1], [6.3,2.9,5.6,1.8], [6.5,3,5.8,2.2],
        [7.6,3,6.6,2.1], [4.9,2.5,4.5,1.7], [7.3,2.9,6.3,1.8], [6.7,2.5,5.8,1.8], [7.2,3.6,6.1,2.5]],
  "y": [0,0,0,0,0, 1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,
        0,0,0,0,0, 1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,
        0,0,0,0,0, 1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2],
  "model_type": "warpgbm",
  "objective": "multiclass",
  "n_estimators": 100
}'

# Response:
{
  "artifact_id": "abc123-def456-ghi789",
  "model_artifact_joblib": "H4sIA...",
  "training_time_seconds": 0.0
}

# 2. Fast inference with cached artifact_id (<100ms)
curl -X POST https://warpgbm.ai/predict_from_artifact \
  -H "Content-Type: application/json" \
  -d '{
  "artifact_id": "abc123-def456-ghi789",
  "X": [[5,3.4,1.5,0.2], [6.7,3.1,4.4,1.4], [7.7,3.8,6.7,2.2]]
}'

# Response: {"predictions": [0, 1, 2], "inference_time_seconds": 0.05}
# Perfect classification! ✨

💡 完整示例:鸢尾花数据集⚠️ 重要 WarpGBM使用分位数分箱,这需要 60多个样本


为了进行适当的训练。样本数量较少时,模型无法学习到正确的决策边界。

🏠 自建服务器/自我托管

# Clone repo
git clone https://github.com/jefferythewind/mcp-warpgbm.git
cd mcp-warpgbm

# Setup environment
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

# Run locally (GPU optional for dev)
uvicorn local_dev:app --host 0.0.0.0 --port 8000 --reload

# Test
curl http://localhost:8000/healthz

本地开发

# Install Modal
pip install modal

# Authenticate
modal token new

# Deploy
modal deploy modal_app.py

# Service will be live at your Modal URL

部署到 Modal(生产环境)

# Docker (requires GPU)
docker build -t warpgbm-mcp .
docker run --gpus all -p 8000:8000 warpgbm-mcp

# Fly.io, Railway, Render, etc.
# See their respective GPU deployment docs

部署到其他平台

# Install dev dependencies
pip install -r requirements-dev.txt

# Run all tests
./run_tests.sh

# Or use pytest directly
pytest tests/ -v

# Test specific functionality
pytest tests/test_train.py -v
pytest tests/test_integration.py -v

🧪 测试

mcp-warpgmb/
├── app/
│   ├── main.py              # FastAPI app + routes
│   ├── mcp_sse.py           # MCP Server-Sent Events
│   ├── model_registry.py    # Model backend registry
│   ├── models.py            # Pydantic schemas
│   ├── utils.py             # Serialization, caching
│   ├── x402.py              # Payment verification
│   └── feedback_storage.py  # Feedback persistence
├── .well-known/
│   ├── mcp.json             # MCP capability manifest
│   └── x402                 # X402 pricing manifest
├── docs/
│   ├── AGENT_GUIDE.md       # Comprehensive agent docs
│   ├── MODEL_SUPPORT.md     # Model parameter reference
│   └── WARPGBM_PYTHON_GUIDE.md
├── tests/
│   ├── test_train.py
│   ├── test_predict.py
│   ├── test_integration.py
│   └── conftest.py
├── examples/
│   ├── simple_train.py
│   └── compare_models.py
├── modal_app.py             # Modal deployment config
├── local_dev.py             # Local dev server
├── requirements.txt
└── README.md

📦 项目结构

💰 价格(X402)

Base网络上的可选微支付: | 终点 | 价格 | 描述 | |----------|-------|-------------| /train | | 0.01美元 | 在GPU上训练模型,获取成果物 | /predict_from_artifact | | $0.001 | 批量预测 | /predict_proba_from_artifact | | $0.001 | 概率预测 | /feedback |

**| 免费 | 帮助我们改进! |**注 /.well-known/x402 演示/测试时付款可选。请参阅


详情如下。

🔐 安全与隐私 **✅**无状态的
没有持久化的训练数据或模型 **✅ 翻译成中文是:✓(正确/对)**沙盒化的
在临时隔离的目录中运行 **✅**数量有限
最大请求负载50 MB **✅**无代码执行
仅支持结构化JSON参数 **✅**速率受限
按IP限制速率以防止滥用 **✅**只读文件系统


模式部署使用不可变文件系统

🌍 可用模型

  • **🚀 WarpGBM(GPU)**加速度
  • NVIDIA A10G 显卡速度
  • 比LightGBM快13倍最适合用于
  • 时间序列、金融建模、时序数据特别
  • 时代感知的分割,不变性学习最小样本数

60+人推荐

  • **⚡ LightGBM(CPU)**加速
  • 高度优化的CPU速度
  • 比scikit-learn快10到100倍最适合用于
  • 一般表格数据,大型数据集特别
  • 分类特征,低内存最小样本数

20岁以上

  • 🗺️ 路线图
  • [x] 核心训练 + 推理端点
  • [x] 智能工件缓存(5分钟生存时间)
  • [x] MCP 服务器发送事件(Server-Sent Events)集成
  • [x] X402付款验证
  • [x] 使用GPU的模态部署
  • [x] 自定义域名(warpgbm.ai)
  • [x] Smithery市场列表
  • [ ] 支持导出ONNX格式
  • [ ] 用于大型数据集的异步作业队列
  • [ ] 支持S3/IPFS数据集URLwarpgbm-client[ ] Python 客户端库(
  • )

[ ] 额外的模型后端(XGBoost、CatBoost)

💬 反馈与支持

帮助我们为AI代理优化这项服务!

  • 提交关于以下方面的反馈:
  • 缺少能够解锁新应用场景的功能
  • 令人困惑的文档或错误信息
  • 性能问题或超时问题
# Via API
curl -X POST https://warpgbm.ai/feedback \
  -H "Content-Type: application/json" \
  -d '{
    "feedback_type": "feature_request",
    "message": "Add support for XGBoost backend",
    "severity": "medium"
  }'

您希望看到的其他模型类型

  • **或者通过:**GitHub Issues(GitHub问题) :
  • **mcp-warpgbm/issues(可译为:“MCP WarpGBM 问题追踪/议题”)**GitHub 讨论区 :
  • **warpgbm/讨论(或“warpgbm/讨论区”)**电子邮件

support@warpgbm.ai(这个邮箱地址本身在中文中通常不直接翻译,而是保持原样,表示“支持邮箱:support@warpgbm.ai”)


- 无服务器GPU平台

📄 许可证 GPL-3.0(通用公共许可证第3版) (与……相同WarpGBM核心

)


这确保了MCP封装的改进能惠及整个社区,同时允许通过云服务进行商业使用。

🙏 致谢


- 微软的GBDT库

用心打造,服务于开放代理经济 ⭐ 在GitHub上加星标 • 🚀 尝试在线服务 •