Skip to main content

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)

Metadata

Release files for aiges-wrapper 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aiges-wrapper 0.1.0
File Size Uploaded
aiges_wrapper-0.1.0.tar.gz 14.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for aiges-wrapper 0.1.0
File Interpreter ABI Platform
aiges_wrapper-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.6 kB

Release files / aiges_wrapper-0.1.0.tar.gz

Download URL aiges_wrapper-0.1.0.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b0099c29cd76f8a1819a0ef76e1c6588938c715989060284f1050f782b6d045a
BLAKE2b-256 checksum
How to use checksums
bab40d1608a8105e300d0ea085cfbff524e2175c970d74e4e632103f2b327f77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / aiges_wrapper-0.1.0-py3-none-any.whl

Download URL aiges_wrapper-0.1.0-py3-none-any.whl
Size 16.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
538c38b560e65d3b741cff8fcaebee3439a2a853afaf1790cbc875c41df3443a
BLAKE2b-256 checksum
How to use checksums
78a185f1cf2a1db8257a6f2a17eb37644d4b739acaed52890c7a23e4be46df84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page