agentforge-anthropic
Anthropic native LLM provider for AgentForge.
Use this package when you want to call Claude directly via Anthropic's native API rather than through AWS Bedrock. Native access ships latest-model support, prompt caching, extended thinking, and per-token streaming the day Anthropic releases them.
Install
pip install "agentforge-anthropic[anthropic]"
The bare pip install agentforge-anthropic install keeps the
package importable for tests; the production runner needs the
anthropic SDK, which the [anthropic] extra pulls in.
Use
from agentforge import Agent
from agentforge_anthropic import AnthropicClient
# Direct instantiation
client = AnthropicClient.from_config(
model="claude-sonnet-4-7",
api_key="sk-ant-...", # or omit and use ANTHROPIC_API_KEY
)
# Or via Agent's resolver (recommended)
agent = Agent(model="anthropic:claude-sonnet-4-7")
Capabilities
AnthropicClient.capabilities() declares the closed-vocabulary set:
tools— Claude's tool-use APIjson_mode— JSON response format via system-prompt addendumcaching— prompt caching withcache_control: ephemeralblocksthinking— extended thinking viathinking={"type": "enabled", "budget_tokens": ...}streaming— per-token streaming viamessages.stream()
Callers gate optional methods on client.supports("capability")
before invoking — the additive contract in
ADR-0009.
Why a separate sister package from agentforge-bedrock?
Both implement the same LLMClient contract but talk to
different endpoints:
agentforge-bedrock— Bedrock Converse API; Anthropic models routed via AWS; cross-region inference profiles; AWS IAM auth.agentforge-anthropic— Anthropic native API; direct; bearer-token auth; faster access to new model releases.
A string-id swap ("bedrock:..." → "anthropic:...") is the
only change in caller code.
Testing
Production runner under # pragma: no cover wraps the
anthropic SDK. Unit tests inject a FakeAnthropicRunner (in
agentforge_anthropic._inmem_runner) that records every
messages_create call. Live integration tests are gated behind
pytest -m live and need a real ANTHROPIC_API_KEY.
License
Apache-2.0. See LICENSE.
Metadata
Release files for agentforge-anthropic 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agentforge_anthropic-0.4.0.tar.gz | 17.4 kB | With provenance | Details for agentforge_anthropic-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agentforge_anthropic-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for agentforge_anthropic-0.4.0-py3-none-any.whl |
Total release size: 34.0 kB
Release files / agentforge_anthropic-0.4.0.tar.gz
| Download URL | agentforge_anthropic-0.4.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bd299657025f19da360f397cc746b7047b56506d9b0eb9c58309568a81759b6e
|
|
BLAKE2b-256 checksum How to use checksums |
7529db64242530ffc21b6a74e935fd2895ae798a6e4f64444c1d434f1529035a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.
Transparency logRelease files / agentforge_anthropic-0.4.0-py3-none-any.whl
| Download URL | agentforge_anthropic-0.4.0-py3-none-any.whl |
|---|---|
| Size | 16.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85effcf430cadcb91512deca6facafda2a95af6e8cbbfa6f153dd4c1a4fa8e21
|
|
BLAKE2b-256 checksum How to use checksums |
f564f9d13a1430f20063fe71e30b6f343e7c29d37e692900d8b219fa76af2202
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.
Transparency logSecurity for agentforge-anthropic 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agentforge_anthropic-0.4.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.