Skip to main content

brokk-anvil-client

Native asynchronous Python bindings for Anvil's standalone LLM client. Install with uv add brokk-anvil-client. Binary wheels require no Rust toolchain and do not download or launch the Anvil executable.

import asyncio
from anvil_client import Client

async def main():
    async with Client() as client:
        result = await client.infer(
            model="deepseek::deepseek-v4-flash",
            messages=[{"role": "user", "content": "Return a short greeting."}],
            schema={"type": "object", "properties": {"greeting": {"type": "string"}},
                    "required": ["greeting"], "additionalProperties": False},
        )
        print(result.output, result.usage)

asyncio.run(main())

Models require an explicit codex::, meta::, kimi::, grok::, or deepseek:: prefix. Credentials and provider behavior are shared with anvil infer. DeepSeek uses DEEPSEEK_API_KEY or Anvil's stored DeepSeek credentials. The client supplies no tools and creates no agent sessions.

Client.infer accepts system/user messages, a JSON Schema, its schema_name, optional reasoning_effort and service_tier, total timeout (120 seconds), first-progress idle_timeout (60), inter-progress stall_timeout (30), and validation_retries (one additional attempt). Results expose validated output, usage, and effective request settings. All timeouts must be finite and positive.

InferenceError.kind classifies errors; specialized subclasses include AuthenticationError, RateLimitError, StructuredOutputError, and InferenceTimeoutError. Asyncio cancellation cancels the native future. close() cancels active requests and makes the client unusable; it is idempotent. Connections and lazily loaded credentials are reused for the client's lifetime. Create a new client after changing credentials. Standard CPython 3.11+ is supported; free-threaded CPython wheels are not currently published.

From a source checkout, run uvx maturin develop --manifest-path crates/anvil-client-python/Cargo.toml in an activated virtual environment. Binding builds depend only on anvil-client, not Anvil's agent or Wasm runtime.

Before building release wheels, run python scripts/prepare-python-client.py from the repository root to stage generated third-party license notices.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

brokk_anvil_client-0.28.4-cp311-abi3-win_amd64.whl (5.0 MB view details)

Uploaded CPython 3.11+Windows x86-64

brokk_anvil_client-0.28.4-cp311-abi3-manylinux_2_28_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

brokk_anvil_client-0.28.4-cp311-abi3-manylinux_2_28_aarch64.whl (6.0 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

brokk_anvil_client-0.28.4-cp311-abi3-macosx_11_0_arm64.whl (5.4 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file brokk_anvil_client-0.28.4-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: brokk_anvil_client-0.28.4-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 5.0 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brokk_anvil_client-0.28.4-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f2c5147b262e6376255dccd284127ffbc7404c0f9822f1f8a89455a3bc8d0633
MD5 78fabf411d1b47141484ea0d08f6ec05
BLAKE2b-256 bf0e83e5a02ada69f780418ae96bef6f5090c4af798d32778b69dcf0bafc35e7

See more details on using hashes here.

File details

Details for the file brokk_anvil_client-0.28.4-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: brokk_anvil_client-0.28.4-cp311-abi3-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.11+, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brokk_anvil_client-0.28.4-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f2a4fc663879fa17b9fdee0f9a42108948204c49267d1061dfa42186b35f8dd3
MD5 5fc70af3dced02a21db9cb5b7d45dfe9
BLAKE2b-256 d0d8cd767cbfa856c4da300bc1a686e45a64ff18a357f107f7eb0e67e0fdd1fe

See more details on using hashes here.

File details

Details for the file brokk_anvil_client-0.28.4-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: brokk_anvil_client-0.28.4-cp311-abi3-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 6.0 MB
  • Tags: CPython 3.11+, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brokk_anvil_client-0.28.4-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 37f3c5bcd5b5d98e5ae0dfa2771fd40c8ae6fda2427b1e3b2727a51be97b7637
MD5 52e5b5c2bc50cee8740dc45db0e143cb
BLAKE2b-256 086b235af41430a3c76f0167dffb9aec32d1d60ca53221babc95e1d92f7a8d11

See more details on using hashes here.

File details

Details for the file brokk_anvil_client-0.28.4-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

  • Download URL: brokk_anvil_client-0.28.4-cp311-abi3-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 5.4 MB
  • Tags: CPython 3.11+, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for brokk_anvil_client-0.28.4-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11fbd0b1b145e6ca64d04ed7a4390460d8beaf6db0eb5eca0b5d5f4018b96044
MD5 14818cfc246ed41e21ce27297f7e4f4b
BLAKE2b-256 d723f20b0b98d1a501388d33555e4b05c4d80e8ea4dd3bc5ea15b8a24581f477

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.28.4 This release

4 files

0.28.3

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page