You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-25Lines changed: 16 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,41 +4,23 @@ A Python client for tracking and analyzing events and LLM interactions with Trub
4
4
5
5
## Overview
6
6
7
-
Trubrics is a Python client that provides event tracking capabilities with a focus on LLM (Large Language Model) interactions. It features an efficient queuing system with automatic background flushing of events to the Trubrics API.
7
+
Trubrics is a Python client that provides event tracking capabilities with a focus on LLM (Large Language Model) interactions. It is fast and non-blocking, meaning there will be no performance hits to your LLM app. It features an efficient queuing system with automatic background flushing of events to the Trubrics API.
8
8
9
9
## Installation
10
10
11
-
Install using pip:
12
11
```bash
13
12
pip install trubrics
14
13
```
15
14
16
-
Or using uv:
17
-
18
-
```bash
19
-
pip install uv
20
-
uv pip install trubrics
21
-
```
22
-
23
-
## Key Features
24
-
25
-
- Event tracking with custom properties
26
-
- Automatic background event flushing
27
-
- Thread-safe implementation
28
-
- Configurable flush intervals and batch sizes
29
-
30
15
## Usage
31
16
32
-
### Basic Setup
17
+
### Setup
33
18
19
+
Get your project API key from settings in [Trubrics](https://app.trubrics.com/). This is a POST only API key.
34
20
```python
35
21
from trubrics import Trubrics
36
22
37
-
client = Trubrics(
38
-
api_key="your-api-key",
39
-
flush_interval=10, # seconds
40
-
flush_at=20, # events
41
-
)
23
+
client = Trubrics(api_key="your-api-key")
42
24
```
43
25
44
26
### Tracking Events
@@ -65,7 +47,7 @@ client.track_llm(
65
47
### Closing the Client
66
48
67
49
```python
68
-
#Ensure all events are flushed before shutting down
50
+
#optional closing method to ensure all events are flushed from the queue before exiting your app
69
51
client.close()
70
52
```
71
53
@@ -84,9 +66,18 @@ Or specify your own logger completely:
0 commit comments