Python SDK for HELM — fail-closed tool calling for AI agents
Project description
HELM SDK — Python
Typed Python client for the HELM kernel API. One dependency: httpx.
Install
pip install helm-sdk
Quick Example
from helm_sdk import HelmClient, HelmApiError, ChatCompletionRequest, ChatMessage
helm = HelmClient(base_url="http://localhost:8080")
# OpenAI-compatible chat (tool calls governed by HELM)
try:
res = helm.chat_completions(ChatCompletionRequest(
model="gpt-4",
messages=[ChatMessage(role="user", content="List files in /tmp")],
))
print(res.choices[0].message.content)
except HelmApiError as e:
print(f"Denied: {e.reason_code}") # e.g. DENY_TOOL_NOT_FOUND
# Export + verify evidence pack
pack = helm.export_evidence()
result = helm.verify_evidence(pack)
print(result.verdict) # PASS
# Conformance
from helm_sdk import ConformanceRequest
conf = helm.conformance_run(ConformanceRequest(level="L2"))
print(conf.verdict, conf.gates, "gates")
API
| Method | Endpoint |
|---|---|
chat_completions(req) |
POST /v1/chat/completions |
approve_intent(req) |
POST /api/v1/kernel/approve |
list_sessions() |
GET /api/v1/proofgraph/sessions |
get_receipts(session_id) |
GET /api/v1/proofgraph/sessions/{id}/receipts |
export_evidence(session_id?) |
POST /api/v1/evidence/export |
verify_evidence(bundle) |
POST /api/v1/evidence/verify |
replay_verify(bundle) |
POST /api/v1/replay/verify |
conformance_run(req) |
POST /api/v1/conformance/run |
health() |
GET /healthz |
version() |
GET /version |
Error Handling
All errors raise HelmApiError with a typed reason_code:
try: helm.chat_completions(req)
except HelmApiError as e: print(e.reason_code)
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 Distribution
helm_sdk-0.1.0.tar.gz
(6.5 kB
view details)
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 helm_sdk-0.1.0.tar.gz.
File metadata
- Download URL: helm_sdk-0.1.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efedecabfeb01e1a0cf00179996d5d0528e2a2a30a2f699b2c8f71d19d7ef7f6
|
|
| MD5 |
ea280101872ff3271bfe0696123086a7
|
|
| BLAKE2b-256 |
554b9e296663edddc654e84374a34bb5dc89b1a4daa6e6a1be4405a53adca7f7
|
File details
Details for the file helm_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: helm_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b90abfe0501e52412aa36ea602d0365f3461d404245de2906b937a351d6b2a5
|
|
| MD5 |
ebc16c9475c0ca9136f0eacf64da185d
|
|
| BLAKE2b-256 |
07f2af48673d5ace4a4fc598a7a6207b2035d87f259b2510e4691c11bd53130e
|