Metadata-Version: 2.4
Name: hank-model-transport
Version: 1.0.2
Summary: Independent model provider transports, credentials, and execution binding
License-Expression: MIT
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: hank-model-authority<2,>=1.7.17
Requires-Dist: agent-workflow-contracts<2,>=1
Requires-Dist: hank-contracts<2,>=1.6
Requires-Dist: httpx>=0.28.1
Requires-Dist: httpx2<3,>=2.5
Provides-Extra: anthropic
Requires-Dist: anthropic<2,>=1.6; extra == "anthropic"
Provides-Extra: openai
Requires-Dist: openai<4,>=3.14; extra == "openai"
Provides-Extra: claude
Requires-Dist: claude-agent-sdk==0.2.153; extra == "claude"
Provides-Extra: all
Requires-Dist: anthropic<2,>=1.6; extra == "all"
Requires-Dist: openai<4,>=3.14; extra == "all"
Requires-Dist: claude-agent-sdk==0.2.153; extra == "all"

# hank-model-transport

Independent model transport and execution-binding primitives. Distribution
`hank-model-transport` version `1.0.2`; Python import root
`hank_model_transport`. Requires Python 3.10 or newer.

## Ownership and dependencies

This package builds provider requests, streams responses, classifies credential
failures, manages provider credential stores, binds selected capabilities for
execution, and records provider-call usage. It does not own HTTP gateway routes,
product authentication resolvers, sessions, or model registry data.

Model selection, registry entries, compatibility facts, and rates come from
`model_authority` (`hank-model-authority`). Shared wire contracts come from
`agent-workflow-contracts` and `hank-contracts`. HTTP transports use `httpx` and
`httpx2`; provider SDKs are optional. There is no dependency on the gateway or
product source trees, and no compatibility reexports from those packages.

Gateway `0.31.0` and CLI `0.8.17` use this `1.x` distribution as the transport
owner. Code that previously imported transport modules from `agent_gateway`
must import their counterparts from `hank_model_transport`; the old paths are
removed rather than reexported. Gateway hosts retain authentication and
capability-resolution integration and supply the gateway's explicit runtime
binding when calling `send_prompt`.

## Install

Install this distribution with the extras required for the selected adapters:

```sh
pip install 'hank-model-transport[anthropic]'
pip install 'hank-model-transport[openai]'
pip install 'hank-model-transport[claude]'
```

The `all` extra installs all three provider SDKs. HTTP-native adapters need no
SDK extra. Provider SDK imports remain deferred until the selected adapter needs
them.

## Modules

| Path | Responsibility |
| --- | --- |
| [`hank_model_transport/providers/`](hank_model_transport/providers/README.md) | Provider adapters, wire helpers, OAuth and API-key stores, quota accounting |
| `hank_model_transport/auth.py` | Credential failure types, entitlement classification, and pure placement helpers; no product auth configuration or resolver classes |
| `hank_model_transport/rate_limit.py` | Process-local Anthropic token buckets |
| `hank_model_transport/openai_history_fence.py` | OpenAI history and signature fencing |
| `hank_model_transport/user_runtime_credentials.py` | Explicit private single-user credential bundles |
| `hank_model_transport/policy_imports.py` | Explicit process-scoped host policy binding for the SDK adapter |
| `hank_model_transport/tool_errors.py` | Structured error results used for provider history repair |
| `hank_model_transport/package_info.py` | This distribution's version lookup |

Import provider classes and helpers directly from their owning modules, for
example `hank_model_transport.providers.base.ModelProvider`. The package root
intentionally does not reexport implementation modules.

The SDK adapter reads only the host policy explicitly installed through
`hank_model_transport.policy_imports.configure_server_policy()`; it does not
discover application modules. The embedding host must configure that binding
before constructing SDK requests that need product policy.

Credential-store paths, environment variable names, log namespaces, and existing
operator CLI hints retain their established values. A CLI hint names an external
operator tool, not a runtime import or an entrypoint supplied by this distribution.
