🚀 Superb AI On-premise Python SDK
Superb AI On-premise Python SDK is a comprehensive Python library that provides a simple and intuitive interface to interact with your on-premise Superb AI installation. Build powerful data management, annotation, and machine learning workflows with ease.
🌟 Key Features
- 🗂️ Dataset Management: Create, organize, and manage your datasets
- 📊 Data Operations: Upload, annotate, and manipulate your data with powerful filtering
- 🔍 Advanced Filtering: Sophisticated filtering system for precise data queries
- 🏷️ Annotation Management: Handle annotations and versions seamlessly
- 📁 Content Management: Upload and manage file content
- ⚡ Activity Tracking: Monitor and manage long-running tasks
- 🔧 Slice Management: Organize data into logical groups
- 🤖 Model Tracking: Register and monitor ML model performance
- 📈 Analytics Reports: Generate and visualize dataset analytics
모델 생성·수정과 조회 필터에는 ModelTaskType을 사용합니다. VLM은 시각·언어 이해 모델을, VISION_GENERATION은 이미지·영상 생성 모델을 나타냅니다. 생성 모델 타입으로 API를 호출하려면 서버에도 해당 타입 지원이 반영되어 있어야 합니다.
🔧 Installation
Step 1: Install the SDK
Install the SDK using pip:
pip install superb-ai-onprem
Requirements:
- Python 3.7 or higher
- Active Superb AI On-premise installation
⚠️ Important: The SDK will not work without this configuration file. Make sure to replace the values with your actual credentials from your Superb AI administrator.
🚀 Quick Start
Get up and running with Superb AI SDK in minutes:
Step 1: Authentication Setup
First, set up your authentication credentials:
Option A: Config file (Recommended for local development)
# Create config directory
mkdir -p ~/.spb
# Create config file
cat > ~/.spb/onprem-config << EOF
[default]
host=https://your-superb-ai-host.com
access_key=your-access-key
access_key_secret=your-access-key-secret
EOF
Step 2: Your First Workflow
from spb_onprem import DatasetService, DataService, ModelService, ReportService
# Initialize services
dataset_service = DatasetService()
data_service = DataService()
model_service = ModelService()
report_service = ReportService()
# 1. Find existing datasets
datasets, cursor, total = dataset_service.get_datasets(length=10)
print(f"📂 Found {total} datasets")
if datasets:
# Use the first available dataset
dataset = datasets[0]
print(f"✅ Using dataset: {dataset.name} (ID: {dataset.id})")
# 2. Get data list from the dataset
data_list, cursor, total = data_service.get_data_list(
dataset_id=dataset.id,
length=10
)
print(f"📊 Dataset contains {total} data items")
# 3. Display data information
for i, data in enumerate(data_list, 1):
print(f" {i}. Key: {data.key}, Type: {data.type}, ID: {data.id}")
if total > len(data_list):
print(f" ... and {total - len(data_list)} more items")
# 4. Check models in the dataset
models, _, model_count = model_service.get_models(
dataset_id=dataset.id,
length=5
)
if model_count > 0:
print(f"\n🤖 Found {model_count} models")
for model in models:
print(f" - {model.name} ({model.baseline_model})")
# 5. Check analytics reports
reports, _, report_count = report_service.get_analytics_reports(
dataset_id=dataset.id,
length=5
)
if report_count > 0:
print(f"\n📈 Found {report_count} analytics reports")
for report in reports:
print(f" - {report.title}")
else:
print("❌ No datasets found. Please create a dataset first.")
🎉 Congratulations! You've successfully:
- ✅ Connected to your Superb AI instance
- ✅ Found existing datasets
- ✅ Retrieved and displayed data information
- ✅ Explored models and reports
Ready for more? Check out our comprehensive documentation below!
🗑️ Deleting (changed in 2.0.0)
Deleting no longer removes rows at once. Each call starts one activity
(DELETE_MODEL, DELETE_DIAGNOSIS, DELETE_ANALYTICS_REPORT, DELETE_SLICE,
DELETE_DATA, REMOVE_DATA_FROM_SLICE, DELETE_DATASET, DELETE_MODEL_DEPLOYMENT) and returns its
ActivityHistory instead of bool (or Data for remove_data_from_slice). The
delete activities also delete the files in storage; REMOVE_DATA_FROM_SLICE only
takes data out of a slice and deletes no files.
| Function | Targets (exactly one) |
|---|---|
ModelService.delete_models(dataset_id, ...) |
model_ids=[...] or model_filter=ModelFilter(...) |
DiagnosisService.delete_diagnoses(dataset_id, ...) |
diagnosis_ids=[...] or diagnosis_filter=DiagnosisFilter(...) |
ReportService.delete_analytics_reports(dataset_id, ...) |
report_ids=[...] or report_filter=AnalyticsReportsFilter(...) |
SliceService.delete_slices(dataset_id, ...) |
slice_ids=[...] or slice_filter=SlicesFilter(...) |
DataService.delete_data(dataset_id, ...) |
data_id, data_ids=[...] or data_filter=DataListFilter(...) |
DataService.remove_data_from_slice(dataset_id, ..., slice_id=...) |
data_id, data_ids=[...] or data_filter=... |
DatasetService.delete_dataset(dataset_id) |
the dataset |
ModelDeploymentService.delete_model_deployments(dataset_id, ...) (new, DELETE_MODEL_DEPLOYMENT) |
deployment_ids=[...] or deployment_filter=ModelDeploymentFilter(...) |
Empty lists and filters without a condition ({}, {"must": {}}, must: null,
must.idIn: []) are refused with BadDeletionTargetError (a ValueError).
Deprecated: delete_model, delete_diagnosis, delete_analytics_report and
delete_slice still work but warn with DeprecationWarning and will be removed in the
next major version. Each call starts one activity, so calling them in a loop starts one
activity per target; pass all the IDs to the plural function instead.
- The history is always truthy, so
if service.delete_x(...)keeps running, butbool(...)no longer tells whether anything was deleted (and== Trueis False). UseActivityService().wait_for_activity(history.id)and check itsstatus. - The deletion functions never return
Falseany more. The SDK refuses malformed targets before sending (BadDeletionTargetError: empty lists or filters, an emptyidIn, a non-listidIn, an unknownstatusInvalue, ...). The platform checks only keys, types and required values when the request is made (InvalidInputError) and the rest when the activity runs. The targets are found when the activity runs: if none match or they are already deleted, the activity succeeds without deleting anything; a target that cannot be deleted then (still running, a model used by a deployment) is not refused at request time but makes the activityFAILED(see itsstatusandmeta). ActivityStatus.CANCELLEDis now an alias ofCANCELED; its value is"CANCELED", so comparing a status with the string"CANCELLED"is False.- Progress and errors show in the Activity log. A non-admin of the dataset submits the
activity as
AWAITING_APPROVAL; an admin (Owner, WorkspaceAdmin, DATASET-ADMIN) starts it at once. - To block until the deletion ends, call
ActivityService().wait_for_activity(history.id). ContentService.delete_contentis unchanged (a content is a file, not an entity), but it raises when storage fails instead of returningFalse.
The server must have the deletion activities (job definitions and base DAGs). See the "Deletion Activities" section of Activities.
📚 Module Documentation
🏗️ Core Modules
Comprehensive guides for each SDK module with detailed examples and best practices:
| Module | Purpose | Key Features | Documentation |
|---|---|---|---|
| 📁 Datasets | Dataset lifecycle management | Create, organize, manage data collections | 📂 Dataset Guide |
| 📊 Data | Individual data management | CRUD operations, advanced filtering, annotations | 📊 Data Guide |
| 🔪 Slices | Data organization & filtering | Create filtered views, team collaboration | 🔪 Slice Guide |
| ⚡ Activities | Workflow & task management | Process automation, progress tracking | ⚡ Activity Guide |
| 🤖 Models | ML model management | Track models, training configs, performance metrics | 🤖 Model Guide |
| 📈 Reports | Analytics & visualization | Create reports, charts, dashboards | 📈 Report Guide |
| 📊 Charts | Chart data factory | Generate training metrics visualizations (9 chart types) | 📊 Chart Guide |
| ❓ VLM Settings | VLM question sets | Dataset and slice question sets, optimistic locking | ❓ VLM Settings Guide |
| 🚀 Model Deployments | Serve models on GPUs | Deploy, wait, invoke, stop, start, delete; deployment definitions | 🚀 Model Deployment Guide |
🎯 Getting Started Paths
Choose your learning path based on your use case:
📊 Data Management Workflow
- Start with 📁 Datasets - Create and organize your data collections
- Then explore 📊 Data - Manage individual items and annotations
- Use 🔪 Slices - Organize data into logical groups
🚀 ML Pipeline Integration
- Begin with 📊 Data - Understand data structure and filtering
- Configure ⚡ Activities - Automate labeling and review workflows
- Track with 🤖 Models - Register and monitor model performance
- Create visualizations with 📊 Charts - Generate training metrics charts
- Build dashboards with 📈 Reports - Compile analytics reports
👥 Team Collaboration
- Setup 📁 Datasets - Organize team projects
- Create 🔪 Slices - Assign work to team members
- Implement ⚡ Activities - Track progress and quality
🔧 Advanced Features
Each module includes:
- 🎯 Quick Start Examples - Get running immediately
- 📋 Detailed Entity Documentation - Pydantic models with comprehensive field descriptions
- 🔍 Advanced Usage Patterns - Best practices and complex workflows
- 🔗 Cross-Module Integration - How modules work together
- ⚡ Performance Tips - Optimization recommendations
🌐 Module Relationships
📁 Datasets (containers)
├── 📊 Data (individual items)
│ ├── 🔪 Slices (filtered views)
│ │ └── 🤖 Models (training configs)
│ └── ⚡ Activities (processing workflows)
└── 📈 Reports (analytics & visualizations)
🆕 New Modules (v2.0+)
| Module | Added | Status | Description |
|---|---|---|---|
| 🤖 Models | v2.0 | ✅ Stable | ML model lifecycle management and performance tracking |
| 📈 Reports | v2.0 | ✅ Stable | Analytics reports and visualization dashboards |
| 📊 Charts | v2.0 | ✅ Stable | Chart data factory with 9 chart types for training metrics visualization |
⚠️ Deprecated Modules
| Module | Status | Migration Path |
|---|---|---|
| InferService | 🚫 Deprecated | Use 🤖 Models for model management and ⚡ Activities for inference workflows |
⚠️ Error Handling
The SDK provides specific error types for different scenarios:
from spb_onprem.exceptions import (
BadParameterError,
NotFoundError,
UnknownError
)
try:
dataset = dataset_service.get_dataset(dataset_id="non-existent-id")
except NotFoundError:
print("Dataset not found")
except BadParameterError as e:
print(f"Invalid parameter: {e}")
except UnknownError as e:
print(f"An unexpected error occurred: {e}")
🔐 Security notes
- Platform credentials (
Authorization, orx-user-emailin system mode) are sent only to the platform API host, never to presigned storage URLs, and are dropped when a redirect leaves the host. Exception: the deprecatedInferServicesends them toMODEL_ENDPOINT_URL, whatever its host. - Platform API requests (GraphQL, model deployment invoke) do not follow redirects, so the credentials
are never resent to another URL. Write
hostwithhttps://: if anhttp://host is redirected tohttps://, the SDK raises aBadResponseErrorthat says so (following the redirect would turn the POST into a GET and fail with an unclear Apollo CSRF 400). Reading a config whosehostuseshttp://(other than a loopback host) gives anInsecureHostWarningonce. If the server serves plain HTTP only, turn it off withwarnings.filterwarnings("ignore", category=spb_onprem.exceptions.InsecureHostWarning). - SDK error messages, SDK logs,
SDK_DEBUG_GQLoutput and SDK exceptions hide credentials and presigned URL signatures (URL query strings). - On import, the SDK adds a filter to the
urllib3.connectionpoolandurllib3.util.retryloggers that replaces URL query strings with<redacted>in their records, at every level (for example the WARNING urllib3 writes when it retries). Other output that shows raw requests, such ashttp.clientdebug printing (HTTPConnection.debuglevel), is not covered.
🧪 Requirements
- Python >= 3.7
- requests >= 2.22.0
- urllib3 >= 1.21.1
- pydantic >= 1.8.0
🤝 Contributing
We welcome contributions to the Superb AI On-premise SDK! Here's how you can help:
Development Setup
- Clone the repository:
git clone https://github.com/Superb-AI-Suite/superb-ai-onprem-python.git
cd superb-ai-onprem-python
- Install development dependencies:
pip install -e ".[dev]"
Contribution Guidelines
- Code Style: Follow PEP 8 guidelines
- Testing: Add tests for new features
- Documentation: Update docstrings and README
- Pull Requests: Use descriptive titles and include test results
Reporting Issues
When reporting issues, please include:
- SDK version (
spb_onprem.__version__) - Python version
- Error messages and stack traces
- Minimal reproduction example
- Expected vs actual behavior
📞 Support
Community Support
- GitHub Issues: Report bugs and request features
- Documentation: Official API documentation
Enterprise Support
- Technical Support: Contact your Superb AI representative
- Custom Integration: Professional services available
- Training: SDK workshops and onboarding sessions
Quick Help
Common Issues:
- Authentication errors: Check config file format and credentials
- Connection issues: Verify host URL and network connectivity
- Import errors: Ensure SDK is properly installed (
pip install superb-ai-onprem) - Performance issues: Use appropriate pagination and filtering
Need immediate help? Check our FAQ section or contact support.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🚀 Ready to build something amazing? Start with our Quick Start Guide and explore the powerful features of Superb AI On-premise SDK!
Metadata
Release files for superb-ai-onprem 2.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| superb_ai_onprem-2.0.3.tar.gz | 288.1 kB | Without provenance | Details for superb_ai_onprem-2.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| superb_ai_onprem-2.0.3-py3-none-any.whl | Python 3 | none | any | Details for superb_ai_onprem-2.0.3-py3-none-any.whl |
Total release size: 560.5 kB
Release files / superb_ai_onprem-2.0.3.tar.gz
| Download URL | superb_ai_onprem-2.0.3.tar.gz |
|---|---|
| Size | 288.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89940d14cc46caacc267e1503e4867f7f33488d016953d709d9445c9181dcb77
|
|
BLAKE2b-256 checksum How to use checksums |
90738ddb640077e432e9fb2a5c59eb03437a5d1fac42435c39921a03edf42d27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / superb_ai_onprem-2.0.3-py3-none-any.whl
| Download URL | superb_ai_onprem-2.0.3-py3-none-any.whl |
|---|---|
| Size | 272.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ef0bc9c3286a27fc0137ab033ade3bdd6c56bcaa82b16e967a00a0a8d0d39ba8
|
|
BLAKE2b-256 checksum How to use checksums |
1f27e40599b5b6961a6ea7b039e34177a5f84a8a336817c619dd430681ba6516
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for superb-ai-onprem 2.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.