Skip to main content

AIGES Python Wrapper SDK – build AI engine wrappers for the AIGES loader

Project description

aiges_python

AIGES Python Wrapper SDK — 用于构建 AIGES 加载器的 Python AI 引擎插件。

安装

pip install aiges_python

快速开始

from python_wrapper import WrapperBase, WrapperData, DataType, DataStatus


class MyWrapper(WrapperBase):
    def init(self, cfg: dict) -> int:
        # 初始化引擎
        return 0

    def fini(self) -> int:
        return 0

    def version(self) -> str:
        return "1.0.0"

    def exec(self, usr_tag, params, data_list, psr_ids):
        # 非流式推理
        results = [
            WrapperData(key="result", data=b"hello", status=DataStatus.ONCE)
        ]
        return (results, 0)

回调方法

在 wrapper 中可以调用框架回调(需要 AIGES 加载器环境):

# 自定义计量
self.meter_custom(handle, "my_key", count=1)

# Trace 日志
self.trace_log(handle, "latency", "100ms")

# EventLog 标签
self.eventlog(handle, "model", "gpt-4")

# 自定义指标
self.metrics_log(handle, "inference_time", {"model": "v1"}, value=150)

# 异步回调(流式模式)
self.async_callback(usr_tag, data_list=[...], err_code=0)

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

aiges_wrapper-0.1.0.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

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

aiges_wrapper-0.1.0-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file aiges_wrapper-0.1.0.tar.gz.

File metadata

  • Download URL: aiges_wrapper-0.1.0.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aiges_wrapper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0099c29cd76f8a1819a0ef76e1c6588938c715989060284f1050f782b6d045a
MD5 a7fc619014bcaf1f6b0912e248310b08
BLAKE2b-256 bab40d1608a8105e300d0ea085cfbff524e2175c970d74e4e632103f2b327f77

See more details on using hashes here.

File details

Details for the file aiges_wrapper-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: aiges_wrapper-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aiges_wrapper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 538c38b560e65d3b741cff8fcaebee3439a2a853afaf1790cbc875c41df3443a
MD5 72238133dfbdd7e0e7cb8f42ea34ba62
BLAKE2b-256 78a185f1cf2a1db8257a6f2a17eb37644d4b739acaed52890c7a23e4be46df84

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