Refario Python telemetry SDK for LLM run and span ingestion
Project description
Python SDK
Refario Python ingestion SDK package: refario-sdk.
This package publishes Refario telemetry helpers for LLM run and span ingestion from Python services.
Install
pip install refario-sdk
Usage
from refario_sdk import refario
client = refario.init(
endpoint="http://localhost:3000",
api_key="YOUR_API_KEY",
)
run = client.start_run(workflow="example-workflow", environment="prod")
run.llm_call(
name="openai-call",
provider="openai",
model="gpt-4o",
status="success",
prompt_tokens=120,
completion_tokens=80,
latency_ms=900,
)
run.end(success=True)
TS-Style Compatibility Helpers
refario.init({ "endpoint": "...", "apiKey": "..." })client.startRun({ "workflow": "...", "environment": "..." })run.llmCall({ ... }),run.toolCall({ ... }),run.chainCall({ ... })
Local tests
From python-sdk/:
PYTHONPATH=src python3 -m unittest discover -s tests -p "test_*.py"
Local package checks
From repo root:
python3 -m pip install --upgrade build twine
PYTHONPATH=python-sdk/src python3 -m unittest discover -s python-sdk/tests -p "test_*.py"
python3 -m build python-sdk
python3 -m twine check python-sdk/dist/*
Release process
- Bump version in
python-sdk/pyproject.toml. - Commit and push to
main. - Create and push a release tag matching the package version (for example
python-sdk-v0.1.0):
git tag python-sdk-v<version>
git push origin python-sdk-v<version>
The Release Python SDK GitHub Action publishes to PyPI when the tag is pushed.
You can also run the workflow manually via workflow_dispatch and optionally select a
version bump (patch, minor, major, or custom) before publishing.
Required GitHub secret
PYPI_API_TOKENwith publish access to therefario-sdkpackage on PyPI.
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 refario_sdk-0.1.1.tar.gz.
File metadata
- Download URL: refario_sdk-0.1.1.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
598c0a5b12664a7be6642bda0b593364db38fb2b1a701eb387f156305a46568d
|
|
| MD5 |
5b6d6bb62f0238393d38ece5d4be1ae3
|
|
| BLAKE2b-256 |
19de3f3a4c87e8bb4ea8401d7e966ba84b7f96df0b8e23d447d9d1ebaa9e102a
|
File details
Details for the file refario_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: refario_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa3d7e2eff9e7623238d5695441d9df5a7d99e2607b5fade855c5d762815cc03
|
|
| MD5 |
6309b2bd597cbe3d8446ba858bfe0aaf
|
|
| BLAKE2b-256 |
afbdc00cb3529273b05e96bba138c2066621543189355c83877081db6797dec9
|