Skip to main content

Core aiSSEMBLE Inference functionality

Project description

aiSSEMBLE Inference (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_inference_core-1.5.0rc3.tar.gz (260.8 kB view details)

Uploaded Source

Built Distribution

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

aissemble_inference_core-1.5.0rc3-py3-none-any.whl (41.4 kB view details)

Uploaded Python 3

File details

Details for the file aissemble_inference_core-1.5.0rc3.tar.gz.

File metadata

  • Download URL: aissemble_inference_core-1.5.0rc3.tar.gz
  • Upload date:
  • Size: 260.8 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_inference_core-1.5.0rc3.tar.gz
Algorithm Hash digest
SHA256 5cff3a3997b1a6f8660c4696cda170597ddf9d46bbfe4caa193f9e037d53cce4
MD5 aa2a68bfc08b442881a7193c87e5cdad
BLAKE2b-256 9a616d2ab9ae793698415f1172bdd9225d9e320e38cbc93a0492180177e545dc

See more details on using hashes here.

File details

Details for the file aissemble_inference_core-1.5.0rc3-py3-none-any.whl.

File metadata

  • Download URL: aissemble_inference_core-1.5.0rc3-py3-none-any.whl
  • Upload date:
  • Size: 41.4 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_inference_core-1.5.0rc3-py3-none-any.whl
Algorithm Hash digest
SHA256 43c35968da69679e72db4162cce7d140fc2294d5c76969eef25dd428d7a0c228
MD5 4d730fa6e337e44850cd9dd0f2248eec
BLAKE2b-256 0a3faa2ea90ee2d4dc17c1708c2087527e3d0affe2d2897e5a96b85f17820647

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