Skip to content

Superb-AI-Suite/superb-ai-onprem-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ 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
  • πŸ“€ Export & Import: Flexible data export and content management
  • ⚑ Activity Tracking: Monitor and manage long-running tasks
  • πŸ”§ Slice Management: Organize data into logical groups

πŸ”§ 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

# Initialize services
dataset_service = DatasetService()
data_service = DataService()

# 1. Find existing datasets
datasets, cursor, total = dataset_service.get_dataset_list(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")
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

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
πŸ“€ Exports Data & annotation export Multi-format export (COCO, YOLO, Custom) πŸ“€ Export 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. Setup οΏ½ Exports - Export to ML training formats

πŸ‘₯ 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)
β”‚   └── ⚑ Activities (processing workflows)
└── πŸ“€ Exports (output formats)

⚠️ Deprecated Modules

Module Status Migration Path
ModelService 🚫 Deprecated Use external ML frameworks
PredictionService 🚫 Deprecated Use πŸ“Š Data prediction entities
InferService 🚫 Deprecated Use ⚑ 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 5

Languages