Skip to main content

Ephapsys helps you empower and govern AI agents.

Project description

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 hardware anchors (tpm, tee, dsim, hsm) and avoid PERSONALIZE_ANCHOR=none.

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

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

ephapsys-0.2.66.tar.gz (82.1 kB view details)

Uploaded Source

Built Distribution

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

ephapsys-0.2.66-py3-none-any.whl (84.7 kB view details)

Uploaded Python 3

File details

Details for the file ephapsys-0.2.66.tar.gz.

File metadata

  • Download URL: ephapsys-0.2.66.tar.gz
  • Upload date:
  • Size: 82.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.13

File hashes

Hashes for ephapsys-0.2.66.tar.gz
Algorithm Hash digest
SHA256 0fdc6fd751c27bea2f5f64f1a6f401e476484257f033fcf4927bb31f72440119
MD5 1d6e7b086d6570f8fbd031143a561b28
BLAKE2b-256 6184203a321b6897a9169e4b78d4f9709ad3e6d60540d964788cf2d6ca3cbe2d

See more details on using hashes here.

File details

Details for the file ephapsys-0.2.66-py3-none-any.whl.

File metadata

  • Download URL: ephapsys-0.2.66-py3-none-any.whl
  • Upload date:
  • Size: 84.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.13

File hashes

Hashes for ephapsys-0.2.66-py3-none-any.whl
Algorithm Hash digest
SHA256 59901d4a5e35af40f5ac6f4326c5195d3013d16f6687843470d601b6510db328
MD5 d9b3f439fea2faa9602ad8269a379187
BLAKE2b-256 729d1db7902c3f3ef4d99aa6ab2b8427a8cccf575d67ee110f859bffd88041b1

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