Skip to main content

Ephapsys SDK

Lightweight SDK for EC-ANN modulation, trusted agent provisioning, and runtime security.


📦 Installation

pip install ephapsys

Optional feature groups:

pip install ephapsys                    # default runtime + language/modulation stack
pip install "ephapsys[audio]"
pip install "ephapsys[eval]"
pip install "ephapsys[vision]"      # alias: [video]
pip install "ephapsys[all]"

TPM personalization prerequisites (Linux):

pip install "ephapsys[tpm]"
sudo apt-get install -y tpm2-tools

If you are on Ubuntu 22.04, ensure tpm2-tools, tpm2-tss, and tpm2-pytss are version-compatible. Ubuntu 22.04 commonly ships TSS2 3.x, while newer tpm2-pytss builds may expect TSS2 4.x.

Choose the profile by workload:

Workload Install command
Lightweight orchestrator/proxy only pip install ephapsys
Agent runtime (HelloWorld language) pip install ephapsys
Agent runtime (Robot multimodal) pip install "ephapsys[modulation,audio,vision,embedding]" + pip install webrtcvad sounddevice pyaudio
Agent runtime (GGUF / llama.cpp edge CPU) pip install ephapsys + install llama-cpp-python or llama-cli
Modulators/training scripts pip install ephapsys
Modulators with full evaluation/report stack pip install "ephapsys[all]"

🚀 Quickstart

from ephapsys import TrustedAgent

agent = TrustedAgent.from_env()

ok, report = agent.verify()
if not ok:
    raise RuntimeError(f"Agent blocked: {report}")

agent.prepare_runtime()
print(agent.run("Hello world", model_kind="language"))

⚙️ Environment Variables

Variable Description
EPHAPSYS_AGENT_ID Agent ID/label assigned by AOC
AOC_BASE_URL API endpoint, e.g. https://api.ephapsys.com
AOC_ORG_ID Org identifier (non-secret tenant scope)
AOC_PROVISIONING_TOKEN Provisioning credential exchanged for short-lived device token
EPHAPSYS_STORAGE_DIR Optional, defaults to .ephapsys_state

For edge production, use a hardware anchor (tpm or hsm) and avoid PERSONALIZE_ANCHOR=none. (tee and dsim are not yet enabled.)

PKCS#11 tokens (hsm anchor)

Any PKCS#11 token (TEE-backed tokens, HSMs, USB tokens) can back the hsm anchor. Install the extra and configure the token; only configuration is device-specific:

pip install "ephapsys[pkcs11]"

PERSONALIZE_ANCHOR=hsm
PKCS11_MODULE=/path/to/pkcs11-module.so    # the token vendor's PKCS#11 library
PKCS11_TOKEN_LABEL=my-token                 # or PKCS11_TOKEN_SERIAL (slot index is not accepted)
PKCS11_PIN_FILE=/secure/path/pin            # or PKCS11_PIN
PKCS11_SIGN_KEY_ID=01                       # or PKCS11_SIGN_KEY_LABEL: EC P-256 or RSA-2048+
PKCS11_KEM_KEY_ID=02                        # or PKCS11_KEM_KEY_LABEL: EC P-256 with derive permission
EPHAPSYS_DEVICE_ID=device-0001              # stable device identity
  • Two separate, sensitive, non-extractable token keys: a sign key for personalization evidence and device authentication, and a KEM key (ECDH) that receives the model key and protects the encrypted-at-rest cache.
  • Keys must be enrolled with the AOC by an operator before personalization; the SDK never enrolls keys itself. ephapsys hsm show-key prints the public keys and SPKI SHA-256 fingerprints to register.
  • Selection is fail-closed: ambiguous provider configuration (PKCS11_MODULE together with HSM_HELPER/HSM_KMS_KEY/HSM_EVIDENCE_PATH), missing or duplicate keys, extractable keys and unsupported mechanisms are all rejected.
  • Scope: token-backed key custody. Whether a token is hardware-backed depends on the deployed provider; SoftHSM is for testing only. PKCS#11 provides no measured-boot attestation, and decrypted model material is held in process memory while in use.

Runtime download tuning (optional):

AOC_DOWNLOAD_PROGRESS=1
AOC_DOWNLOAD_RETRIES=3
AOC_DOWNLOAD_TIMEOUT=60
AOC_DOWNLOAD_CHUNK_KB=256
AOC_DOWNLOAD_PROGRESS_STEP_MB=5
AOC_DOWNLOAD_WORKERS=4

Optional GGUF runtime tuning:

AOC_LLAMA_CPP_CLI=llama-cli
AOC_GGUF_CTX=2048
AOC_GGUF_MAX_NEW_TOKENS=256

🎛️ ModulatorClient

Start / iterate / complete modulation on model templates:

from ephapsys.modulation import ModulatorClient

