Anthropic client plugin for space-evals
Project description
space-evals-client-anthropic
Anthropic client plugin for space-evals. Lets you use Anthropic models (Claude Sonnet, Claude Opus, Claude Haiku, etc.) as the target, customer, or judge in your space-evals test suite.
Installation
pip install space-evals-client-anthropic
This installs the core space-evals package and the anthropic SDK as dependencies.
Setup
Set your API key:
export ANTHROPIC_API_KEY=sk-ant-...
Or use a custom env var name in your config (see below).
Usage
Via config file
Add provider: anthropic to any client role in your space-evals.yaml:
clients:
target:
provider: anthropic
model: claude-sonnet-4-20250514
customer:
provider: anthropic
model: claude-haiku-4-5-20251001
judge:
provider: anthropic
model: claude-sonnet-4-20250514
Then run your tests:
space-evals run ./tests/
Via programmatic API
import asyncio
from space_evals.engine import run_tests
from space_evals.clients.base import get_client
target = get_client("anthropic", model="claude-sonnet-4-20250514")
result = asyncio.run(run_tests(
path="./tests/",
target_client=target,
))
Configuration
| Field | Type | Default | Description |
|---|---|---|---|
provider |
string | -- | Must be "anthropic" |
model |
string | -- | Model ID (e.g. claude-sonnet-4-20250514, claude-opus-4-20250514, claude-haiku-4-5-20251001) |
api_key_env |
string | ANTHROPIC_API_KEY |
Env var containing your API key |
params |
object | {} |
Extra parameters passed to the Anthropic API (e.g. temperature, max_tokens) |
Example with extra params
clients:
target:
provider: anthropic
model: claude-sonnet-4-20250514
api_key_env: MY_ANTHROPIC_KEY
params:
temperature: 0
max_tokens: 4096
What this plugin does
- Translates space-evals's
Messageformat to Anthropic's messages API - Extracts tool use blocks from responses into space-evals's
ToolCallformat - Handles system prompts via Anthropic's
systemparameter (used by the customer and judge roles) - Lazy-loads the Anthropic SDK on first use
- Defaults
max_tokensto 1024 if not specified
Requirements
- Python >= 3.11
space-evals>= 0.1.0anthropic>= 0.30ANTHROPIC_API_KEYenvironment variable (or custom viaapi_key_env)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
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 space_evals_client_anthropic-0.1.0.tar.gz.
File metadata
- Download URL: space_evals_client_anthropic-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
397d587c71a8c9471a51e7c39b3cd5e3bca4c9b92b9bd14a78a1af3ded4d9a21
|
|
| MD5 |
4e8c65a5536e01fd4858c28c983bbb1a
|
|
| BLAKE2b-256 |
e49ec57d17d33d992a0cd28c3d25541ce631ce5570a95e99b54d86e694c9969a
|
Provenance
The following attestation bundles were made for space_evals_client_anthropic-0.1.0.tar.gz:
Publisher:
publish.yaml on Raghav-Sahai/Evals
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
space_evals_client_anthropic-0.1.0.tar.gz -
Subject digest:
397d587c71a8c9471a51e7c39b3cd5e3bca4c9b92b9bd14a78a1af3ded4d9a21 - Sigstore transparency entry: 1429387643
- Sigstore integration time:
-
Permalink:
Raghav-Sahai/Evals@0be97e6f87840042bdd443fa53c783ad47587af6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Raghav-Sahai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@0be97e6f87840042bdd443fa53c783ad47587af6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file space_evals_client_anthropic-0.1.0-py3-none-any.whl.
File metadata
- Download URL: space_evals_client_anthropic-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d305dcb6e58da3517578b4635369a299fa88a3d2d1b8c28750879d2a89870fb
|
|
| MD5 |
e825bfc7ce79ce8b1517c39bb46b26ad
|
|
| BLAKE2b-256 |
a6cbf2dd17c27b5242872f3558ef20322316bd6d89070879bb9a100703ad5857
|
Provenance
The following attestation bundles were made for space_evals_client_anthropic-0.1.0-py3-none-any.whl:
Publisher:
publish.yaml on Raghav-Sahai/Evals
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
space_evals_client_anthropic-0.1.0-py3-none-any.whl -
Subject digest:
9d305dcb6e58da3517578b4635369a299fa88a3d2d1b8c28750879d2a89870fb - Sigstore transparency entry: 1429387658
- Sigstore integration time:
-
Permalink:
Raghav-Sahai/Evals@0be97e6f87840042bdd443fa53c783ad47587af6 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Raghav-Sahai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@0be97e6f87840042bdd443fa53c783ad47587af6 -
Trigger Event:
release
-
Statement type: