Skip to main content

Python SDK for Superb AI On-premise

Project description

๐Ÿš€ Superb AI On-premise Python SDK

Python License Version

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

๐Ÿ”ง 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!

๐Ÿ“š 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

๐ŸŽฏ Getting Started Paths

Choose your learning path based on your use case:

๐Ÿ“Š Data Management Workflow

  1. Start with ๐Ÿ“ Datasets - Create and organize your data collections
  2. Then explore ๐Ÿ“Š Data - Manage individual items and annotations
  3. Use ๐Ÿ”ช Slices - Organize data into logical groups

๐Ÿš€ ML Pipeline Integration

  1. Begin with ๐Ÿ“Š Data - Understand data structure and filtering
  2. Configure โšก Activities - Automate labeling and review workflows
  3. Track with ๐Ÿค– Models - Register and monitor model performance
  4. Visualize with ๐Ÿ“ˆ Reports - Generate analytics dashboards

๐Ÿ‘ฅ Team Collaboration

  1. Setup ๐Ÿ“ Datasets - Organize team projects
  2. Create ๐Ÿ”ช Slices - Assign work to team members
  3. 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

โš ๏ธ 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}")

๐Ÿงช 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

  1. Clone the repository:
git clone https://github.com/Superb-AI-Suite/superb-ai-onprem-python.git
cd superb-ai-onprem-python
  1. 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

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!

Built with โค๏ธ by the Superb AI team

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superb_ai_onprem-1.1.0.tar.gz (99.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superb_ai_onprem-1.1.0-py3-none-any.whl (109.7 kB view details)

Uploaded Python 3

File details

Details for the file superb_ai_onprem-1.1.0.tar.gz.

File metadata

  • Download URL: superb_ai_onprem-1.1.0.tar.gz
  • Upload date:
  • Size: 99.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for superb_ai_onprem-1.1.0.tar.gz
Algorithm Hash digest
SHA256 91140c6ea30ea2092ab29dff039804167d04ebd86cb429e37d1ad1f2e8fc1251
MD5 b3dd19d45482413b0eccea52c524ac1d
BLAKE2b-256 21b298016d8c92e8710d00125d55726e8115c87303a8385cfa7b24aa3af34ee7

See more details on using hashes here.

File details

Details for the file superb_ai_onprem-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for superb_ai_onprem-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c73c7980542dc1b418a60463bcb3768e8715619a730ec7be7241c54a6ed50b6
MD5 705edcd36d66f322b3a16a69dde287d8
BLAKE2b-256 c5246cc021d35fe743755ba35de37ea9b9246739698a854886094efebfe6107b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page