Skip to main content

Python wrapper for AIKernel.Control v0.1.0 governance contracts with bundled managed assemblies and pythonnet loading.

Project description

aikernel-governance

日本語

Python wrapper for the public governance surface of AIKernel.Control.

The stable package is published to PyPI:

pip install aikernel-governance

The distribution name is aikernel-governance. Import the module as aikernel_governance.

Scope

aikernel-governance exposes the public AIKernel.Control contract boundary as a single Python API:

  • execution request, result, and snapshot envelopes
  • provider contract metadata
  • Bonsai provider, tokenizer, model config, and model-state wrappers
  • emulator graph, node, scheduler, policy, and engine wrappers
  • CPU kernel wrapper
  • diagnostics replay approval wrapper
  • GPU delegate contract loader
  • managed assembly discovery and pythonnet loading

The package does not provide a separate Python implementation of governance semantics. It does not expose internal engine helpers, transport-specific logic, OS-specific implementations, or private runtime state.

Managed Assemblies

The wheel bundles the public Control and contract assemblies under aikernel_governance/native:

  • AIKernel.Abstractions.dll
  • AIKernel.Dtos.dll
  • AIKernel.Enums.dll
  • AIKernel.Control.Core.dll
  • AIKernel.Control.CPU.dll
  • AIKernel.Control.Diagnostics.dll
  • AIKernel.Control.Emulator.dll
  • AIKernel.Control.GPU.dll

governance_assemblies() resolves bundled assemblies first, then paths from AIKERNEL_GOVERNANCE_ASSEMBLY_PATH, then matching packages from the NuGet global-packages cache.

load_governance_runtime() loads the resolved assemblies through pythonnet.

API

from aikernel_governance import (
    ExecutionRequest,
    ExecutionResult,
    Snapshot,
    ProviderContract,
    GovernanceClient,
)

Example:

from aikernel_governance import ExecutionRequest, GovernanceClient

request = ExecutionRequest(
    model="bonsai-1.7b",
    input="hello",
    parameters={"execution_id": "exec-001"},
)

client = GovernanceClient(backend)
result = client.submit(request)
snapshot = client.snapshot("exec-001")

backend must provide the governance operations used by the client:

  • submit(request)
  • snapshot(id)
  • result(id)

When pythonnet is available, wrappers can be converted to public C# DTOs with to_managed().

Build

cd C:\Users\HP\source\repos\AIKernel-NET\AIKernel.Control
dotnet test AIKernel.Control.slnx -c Release --no-restore
dotnet pack AIKernel.Control.slnx -c Release --no-restore
cd python
py -m pytest
py -m build --wheel
py -m twine check dist\aikernel_governance-0.1.0-py3-none-any.whl

Source Validation

For source-based local validation, use a clean virtual environment:

pip install --force-reinstall \
  git+https://github.com/AIKernel-NET/AIKernel.Control.git#subdirectory=python

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

aikernel_governance-0.1.0-py3-none-any.whl (229.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for aikernel_governance-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30fda30535ae91d3c9dab9331aa7de10fdd68f1cbf558edca93fe9b1d4d445e6
MD5 474ef696cdbf0809ebb913198399b15e
BLAKE2b-256 f502a7295634c5d4ea459f025195bcd6f78fa033059e3ced8b6b9c17f55785b3

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