mod = ModulatorClient(api_base="https://api.ephapsys.com", api_key="dev")
resp = mod.start_job(
    model_template_id="google/gemma-2b",
    variant="ec-ann",
    search_space={"lr": [1e-3, 1e-4]},
    kpi={"accuracy": "max"},
    mode="auto"
)
print(resp)

🔗 A2AClient (Agent-to-Agent)

Send, list, and ack org-scoped A2A messages:

from ephapsys import A2AClient

a2a = A2AClient.from_env()

sent = a2a.send_message(
    from_agent_id="agent_sender",
    to_agent_id="agent_receiver",
    payload={"op": "ping"},
    message_type="event",
)

inbox = a2a.inbox(agent_id="agent_receiver", limit=20)
first = (inbox.get("items") or [None])[0]
if first:
    a2a.ack_message(message_id=first["id"], agent_id="agent_receiver")

A2AClient.from_env() uses AOC_A2A_TOKEN (and falls back to AOC_MODULATION_TOKEN for compatibility).

Optional signed mode (recommended for production):

export AOC_A2A_TOKEN=a2a_xxx
export AOC_ORG_ID=org_xxx
export A2A_SIGN_REQUESTS=1
export A2A_HMAC_SECRET=replace_with_org_secret

When A2A_SIGN_REQUESTS=1, A2AClient.send_message() adds:

  • x-a2a-ts
  • x-a2a-nonce
  • x-a2a-sig

Backend verification controls:

  • A2A_REQUIRE_SIGNATURE=1
  • A2A_HMAC_SECRET
  • A2A_REPLAY_WINDOW_SECONDS (default 300)

🖥️ CLI

The SDK includes a CLI (ephapsys) for working with agents, models, modulation, and certificates.
Authentication is required before most commands.

🔑 Login

ephapsys login --username izzo
Password: ****
✅ Logged in.

This stores a JWT in ~/.ephapsys_state/session.json.

Use --base-url when you want a non-production environment:

ephapsys --base-url https://api.staging.ephapsys.ai login

📦 Models

Register, list, and remove models tied to your org.

# Register
ephapsys model register --provider huggingface --ids google/gemma-2b
ephapsys model register --provider huggingface --ids google/embeddinggemma-300m  google/flan-t5-base
ephapsys model register --provider huggingface --ids microsoft/speecht5_tts
ephapsys model register --provider huggingface --ids google/gemma-2b google/embeddinggemma-300m  microsoft/speecht5_tts

# List (pretty table)
ephapsys model list
name                 provider     status
-----------------------------------------
google/gemma-2b      huggingface  registered
google/embedding...  huggingface  registered

# List (JSON)
ephapsys model list --json

# Remove
ephapsys model remove --provider huggingface --id google/gemma-2b

🤖 Agents

# List (pretty table)
ephapsys agent list
agent_id     label        status
--------------------------------
agent-123    Sales Bot    registered
agent-456    SupportBot   enabled

# List (JSON)
ephapsys agent list --json

Other agent commands (verify, enable, disable, revoke, export-manifest) are also available.


📊 Modulation

# Start job
ephapsys tune start --model-template-id google/gemma-2b --variant ec-ann   --search-space '{"lr":[1e-3,1e-4]}' --kpi '{"accuracy":"max"}'

# Report metrics
ephapsys tune metrics --job-id JOB123 --metrics '[{"step":1,"val":0.84}]'

# Request next step
ephapsys tune next --job-id JOB123 --last-metrics '[{"step":1,"val":0.84}]'

# Complete job
ephapsys tune complete --job-id JOB123 --artifacts '{"weights":"s3://..."}'

🧪 Samples

Access the samples at: https://github.com/ephapsys

Metadata

Release files for ephapsys 0.2.99

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

Source distribution (sdist)

Source distribution for ephapsys 0.2.99
File Size Uploaded Provenance Actions
ephapsys-0.2.99.tar.gz 122.7 kB Without provenance Details for ephapsys-0.2.99.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ephapsys 0.2.99
File Interpreter ABI Platform Actions
ephapsys-0.2.99-py3-none-any.whl Python 3 none any Details for ephapsys-0.2.99-py3-none-any.whl

Total release size: 250.2 kB

Release files / ephapsys-0.2.99.tar.gz

Download URL ephapsys-0.2.99.tar.gz
Size 122.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2cfb5eb17fc2cb325ffd5b9166271eb56e7229abef3886a237db6d2d301050e4
BLAKE2b-256 checksum
How to use checksums
8e9295cbf61f755b45b40165f1b8b61f9d15ee078ff02147dffc8cb9a244936d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Release files / ephapsys-0.2.99-py3-none-any.whl

Download URL ephapsys-0.2.99-py3-none-any.whl
Size 127.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67453cd261db29f9a8796b667cc876dd431f3aa56e77902a70011b065268ef2b
BLAKE2b-256 checksum
How to use checksums
52ac5eb7891445a587577dd7495bc82fe8a66270dca87d153f64c76f8aca1d91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.2

Security for ephapsys 0.2.99

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.99 This release

2 release files No provenance

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