Skip to content

Commit 71ae0ba

Browse files
authored
Merge pull request #46 from tinybirdco/update-readme-01
update readme
2 parents 124cdf1 + bfe73dc commit 71ae0ba

File tree

2 files changed

+54
-82
lines changed

2 files changed

+54
-82
lines changed

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,40 @@ Stack:
3434

3535
## Quick Start
3636

37+
Deploy the template, instrument and use the hosted version to track.
38+
39+
1. Deploy:
40+
41+
```bash
42+
# install the tinybird CLI
43+
curl https://tinybird.co | sh
44+
45+
# select or create a new workspace
46+
tb login
47+
48+
# deploy the template
49+
tb --cloud deploy --template https://github.com/tinybirdco/llm-performance-tracker/tree/main/tinybird
50+
```
51+
52+
2. Instrumentation:
53+
54+
Send your data to Tinybird using the [Events API](https://www.tinybird.co/docs/get-data-in/ingest-apis/events-api). Some examples:
55+
56+
- [LiteLLM (Python)](https://www.tinybird.co/docs/get-data-in/guides/ingest-litellm)
57+
- [Vercel AI SDK (TypeScript)](https://www.tinybird.co/docs/get-data-in/guides/ingest-vercel-ai-sdk)
58+
59+
3. Use the hosted tracker:
60+
61+
```bash
62+
# copy the token to the clipboard
63+
tb token copy read_pipes && TINYBIRD_TOKEN=$(pbpaste)
64+
65+
# use the hosted dashboard with your data
66+
open https://llm-tracker.tinybird.live\?token\=$TINYBIRD_TOKEN
67+
```
68+
69+
## Build and deploy your own LLM tracker
70+
3771
Get started by forking the GitHub repository and then customizing it to your needs.
3872

3973
Start Tinybird locally:
@@ -75,13 +109,6 @@ Open the application in your browser:
75109
http://localhost:3000
76110
```
77111

78-
## Instrumentation
79-
80-
Send your data to Tinybird. Some examples:
81-
82-
- [LiteLLM (Python)](https://www.tinybird.co/docs/get-data-in/guides/ingest-litellm)
83-
- [Vercel AI SDK (TypeScript)](https://www.tinybird.co/docs/get-data-in/guides/ingest-vercel-ai-sdk)
84-
85112
## Deployment
86113

87114
- Fork and connect this repository to Vercel.

TEMPLATE.md

Lines changed: 20 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -28,93 +28,38 @@ Tech stack:
2828

2929
## Quick Start
3030

31-
Get started by forking the [GitHub repository](https://github.com/tinybirdco/llm-performance-tracker) and then customizing it to your needs.
31+
Deploy the template, instrument and use the hosted version to track.
3232

33-
Start Tinybird locally:
33+
1. Deploy:
3434

35-
```
35+
```bash
36+
# install the tinybird CLI
3637
curl https://tinybird.co | sh
37-
cd tinybird
38-
tb local start
39-
tb login
40-
tb dev
41-
token ls # copy the read_pipes token
42-
```
43-
44-
Configure the Next.js application:
45-
46-
```
47-
cd dashboard/ai-analytics
48-
cp .env.example .env
49-
Edit the .env file with your Tinybird API key and other configuration.
50-
```
51-
52-
```
53-
NEXT_PUBLIC_TINYBIRD_API_URL=http://localhost:7181
54-
# read_pipes token
55-
NEXT_PUBLIC_TINYBIRD_API_KEY=
56-
```
57-
58-
Start the Next.js application:
59-
60-
```
61-
cd dashboard/ai-analytics
62-
npm install
63-
npm run dev
64-
```
6538

66-
Open the application in your browser:
39+
# select or create a new workspace
40+
tb login
6741

42+
# deploy the template
43+
tb --cloud deploy --template https://github.com/tinybirdco/llm-performance-tracker/tree/main/tinybird
6844
```
69-
http://localhost:3000
70-
```
71-
72-
## Instrumentation
73-
74-
Instrument your LLM calls and send events to Tinybird. Some examples:
7545

76-
- [LiteLLM (python)](https://www.tinybird.co/docs/get-data-in/guides/ingest-litellm)
77-
- [Vercel AI SDK (typescript)](https://www.tinybird.co/docs/get-data-in/guides/ingest-vercel-ai-sdk)
46+
2. Instrumentation:
7847

79-
## Deployment
48+
Send your data to Tinybird using the [Events API](https://www.tinybird.co/docs/get-data-in/ingest-apis/events-api). Some examples:
8049

81-
- Fork and connect this repository to Vercel.
82-
- Set the environment variables in Vercel.
83-
- Configure your `TINYBIRD_HOST` and `TINYBIRD_TOKEN` in the [CI/CD GitHub actions](https://github.com/tinybirdco/llm-performance-tracker/tree/main/.github/workflows) to deploy to Tinybird.
50+
- [LiteLLM (Python)](https://www.tinybird.co/docs/get-data-in/guides/ingest-litellm)
51+
- [Vercel AI SDK (TypeScript)](https://www.tinybird.co/docs/get-data-in/guides/ingest-vercel-ai-sdk)
8452

85-
## Multi-tenancy
53+
3. Use the hosted tracker:
8654

87-
Create a Clerk project and set up these environment variables in your Next.js application:
55+
```bash
56+
# copy the token to the clipboard
57+
tb token copy read_pipes && TINYBIRD_TOKEN=$(pbpaste)
8858

59+
# use the hosted dashboard with your data
60+
open https://llm-tracker.tinybird.live\?token\=$TINYBIRD_TOKEN
8961
```
90-
# workspace ID for multi-tenant JWT tokens
91-
TINYBIRD_WORKSPACE_ID=
92-
# workspace admin token for multi-tenant JWT tokens
93-
TINYBIRD_JWT_SECRET=
94-
95-
# Clerk publishable key
96-
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=
97-
# Clerk secret key
98-
CLERK_SECRET_KEY=
99-
# Clerk sign in URL
100-
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
101-
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
102-
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/
103-
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/
104-
```
105-
106-
The [middleware](https://github.com/tinybirdco/llm-performance-tracker/blob/main/dashboard/ai-analytics/src/middleware.ts) will get the `org:name` permission from the Clerk user and use it to create a Tinybird JWT token with the `organization` dimension fixed to that value. Read more about Tinybird JWT tokens [here](https://www.tinybird.co/docs/forward/get-started/authentication#json-web-tokens-jwts).
107-
108-
[Watch a video of the Clerk + Tinybird JWT token flow](./assets/clerk-tinybird-jwt.mp4)
10962

110-
## Mock Data
111-
112-
For local testing, generate mock data with the following commands:
113-
114-
```sh
115-
cd tinybird/mock
116-
npm install
117-
npm run generate -- --start-date 2025-02-01 --end-date 2025-03-31 --events-per-day 100 --output ../fixtures/llm_events.ndjson
118-
```
63+
## Build and deploy your own LLM tracker
11964

120-
The [generate-llm-events.js](https://github.com/tinybirdco/llm-performance-tracker/blob/main/tinybird/mock/generate-llm-events.js) script generates the embeddings.
65+
See [README.md](https://github.com/tinybirdco/llm-performance-tracker)

0 commit comments

Comments
 (0)