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.dllAIKernel.Dtos.dllAIKernel.Enums.dllAIKernel.Control.Core.dllAIKernel.Control.CPU.dllAIKernel.Control.Diagnostics.dllAIKernel.Control.Emulator.dllAIKernel.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aikernel_governance-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aikernel_governance-0.1.0-py3-none-any.whl
- Upload date:
- Size: 229.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30fda30535ae91d3c9dab9331aa7de10fdd68f1cbf558edca93fe9b1d4d445e6
|
|
| MD5 |
474ef696cdbf0809ebb913198399b15e
|
|
| BLAKE2b-256 |
f502a7295634c5d4ea459f025195bcd6f78fa033059e3ced8b6b9c17f55785b3
|