Skip to main content

ReliaMesh Python SDK

Content-minimizing reliability events for AI agents. Python 3.12+, no runtime dependencies. Owned by Prefiler Labs Private Limited; Apache-2.0.

For a published release, install from PyPI:

python -m pip install reliamesh-sdk==0.1.0

Or install from this source checkout:

python -m pip install ./sdk/python
import os
from reliamesh_sdk import Client, event

client = Client(
    endpoint=os.environ["RELIAMESH_ENDPOINT"],
    api_key=os.environ["RELIAMESH_API_KEY"],
)
client.emit(event(
    deployment_id="production-eu1", agent_id="invoice-agent",
    operation="validation", outcome="failure",
    failure_type="malformed_output", model="model-alias", prompt_version="v3",
    latency_ms=140, input_tokens=80, output_tokens=30,
))
client.flush()

Use opaque stable identifiers; never put customer content, secrets, email addresses, or raw prompts in identifier fields. The schema restricts shape, not meaning. Hashing predictable personal data does not make it safe.

Observe execution

with client.observe(deployment_id="production-eu1", agent_id="invoice-agent",
                    operation="tool", tool="document-validator", tool_version="2"):
    run_tool()  # Your application function; return values are never inspected.
client.flush()

The context manager records elapsed time, success or failure, and a generic exception classification. It never reads the exception message or stack. Original application exceptions propagate. A timeout is classified as timeout; other exceptions use the operation's generic failure type. Application validation must emit explicit events for malformed output, loops, fallback, retry escalation, or incomplete tasks. A successful HTTP call cannot establish task success.

Delivery contract

  • No default endpoint, network discovery, background thread, automatic exporter, exit hook, or outbound telemetry. emit and observe enqueue locally; flush, summary, and incidents initiate requests to your chosen endpoint.
  • Endpoints require HTTPS, except loopback HTTP for local use. Redirects are rejected. TLS uses Python's normal certificate validation.
  • Default queue capacity: 1,000 events, at most 100 events and 128 KiB per request. Queue capacity is configurable from 1 to 10,000. The queue lives only in memory.
  • Default socket timeout: 2 seconds, configurable up to 30 seconds. This bounds individual socket operations, not the entire flush. Flush processes only the number of events queued at entry, so concurrent producers cannot extend it indefinitely.
  • Only HTTP 429 and 503 retry, up to two retries by default (maximum three). Exponential delays are bounded to one second. Retry bodies and event IDs are identical so the server can deduplicate them. Transport errors and other statuses are not retried. The client verifies ingestion acknowledgement counts.
  • Default failure_mode="drop" drops invalid, overflowing, or unsuccessfully sent events. failure_mode="raise" raises SDKError/DeliveryError. An attempted failed batch is dropped in either mode. Raise mode leaves later batches queued.
  • Read client.counters: enqueued, sent, dropped, failed_batches, retries, and queued. sent counts acknowledged input events, including deduplicated events. Errors omit response bodies and credentials.
  • summary() and incidents() return decoded authenticated API responses; read failures always raise DeliveryError.

This is best-effort instrumentation, not durable message delivery. Export on a dedicated application worker or with await asyncio.to_thread(client.flush) in async applications. Do not call synchronous flush() on a latency-sensitive event loop. In-process queuing and counters are thread-safe; forked processes need their own client. Drain on a controlled shutdown if losing queued observations matters.

OpenTelemetry adapter

from_otel_attributes(attributes, deployment_id=..., agent_id=..., outcome=...) constructs an event without exporting it or installing span processors. It maps selected standard names from the OpenTelemetry GenAI attribute registry:

Input Event field
gen_ai.provider.name provider
gen_ai.request.model model
gen_ai.usage.input_tokens / output_tokens input_tokens / output_tokens
telemetry.sdk.name / version sdk / sdk_version
gen_ai.operation.name operation, via the fixed map below

chat, text_completion, generate_content, and embeddings map to model; invoke_agent maps to agent; execute_tool maps to tool. Unknown operations require an explicit application mapping and raise ValueError.

ReliaMesh-specific extensions reliamesh.model.version, reliamesh.prompt.version, reliamesh.agent.version, reliamesh.framework.name, reliamesh.framework.version, reliamesh.tool.name, and reliamesh.tool.version map to the corresponding flat event fields. These extensions are not official OpenTelemetry conventions. The caller explicitly supplies outcome, failure type, duration, and synthetic status. All unlisted attributes, messages, exception details, and span events are ignored. Invalid allowlisted values are rejected. Never pass prompt text as a version identifier.

Metadata

Release files for reliamesh-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 reliamesh-sdk 0.1.0
File Size Uploaded
reliamesh_sdk-0.1.0.tar.gz 14.8 kB Details

Built distribution (wheel)

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

Total release size: 29.2 kB

Release files / reliamesh_sdk-0.1.0.tar.gz

Download URL reliamesh_sdk-0.1.0.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
c5f80f170a01b4f84aa2f7ea46b9adf5d81c819c941f6eefd7a01f5076a1e96f
BLAKE2b-256 checksum
How to use checksums
c5b4fd8202701a8ec18255a3aa51f836f8ad015e1e0ce59896ce22cc42157c46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

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

Download URL reliamesh_sdk-0.1.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c53c88d12113e4e36d21e83e9898fee4c6aff9e8e9667720d6d9d90e43b0544e
BLAKE2b-256 checksum
How to use checksums
3d33422c1869ad4ad9af3bb97b9fc13307ce259fd7dadc5c3ac45692b7ce91ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.0

2 release files

This release

0.1.0 This release

2 release 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