Skip to main content

redberry-sdk

Records an AI agent's model and tool calls with OpenTelemetry and sends them to the customer's own Redberry install. Redberry uses these records to keep a tamper-evident evidence chain for each agent and to price its risk.

The SDK sends only to the Redberry install in your own cloud account (or to an endpoint you set). It does not send anything to Redberry directly.

Install

pip install redberry-sdk                    # core
pip install "redberry-sdk[providers]"       # plus instrumentation for model providers (OpenAI, Anthropic, ...)
pip install "redberry-sdk[all]"             # providers, agent frameworks and vector databases

Python 3.11 or later.

Extra Installs instrumentation for
providers OpenAI, Anthropic, Amazon Bedrock, Cohere, Mistral, Ollama, Vertex AI, Google GenAI, Groq, Together, Replicate
frameworks LangChain, LlamaIndex, CrewAI, Haystack, OpenAI Agents SDK
vectordb Chroma, Pinecone, Qdrant, Weaviate
openai-agents the OpenAI Agents SDK itself, for its valp.* integration
hasher the optional per-run signing path

Quick start

import redberry_sdk

redberry_sdk.init(agent="refund-agent")   # your agent's name, as you will approve it in the Redberry portal

Call init() once, before the agent makes its first model call. Model calls made through supported libraries are then recorded automatically.

Serverless functions (AWS Lambda, Azure Functions, Cloud Run functions) can be frozen as soon as a request returns. Flush before returning:

@redberry_sdk.flush_after
def handler(event, context):
    ...

or call redberry_sdk.flush() yourself.

Temperature. Redberry prices an agent from its sampled behaviour, so the agent's model calls must run at temperature 1.0.

Where records go

On these platforms the SDK finds your install automatically and authenticates with the platform's own identity; no keys are needed:

Platform How the install is found Authentication
Google Cloud (Cloud Run services, jobs, functions) the install in the same project the service account's ID token
AWS (Lambda, ECS) s3://redberry-<account>-<region>/ingest.json AWS Signature Version 4 with the role's credentials
Azure (Functions, Container Apps) the Redberry API, by the managed identity the managed identity's Entra ID token

Elsewhere, set the ingest address explicitly.

Environment variable Meaning
REDBERRY_INGEST_URL the install's ingest address (overrides discovery)
REDBERRY_CLOUD gcp, aws or azure, when it cannot be detected
REDBERRY_API_URL the Redberry API (Azure discovery)
REDBERRY_AZURE_APP_ID_URI Redberry's application ID URI in Entra ID, if not the default
REDBERRY_GCP_REGION the install's region on Google Cloud, when it cannot be detected
REDBERRY_OTEL_ENDPOINT an OTLP/HTTP endpoint to send to instead (for testing)
REDBERRY_AUTH_RETRY_S how long a refused batch is retried while access is being granted (default 300)
REDBERRY_AGENT_ID the agent's name, if not passed to init()
REDBERRY_ALLOW_MISSING_INSTRUMENTATION 1 to start even when a library's instrumentation is not installed
REDBERRY_ALLOW_CONTENT_CAPTURE_OFF 1 to record metadata only, deliberately
REDBERRY_MAX_REQUEST_SNAPSHOT_BYTES the largest request recorded verbatim

Settings can also be placed in a .env file next to the agent. Settings from earlier versions of the SDK, under a different prefix, are still accepted.

Records the SDK could not deliver are counted by redberry_sdk.dropped_spans().

License

Apache License 2.0. See LICENSE and NOTICE.

Metadata

Release files for redberry-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for redberry-sdk 0.1.0
File Size Uploaded Provenance Actions
redberry_sdk-0.1.0.tar.gz 103.1 kB With provenance Details for redberry_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for redberry-sdk 0.1.0
File Interpreter ABI Platform Actions
redberry_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for redberry_sdk-0.1.0-py3-none-any.whl

Total release size: 223.9 kB

Release files / redberry_sdk-0.1.0.tar.gz

Download URL redberry_sdk-0.1.0.tar.gz
Size 103.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2eedce119d4f968b9208ea6c8a9d751554652dfb0b6e5774ca020cc9a0a7c49d
BLAKE2b-256 checksum
How to use checksums
2c278f0f43348fd652d50921e863ca5b854bea8b3038c7816ac23b4aa837ee8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

Release files / redberry_sdk-0.1.0-py3-none-any.whl

Download URL redberry_sdk-0.1.0-py3-none-any.whl
Size 120.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3a348877be96e73e54e3539536edc4021957bc5eec561385aed97fc8bea3f70c
BLAKE2b-256 checksum
How to use checksums
9991900895b9d7a7ff03aa545b67f5332783497d240ab294c213ef6a8306d6a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

Security for redberry-sdk 0.1.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.

Select from 2 files

Attestation for redberry_sdk-0.1.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 Nov 3, 2026.

Transparency log

A 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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