Skip to main content

Zu model-provider adapters: scripted, anthropic, openai-compatible

Project description

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.

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

zu_providers-0.3.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

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

zu_providers-0.3.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file zu_providers-0.3.1.tar.gz.

File metadata

  • Download URL: zu_providers-0.3.1.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for zu_providers-0.3.1.tar.gz
Algorithm Hash digest
SHA256 f0eb62bb03658f5b3fa01382fb6e3a376545aaabd7864428ab18b1a23503d272
MD5 1a29da823959d8a2b59075f3866ab19c
BLAKE2b-256 2198c7f103c25f6bae3259ee3b6c06a57d22bbdf84ced2a7e0489ecc28466ab5

See more details on using hashes here.

File details

Details for the file zu_providers-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: zu_providers-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for zu_providers-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c7e11b5bfacae5929b417f399aff6e4a3e36079cac621f3db8f9de62f52c360f
MD5 7308f1ef22d2f9e5818b80db1907fab3
BLAKE2b-256 b7ecb97c4a5ba8252df7c66dd670ba91a60703288b30bb4aea6542d4af33c93a

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