Skip to main content

Python SDK for interacting with Keyhole-compatible runtimes

Project description

keyhole-sdk

Python SDK for interacting with Keyhole-compatible runtimes.

Install

pip install keyhole-sdk

Quickstart

from keyhole_sdk import KeyholeClient

client = KeyholeClient(base_url="http://localhost:8080")

# Health check
print(client.health())

# Runtime identity and capabilities
identity = client.identity()
print(identity)

# Current runtime state
print(client.state())

# Submit a realization request
receipt = client.realize(
    candidate_digest="sha256:abc123",
    payload={},
)
print(receipt)

# Replay the same digest safely
replay = client.realize(
    candidate_digest="sha256:abc123",
    payload={},
)
print(replay)

client.close()

Note: By default the test runtime runs in local-only mode — realization is not gated through MCP governance. Set KEYHOLE_MCP_URL and KEYHOLE_MCP_TOKEN on the runtime to enable governed mode.

API

Method Description
health() GET /healthz — runtime liveness
identity() GET /identity — runtime identity and capabilities
state() GET /state — current runtime-local state
realize(candidate_digest, payload) POST /realize — bounded realization request
close() Close the underlying HTTP session

Models

Pydantic models are available in keyhole_sdk.models:

  • RuntimeIdentity
  • RuntimeState
  • RealizationRequest
  • RealizationReceipt

Configuration

client = KeyholeClient(
    base_url="http://localhost:8080",
    timeout=10.0,  # default
)

You can also pass a custom requests.Session for advanced use cases.

Compatibility

RuntimeBridgeClient is available as a backward-compatible alias for KeyholeClient.

License

Apache 2.0 — see LICENSE.

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

keyhole_sdk-0.1.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

keyhole_sdk-0.1.2-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file keyhole_sdk-0.1.2.tar.gz.

File metadata

  • Download URL: keyhole_sdk-0.1.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for keyhole_sdk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 da20add7593a6820894a8e4ed35dbcf1a5c12cdf28bf9a4616927cc0fc56d402
MD5 769229fc01bedd9bb9c7b8b3273a7b58
BLAKE2b-256 8f4d6df927f446e74bb42a1890ab8276f8c370e06a0438b0833a97bce1507b20

See more details on using hashes here.

File details

Details for the file keyhole_sdk-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: keyhole_sdk-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for keyhole_sdk-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6d4a6f26e39aaf8827fa5633bd5b09c95c265be4a3331df22a08cc3c911f8451
MD5 b3d862e95910fc41c36358c2c5d116ca
BLAKE2b-256 edefe33cc1a8e6830e312c7fcd180ee1a8f5756d566ff9fd84387986a3435ec5

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