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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file brokk_anvil_client-0.28.3-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: brokk_anvil_client-0.28.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1b0e49eb32a797b89646a68a2a20cb5e31b2ee274d11baec185e8b1fad374fb
|
|
| MD5 |
55b8a06ded9b6e9894e477a0e5ee8d34
|
|
| BLAKE2b-256 |
457478df66f143bff0a95cb1132c91d2bcb004aeb5599296bdad4f284054c58b
|
File details
Details for the file brokk_anvil_client-0.28.3-cp311-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: brokk_anvil_client-0.28.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9524f4f591b710dd830ad8abd985c4afb9fcfbad72ce9ba9abdc5c43d5cf3934
|
|
| MD5 |
d6d81f9afb97c84bf76434b86fcafee2
|
|
| BLAKE2b-256 |
cf0b5a2e63f48f48807c578af1846fb57f7e1048ad42ffb0a4eadfac476be9c2
|
File details
Details for the file brokk_anvil_client-0.28.3-cp311-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: brokk_anvil_client-0.28.3-cp311-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 5.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee6fadb09c70b20cc38c5dd986156c8a6d97218adeccfab66d503667fa9af549
|
|
| MD5 |
06826d54287d56da1859b663219ed45f
|
|
| BLAKE2b-256 |
f63b68e7268776becbb6add07c43c43a8eb5a0856300a83f1e47a65c6b52cf1a
|
File details
Details for the file brokk_anvil_client-0.28.3-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: brokk_anvil_client-0.28.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b3e48aff90e3fe383cd266eeb66bb7781f0496c83a2a02b0cf8917e4062b8c9
|
|
| MD5 |
acf9ff33f877be3f77b704f2cd59da9e
|
|
| BLAKE2b-256 |
139276de38f8b096fce3f4e07eef33084624d7db7e71cf774e6093ac5413baa1
|