SAP OpenSource Model Playground | SAP-RPT-1-OSS Model Beta
A comprehensive SAP Playground application built with Gradio that integrates the SAP-RPT-1-OSS model for predictive analysis on SAP datasets. Features include synthetic data generation, interactive visualizations, live OData connectivity, AI-powered insights, and a playground for training custom models.
Features
- Multiple Synthetic SAP Datasets: General Ledger accounts, Financial Statements (P&L, Balance Sheet), and Sales Orders
- Data Upload: Upload custom CSV, Parquet, or JSON datasets for analysis
- Interactive Visualizations: Financial charts and graphs using Plotly
- SAP-RPT-1-OSS Model Integration: AI-powered predictions and analysis
- Live OData Connection: Connect to SAP systems to fetch real-time sales order data
- Playground Tab: Upload datasets, configure model parameters, train, and download predictions
- Modern UI: Built with Gradio, a Python-based web framework
Installation
Prerequisites
- Python 3.11 or higher
- Hugging Face account (for SAP model access)
- SAP OData credentials (optional, for live data connection)
Setup Steps
Clone the repository:
git clone <repository-url> cd SAP-RPT-1-OSS-AppCreate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtInstall SAP-RPT-OSS package:
pip install git+https://github.com/SAP-samples/sap-rpt-1-ossSet up environment variables:
- Copy
.env.exampleto.env - Fill in your SAP OData credentials
- Add your Hugging Face token for model access
- Copy
Authenticate with Hugging Face:
pip install huggingface_hub huggingface-cli loginOr set the
HUGGINGFACE_TOKENin your.envfile.Generate synthetic data (optional, if not already generated):
python -c "from utils.data_generator import generate_all_datasets; generate_all_datasets()"
Usage
Running the Application
Start the Gradio application:
python app_gradio.py
The application will be available at http://localhost:7862 (default Gradio port).
Application Tabs
- Dashboard: Overview with key financial metrics and visualizations
- Data Explorer: Browse and filter datasets (GL, Financial Statements, Sales Orders)
- Upload: Upload custom CSV datasets for analysis
- Predictions: Use SAP-RPT-1-OSS model for predictions and analysis with pre-configured scenarios
- OData: Connect to SAP OData services and fetch live data
- Playground: Upload datasets, configure model parameters (task type, target column, test split, context size, bagging, GPU), train models, and download predictions
SAP OData Connection Setup
Set the following environment variables in your
.envfile:SAP_USERNAME: Your SAP usernameSAP_PASSWORD: Your SAP passwordSAP_SERVER: SAP server URL (default:https://sapes5.sapdevcenter.com/)SAP_CLIENT: SAP client number (default:002)
The OData connector uses the base URL:
https://sapes5.sapdevcenter.com/sap/opu/odata/IWBEP/GWSAMPLE_BASICAvailable endpoints:
- Sales Orders:
SalesOrderSet - Products:
ProductSet - Line Items:
SalesOrderLineItemSet - Business Partners:
BusinessPartnerSet
- Sales Orders:
Model Configuration
The SAP-RPT-1-OSS model supports both classification and regression tasks. For best performance:
- Recommended: GPU with at least 80 GB memory, context size 8192, bagging factor 8
- Lightweight: CPU with context size 2048, bagging factor 1
The application automatically detects available resources and adjusts settings accordingly.
Project Structure
SAP-RPT-1-OSS-App/
βββ app_gradio.py # Main Gradio application
βββ models/
β βββ rpt_model.py # SAP-RPT-1-OSS model wrapper
βββ data/
β βββ synthetic_gl_accounts.csv
β βββ synthetic_financial_statements.csv
β βββ synthetic_sales_orders.csv
βββ utils/
β βββ data_generator.py # Generate synthetic SAP finance data
β βββ visualizations.py # Chart generation functions
β βββ odata_connector.py # OData connection utilities
β βββ playground.py # Playground utilities for model training
βββ requirements.txt
βββ README.md
βββ .env.example
License
This project is licensed under the Apache Software License, version 2.0.
Support
For issues or questions, please create an issue in this repository.
Acknowledgments
- SAP-RPT-1-OSS model: Hugging Face
- Gradio framework: Gradio Documentation