Metadata-Version: 2.1
Name: homer-sdk
Version: 1.2.3
Summary: Homer SDK (Beta): Semantic control plane SDK for governed AI interactions
Author-email: Anant Dhavale <info@homersemantics.com>
Maintainer-email: Anant Dhavale & Homer Semantics <info@homersemantics.com>
License: Proprietary
Project-URL: Homepage, https://homersemantics.com
Project-URL: Documentation, https://homersemantics.com/docs
Project-URL: Request Access, https://homersemantics.com
Keywords: ai,llm,governance,compliance,middleware,audit
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Intended Audience :: Developers
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Provides-Extra: openai
Provides-Extra: anthropic
Provides-Extra: postgres
Provides-Extra: postgres-binary
Provides-Extra: all
License-File: LICENSE

# Homer SDK (Beta) (Thin Client)

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

## Highlights
- Multi-provider wrappers (`openai`, `anthropic`, `azure_openai`, generic broker)
- Policy enforcement for input/output checks
- Content enrichment (classification, norm extraction, confidence, modality)
- Immutable-style decision ledger and telemetry helpers
- Context store utilities

## Quick Start

```python
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."}],
)

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

## Install

```bash
pip install homer-sdk
```

Provider SDK extras:

```bash
pip install "homer-sdk[all]"
pip install "homer-sdk[postgres]"         # source build of psycopg2
pip install "homer-sdk[postgres-binary]"  # convenience binary wheel
```

## Security Note (Broker/Gateway Mode)

If you pass `api_key` in `homer.broker(...)`, that key is sent to Homer Server in the `/v1/invoke` payload.

- SDK now refuses to send `broker_api_key` unless `HOMER_SERVER_URL` is HTTPS.
- Exception: local development on `http://localhost` or `http://127.0.0.1`.
- Recommended production pattern: keep downstream provider keys server-side and do not send them from clients.

## Access

Homer SDK requires a Homer Server instance. Contact ifo@homersemantics.com / anantdhavale@gmail.com to get access.

## Usage Terms

Usage limits and commercial terms are defined in TERMS_OF_SERVICE.md.

## License

Proprietary commercial license. See LICENSE.
Copyright © Anant Dhavale

## Contact

anantdhavale@gmail.com info@homersemantics.com
