Respan instrumentation plugin for the Replicate Python SDK
Project description
Respan Replicate Instrumentation
Trace the official replicate Python SDK with Respan.
The instrumentation patches the Replicate client lifecycle and emits canonical
Respan spans for run, async_run, stream, async_stream, prediction
creation, prediction waiting, and prediction lookup/cancel operations.
Install
pip install respan-ai respan-instrumentation-replicate replicate
Usage
import os
import replicate
from respan import Respan, workflow
from respan_instrumentation_replicate import ReplicateInstrumentor
respan = Respan(
api_key=os.environ["RESPAN_API_KEY"],
instrumentations=[ReplicateInstrumentor()],
)
@workflow(name="replicate_quickstart.workflow")
def run_prediction() -> str:
output = replicate.run(
"meta/meta-llama-3-8b-instruct",
input={"prompt": "Reply with one concise sentence about tracing."},
)
return "".join(str(chunk) for chunk in output) if not isinstance(output, str) else output
print(run_prediction())
respan.flush()
respan.shutdown()
Use Respan(..., customer_identifier=..., thread_identifier=..., metadata=...)
or respan.propagate_attributes(...) to attach Respan attributes to Replicate
spans.
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 respan_instrumentation_replicate-0.1.0.tar.gz.
File metadata
- Download URL: respan_instrumentation_replicate-0.1.0.tar.gz
- Upload date:
- Size: 8.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4deb44c23cffd2adbc7820c5cd4fc5aef120fb2912b1d838324c8a26d61e4a5
|
|
| MD5 |
6607b3e0bb84341075f6ecf40e5fbfe1
|
|
| BLAKE2b-256 |
81842afbd35b9d8754214c714fe218f2ebeeb9137f3648b2e97069bff4921794
|
File details
Details for the file respan_instrumentation_replicate-0.1.0-py3-none-any.whl.
File metadata
- Download URL: respan_instrumentation_replicate-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
143168e4e048892ce8101d82c6cef0c8a12755f93e5ab2498c82fee81089178e
|
|
| MD5 |
ba57e5939fa06feb1d57a96653d9d330
|
|
| BLAKE2b-256 |
2b4aa1b6fcf40a82a9a059b15e9dd141c5b4fa1c0fd3a35fbe5c26100bb8a6c5
|