Skip to main content

Homer SDK is a thin client. All governance, policy checks, and intelligence run on Homer Server.

Project description

Homer SDK (Thin Client)

Python SDK for Homer Server. Homer Server is the semantic control and governance runtime for AI.

The SDK is intentionally thin. It forwards requests to Homer Server, where policy enforcement, semantic intelligence, runtime controls, and decision lineage are executed.

Public Demo

  • Demo server: https://homer-server-demo.onrender.com
  • Bootstrap key: demo_public_v1
from homer_sdk import Homer

homer = Homer(
    server_url="https://homer-server-demo.onrender.com",
    api_key="demo_public_v1",
)

# SDK auto-exchanges bootstrap key for a short-lived session key.
resp = homer.invoke(
    provider="openai",
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Hello from demo"}],
)
print(resp.raw_response["content"])

Install

pip install homer-sdk

Optional provider extras:

pip install "homer-sdk[openai]"
pip install "homer-sdk[anthropic]"
pip install "homer-sdk[all]"

Quick Start (Your Server)

from homer_sdk import Homer

homer = Homer(
    server_url="https://your-homer-server",
    api_key="hk-...",
)

health = homer.health()
print(health["status"])

Chat Invocation

from homer_sdk import Homer

homer = Homer(server_url="https://your-homer-server", api_key="hk-...")
client = homer.openai()

resp = client.chat.completions.create(
    model="gpt-4o-mini",
    messages=[{"role": "user", "content": "Summarize this policy text."}],
)

print(resp.raw_response.choices[0].message.content)
print(resp.homer.classification)
print(resp.homer.policy)
print(resp.homer.audit)

Runtime Execution (Server Connector Path)

Use execute() to run policy-gated actions through server connectors.

resp = homer.execute(
    action="send_webhook",
    payload={
        "url": "https://hooks.example.com/ingest",
        "body": {"event": "policy_approved"},
    },
)
print(resp.raw_response["execution"])

Core Methods

  • Homer.health() -> GET /v1/health
  • Homer.invoke(...) -> POST /v1/invoke
  • Homer.execute(...) -> POST /v1/invoke with execution payload
  • Homer.analyze(text) -> POST /v1/analyze
  • Homer.context.* -> /v1/context/...
  • Semantic/graph helpers -> /v1/semantic/...

Support and Feedback

If you hit any issues, please share feedback or error details:

Helpful details for issue reports:

  • SDK version
  • Python version
  • Full traceback
  • Request snippet (without secrets)
  • Timestamp and timezone

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

homer_sdk-1.3.0.tar.gz (59.9 kB view details)

Uploaded Source

Built Distribution

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

homer_sdk-1.3.0-py3-none-any.whl (76.2 kB view details)

Uploaded Python 3

File details

Details for the file homer_sdk-1.3.0.tar.gz.

File metadata

  • Download URL: homer_sdk-1.3.0.tar.gz
  • Upload date:
  • Size: 59.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for homer_sdk-1.3.0.tar.gz
Algorithm Hash digest
SHA256 2adea21111784935484d4dc262f320e2f953815823bcc975f9ffaddd48245e79
MD5 81a12ca70d0e6b806246d0600b559075
BLAKE2b-256 95a9ffe180f353c2159ff85fa7466cc2fc98dcbb456fcd621679cb2d9b12ee54

See more details on using hashes here.

File details

Details for the file homer_sdk-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: homer_sdk-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 76.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for homer_sdk-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fffee4c046f6d6ab5172960b22c09f81f63b9c623d2d7ee96a5b79ea8cd73afc
MD5 37e9399f89e333b98929449b5b25e987
BLAKE2b-256 7c134ae581c35c89332983704cfe2cc12421fd8a59fbdced4bd783b02f80e3d6

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