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://demo.homersemantics.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.3.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.3-py3-none-any.whl (76.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: homer_sdk-1.3.3.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.3.tar.gz
Algorithm Hash digest
SHA256 2904e34051427546136d80822585561688e8e2f0563ab391b6a985bf6929d516
MD5 829d8b2e0fdc7cc4ea610256516c8732
BLAKE2b-256 ac6d9d6d69f5fa0914c6983d9a513453fc2f40a548996609fc1e880d337a1534

See more details on using hashes here.

File details

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

File metadata

  • Download URL: homer_sdk-1.3.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8f8469d587492d8af52e019519d889aa5836e7956e4eb60b2b9eb7047db5e5a2
MD5 1cbeba095364dae121a1e2cc007d5689
BLAKE2b-256 a9c403557ce0768b4e18770ba5c154d99c92f7bd0f5e85726c0b3535aaf4637f

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