amitlals

sap-rpt1-oss-predictor

2
0
# Install this skill:
npx skills add amitlals/sap-rpt1-oss-predictor

Or install specific skill: npx add-skill https://github.com/amitlals/sap-rpt1-oss-predictor

# Description

Use SAP-RPT-1-OSS open source tabular foundation model for predictive analytics on SAP business data. Handles classification and regression tasks including customer churn prediction, delivery delay forecasting, payment default risk, demand planning, and financial anomaly detection. Use when asked to predict, forecast, classify, or analyze patterns in SAP tabular data exports (CSV/DataFrame). Runs locally via Hugging Face model.

# SKILL.md


name: sap-rpt1-oss-predictor
description: Use SAP-RPT-1-OSS open source tabular foundation model for predictive analytics on SAP business data. Handles classification and regression tasks including customer churn prediction, delivery delay forecasting, payment default risk, demand planning, and financial anomaly detection. Use when asked to predict, forecast, classify, or analyze patterns in SAP tabular data exports (CSV/DataFrame). Runs locally via Hugging Face model.


SAP-RPT-1-OSS Predictor

SAP-RPT-1-OSS is SAP's open source tabular foundation model (Apache 2.0) for predictions on structured business data. Unlike LLMs that predict text, RPT-1 predicts field values in table rows using in-context learningβ€”no model training required.

Repository: https://github.com/SAP-samples/sap-rpt-1-oss
Model: https://huggingface.co/SAP/sap-rpt-1-oss

Setup

1. Install Package

pip install git+https://github.com/SAP-samples/sap-rpt-1-oss

2. Hugging Face Authentication

Model weights require HF login and license acceptance:

# Install HF CLI
pip install huggingface_hub

# Login (creates ~/.huggingface/token)
huggingface-cli login

Then accept model terms at: https://huggingface.co/SAP/sap-rpt-1-oss

3. Hardware Requirements

Config GPU Memory Context Size Bagging Use Case
Optimal 80GB (A100) 8192 8 Production, best accuracy
Standard 40GB (A6000) 4096 4 Good balance
Minimal 24GB (RTX 4090) 2048 2 Development
CPU N/A 1024 1 Testing only (slow)

Quick Start

Classification (Customer Churn, Payment Default)

import pandas as pd
from sap_rpt_oss import SAP_RPT_OSS_Classifier

# Load SAP data export
df = pd.read_csv("sap_customers.csv")
X = df.drop(columns=["CHURN_STATUS"])
y = df["CHURN_STATUS"]

# Split data
X_train, X_test = X[:400], X[400:]
y_train, y_test = y[:400], y[400:]

# Initialize and predict
clf = SAP_RPT_OSS_Classifier(max_context_size=4096, bagging=4)
clf.fit(X_train, y_train)

predictions = clf.predict(X_test)
probabilities = clf.predict_proba(X_test)

Regression (Delivery Delay Days, Demand Quantity)

from sap_rpt_oss import SAP_RPT_OSS_Regressor

reg = SAP_RPT_OSS_Regressor(max_context_size=4096, bagging=4)
reg.fit(X_train, y_train)
predictions = reg.predict(X_test)

Core Workflow

  1. Extract SAP data β†’ Export to CSV from relevant tables
  2. Prepare dataset β†’ Include 50-500 rows with known outcomes
  3. Rename fields β†’ Use semantic names (see Data Preparation)
  4. Run prediction β†’ Fit on training data, predict on new data
  5. Interpret results β†’ Probabilities for classification, values for regression

SAP Use Cases

See references/sap-use-cases.md for detailed extraction queries:

  • FI-AR: Payment default probability (BSID, BSAD, KNA1)
  • FI-GL: Journal entry anomaly detection (ACDOCA, BKPF)
  • SD: Delivery delay prediction (VBAK, VBAP, LIKP)
  • SD: Customer churn likelihood (VBRK, VBRP, KNA1)
  • MM: Vendor performance scoring (EKKO, EKPO, EBAN)
  • PP: Production delay risk (AFKO, AFPO)

Data Preparation

Semantic Column Names (Important!)

RPT-1-OSS uses an LLM to embed column names and values. Descriptive names improve accuracy:

# Good: Model understands business context
CUSTOMER_CREDIT_LIMIT, DAYS_SINCE_LAST_ORDER, PAYMENT_DELAY_DAYS

# Bad: Generic names lose semantic value
COL1, VALUE, FIELD_A

Use scripts/prepare_sap_data.py to rename SAP technical fields:

from scripts.prepare_sap_data import SAPDataPrep

prep = SAPDataPrep()
df = prep.rename_sap_fields(df)  # BUKRS β†’ COMPANY_CODE, etc.

Dataset Size

  • Minimum: 50 training examples
  • Recommended: 200-500 examples
  • Maximum context: 8192 rows (GPU dependent)

