Skip to main content

Core aiSSEMBLE Open Inference Protocol (OIP) functionality

Project description

aiSSEMBLE Open Inference Protocol (OIP) Client

Provides a modular Python library for standardized ML model inference, promoting interoperability across diverse runtimes and platforms. This client allows invocation of OIP endpoints in a more natural manner by ensuring that inference runtime details (like tensor-specific input/output structures) as not leaked from the model implementation into the client.

Features

Fluent Builder API

InferenceBuilder (abstract base class) offers a task-specific, chainable interface for configuring inference requests. Supports model selection, adapter/translator registration, custom parameters, and streaming responses. Extensible via subclasses implementing build_predictor() to produce a Predictor instance.

Task-Specific Inference

The client provides specialized builders for common ML tasks with natural, task-oriented APIs:

Object Detection

  • client.detect_object(model_name) - Returns ObjectDetectionBuilder
  • Fluent methods: .image(), .confidence(), .labels()
  • Returns ObjectDetectionResult with bounding boxes, labels, scores
  • Supports PIL images, numpy arrays, file paths, and bytes
  • Example:
    result = client.detect_object("yolov8") \
        .image("photo.jpg") \
        .confidence(0.6) \
        .run()
    for detection in result.detections:
        print(f"{detection.label}: {detection.confidence}")
    

Text Summarization

  • client.summarize(model_name) - Returns SummarizationBuilder
  • Fluent methods: .text(), .max_length(), .min_length()
  • Returns SummarizationResult with summary text and compression metrics
  • Example:
    result = client.summarize("bart-large") \
        .text("Very long article text here...") \
        .max_length(100) \
        .run()
    print(result.summary)
    print(f"Compressed {result.compression_ratio:.1f}x")
    

Raw Inference Support

RawInferenceBuilder provides a low-level, non-fluent API for direct tensor inputs and parameters, ideal for custom or performance-critical scenarios.

Streaming Capable

Builders support iterable responses for continuous inference outputs.

Project details


Download files

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

Source Distribution

aissemble_oip_core-1.5.0rc2.tar.gz (252.4 kB view details)

Uploaded Source

Built Distribution

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

aissemble_oip_core-1.5.0rc2-py3-none-any.whl (40.9 kB view details)

Uploaded Python 3

File details

Details for the file aissemble_oip_core-1.5.0rc2.tar.gz.

File metadata

  • Download URL: aissemble_oip_core-1.5.0rc2.tar.gz
  • Upload date:
  • Size: 252.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aissemble_oip_core-1.5.0rc2.tar.gz
Algorithm Hash digest
SHA256 db369094fb6da5006bf7894113ecaa6ee5dc9cc473de1bfcb866525b594a640f
MD5 6f52ff8757c57cff06c7b27d9b12f52b
BLAKE2b-256 74d49284c8f55ac0918ec840ae01208b7a17e411f670144d0cdc63697c227b95

See more details on using hashes here.

File details

Details for the file aissemble_oip_core-1.5.0rc2-py3-none-any.whl.

File metadata

  • Download URL: aissemble_oip_core-1.5.0rc2-py3-none-any.whl
  • Upload date:
  • Size: 40.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for aissemble_oip_core-1.5.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 2f3bedcf4b6d1a82f7364f64bbdc60c3c7b55d0d533067bac54a68ac11a0e24f
MD5 49f909e278ecddca9050c8bc08161453
BLAKE2b-256 d5b695fd7f6dac067c91f20afcaa6da4095586ba7b1daec86ebe9b63a344a811

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