Metadata-Version: 2.4
Name: zu-providers
Version: 0.5.0
Summary: Zu model-provider adapters: scripted, anthropic, openai-compatible
Project-URL: Homepage, https://github.com/k3-mt/zu
Project-URL: Repository, https://github.com/k3-mt/zu
License-Expression: Apache-2.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: zu-core==0.5.0
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40; extra == 'anthropic'
Provides-Extra: openai
Requires-Dist: openai>=1.40; extra == 'openai'
Description-Content-Type: text/markdown

# zu-providers

Model adapters — the **`ModelProvider`** port (the any-model seam). An adapter
turns the harness's one normalized `ModelRequest` into a `ModelResponse` (text +
tool calls + usage + finish reason) and declares its `Capabilities`. The core
never special-cases a provider; it reads capabilities and proceeds.

**Credentials are resolved from the environment inside the adapter** — never
placed in the model's context or in a config file.

## Registered plugins (`zu.providers`)

| Name | Class | Notes |
|------|-------|-------|
| `scripted` | `ScriptedProvider` | The fake model: replays fixed moves in order. Deterministic; the basis of every offline test. No key, no network. |
| `anthropic` | `AnthropicProvider` | The Anthropic Messages API. Needs `[anthropic]` SDK extra + an API key. |
| `openai-compatible` | `OpenAICompatibleProvider` | Any OpenAI-compatible endpoint (OpenAI, OpenRouter, Ollama, vLLM) via a base URL. Needs `[openai]` SDK extra. |

`_messages.py` holds the shared request/response translation both real adapters
build on, so they behave identically against the neutral contract.

## Extend

Implement the `ModelProvider` shape, register it under `zu.providers` in
`pyproject.toml`, and add a deterministic test (the contract test asserts every
adapter behaves identically on the neutral surface).

## Tests

`uv run pytest packages/zu-providers` — offline. Live-API smoke tests are opt-in
behind `ZU_LIVE_*` env flags.