Scripts

  • scripts/rpt1_oss_predict.py - Local model prediction wrapper
  • scripts/prepare_sap_data.py - SAP field renaming and SQL templates
  • scripts/batch_predict.py - Chunked processing for large datasets

Alternative: RPT Playground API

For users with SAP access, the closed-source RPT-1 is available via API:

from scripts.rpt1_api import RPT1Client

client = RPT1Client(token="YOUR_RPT_TOKEN")  # Get from rpt-playground.sap.com
result = client.predict(data="data.csv", target_column="TARGET", task_type="classification")

See references/api-reference.md for RPT Playground API documentation.

Limitations

  • Tabular data only (no images, text documents)
  • Requires labeled examples for in-context learning
  • First prediction is slow (model loading)
  • GPU strongly recommended for production use

# README.md

SAP-RPT-1-OSS Predictor Skill

A Claude skill for using SAP's open source SAP-RPT-1-OSS tabular foundation model for predictive analytics on SAP business data.
image

Overview

SAP-RPT-1-OSS is SAP's open source (Apache 2.0) tabular foundation model announced at TechEd 2025. Unlike LLMs that predict text, RPT-1 predicts field values in table rows using in-context learningβ€”no model training required.

  • Repository: https://github.com/SAP-samples/sap-rpt-1-oss
  • Model: https://huggingface.co/SAP/sap-rpt-1-oss

This skill enables Claude to:
- Set up and authenticate with Hugging Face for model access
- Prepare SAP data extracts for prediction
- Run classification and regression using the local OSS model
- Handle batch processing for large datasets
- Optionally use RPT Playground API as alternative

Use Cases

SAP Module Prediction Type Example
FI-AR Payment Default Risk Predict which invoices will go unpaid
SD Customer Churn Identify at-risk customers
SD/LE Delivery Delays Forecast shipping delays
FI-GL Journal Anomalies Detect unusual postings
MM Vendor Performance Score supplier reliability
PP/MM Demand Forecast Predict future quantities

Structure

sap-rpt1-oss-predictor/
β”œβ”€β”€ SKILL.md                     # Main skill instructions
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ rpt1_oss_predict.py      # Local OSS model wrapper
β”‚   β”œβ”€β”€ prepare_sap_data.py      # SAP data extraction utilities
β”‚   β”œβ”€β”€ batch_predict.py         # Batch processing for large datasets
β”‚   └── rpt1_api.py              # Optional: RPT Playground API client
β”œβ”€β”€ references/
β”‚   β”œβ”€β”€ sap-use-cases.md         # Detailed SAP prediction scenarios
β”‚   └── api-reference.md         # Complete API documentation
└── examples/
    β”œβ”€β”€ customer_churn_sample.csv
    └── payment_default_sample.csv

Requirements

  • Hugging Face account (free) - for model access
  • GPU recommended: 24-80GB VRAM for optimal performance
  • Python 3.11+ with pandas, torch

Quick Start

# Install model
pip install git+https://github.com/SAP-samples/sap-rpt-1-oss

# Authenticate with Hugging Face
huggingface-cli login
from sap_rpt_oss import SAP_RPT_OSS_Classifier

clf = SAP_RPT_OSS_Classifier(max_context_size=4096, bagging=4)
clf.fit(X_train, y_train)
predictions = clf.predict(X_test)

How to Use This Skill

Installation Options

Option 1 β€” Claude Code (CLI):

git clone https://github.com/amitlals/sap-rpt1-oss-predictor
cd sap-rpt1-oss-predictor
claude  # Skill auto-detected via .claude-plugin/marketplace.json

Option 2 β€” Claude.ai (Pro/Team only):
1. Go to claude.ai β†’ Projects (left sidebar)
2. Create new project β†’ Add to Project Knowledge β†’ Upload SKILL.md
3. Start chatting in that project

Option 3 β€” Claude.ai (Free tier):
1. Copy contents of SKILL.md
2. Paste at the start of your conversation as context
3. Then ask your prediction questions

Option 4 β€” GitHub Copilot:
- Clone repo, skill available in .github/skills/ directory

Example Prompts

Once installed, prompt Claude with:

Setup:

Set up SAP-RPT-1-OSS for predictions on my SAP data

Classification:

Predict which customers will churn using SAP-RPT-1-OSS
Classify payment default risk for these SAP invoices

Forecasting:

Forecast demand for next quarter using my SAP sales data

Data Preparation:

Help me extract SAP FI-AR data for payment prediction

Batch Processing:

Run batch predictions on 50,000 SAP records using RPT-1

Contributors

  • @amitlals - Creator & Maintainer
  • Claude by Anthropic - AI Pair Programmer (code generation, documentation, skill architecture)
  • GitHub Copilot - AI Code Assistant (code suggestions, completions)

License

Apache 2.0

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.