Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

Use Clickhouse as backend database (#66)

Patcher9939799881c0b6
diff --git a/.github/workflows/publish.yml b/.github/workflows/release.yml
similarity index 98%
rename from .github/workflows/publish.yml
rename to .github/workflows/release.yml
index 77b6a6a7..8de8a2cf 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/release.yml
@@ -12,6 +12,7 @@ permissions:
jobs:
ingester-docker:
+ name: Ingester Docker Image
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set-version-output.outputs.version }}
@@ -92,7 +93,7 @@ jobs:
run: echo "::set-output name=version::${{ env.DOCKER_METADATA_OUTPUT_VERSION }}"
ingester-binaries:
- name: Publish binaries
+ name: Ingester Binaries
needs: ingester-docker
runs-on: ubuntu-latest
strategy:
diff --git a/README.md b/README.md
index 86d8d7cf..34c08706 100644
--- a/README.md
+++ b/README.md
@@ -1,47 +1,111 @@
-# Doku: Open Source Observability for LLMs
+<div align="center">
+<img src="https://github.com/dokulabs/.github/blob/main/profile/assets/favicon.png?raw=true" alt="Doku Logo" width="10%"><h1>Doku: Open Source Observability for LLMs</h1>
+
+**[Documentation](https://docs.dokulabs.com/) | [Quickstart](#-getting-started-with-doku) | [Python SDK](https://github.com/dokulabs/dokumetry-python) | [Node SDK](https://github.com/dokulabs/dokumetry-node) | [Helm Chart](https://github.com/dokulabs/helm)**
+
[![Doku](https://img.shields.io/badge/Doku-orange)](https://github.com/dokulabs/doku)
-[![Documentation](https://img.shields.io/badge/Documentation-orange?logo=Google-Docs&logoColor=white)](https://docs.dokulabs.com/)
-[![Static Badge](https://img.shields.io/badge/Slack-4A154B?logo=slack&logoColor=white)](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA)
-[![License](https://img.shields.io/github/license/dokulabs/doku?label=license&logo=github&color=f80&logoColor=fff%22%20alt=%22License)](https://github.com/dokulabs/doku/blob/main/LICENSE)
+[![License](https://img.shields.io/github/license/dokulabs/doku?label=License&logo=github&color=f80&logoColor=white)](https://github.com/dokulabs/doku/blob/main/LICENSE)
[![Downloads](https://static.pepy.tech/badge/dokumetry/month)](https://pepy.tech/project/dokumetry)
[![GitHub Last Commit](https://img.shields.io/github/last-commit/dokulabs/doku)](https://github.com/dokulabs/doku/pulse)
[![GitHub Contributors](https://img.shields.io/github/contributors/dokulabs/doku)](https://github.com/dokulabs/doku/graphs/contributors)
-[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/doku)](https://artifacthub.io/packages/search?repo=doku)
+[![Slack](https://img.shields.io/badge/Slack-4A154B?logo=slack&logoColor=white)](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA)
+[![X](https://img.shields.io/badge/follow-%40dokulabs-1DA1F2?logo=x&style=social)](https://twitter.com/doku_labs)
+
[![Helm Version](https://img.shields.io/github/tag/dokulabs/helm.svg?&label=Chart%20Version&logo=helm)](https://github.com/dokulabs/helm/tags)
[![Python Library Version](https://img.shields.io/github/tag/dokulabs/dokumetry-python.svg?&label=dokumetry%20version&logo=pypi)](https://pypi.org/project/dokumetry/)
[![NPM Package Version](https://img.shields.io/github/tag/dokulabs/dokumetry-node.svg?&label=dokumetry%20version&logo=npm)](https://www.npmjs.com/package/dokumetry)
+</div>
+
+
+
+Doku is an **open-source LLMOps tool** engineered to enables developers with comprehensive capabilities to monitor, analyze, and optimize LLM applications. It provides valuable real-time data on **LLM usage, performance, and costs**. Through seamless integrations with leading LLM platforms, including OpenAI, Cohere, and Anthropic, Doku acts as a central command center for all your LLM needs. It effectively guides your efforts, ensuring that your LLM applications not only operate at peak efficiency but also scale successfully.
+## Why use Doku?
+Get advanced monitoring and evaluation for your LLM applications with these key benefits:
-Doku is an open-source observability tool engineered for Large Language Models (LLMs). Designed for ease of integration into existing LLM applications, Doku offers unparalleled insights into usage, performance, and overhead—allowing you to analyze, optimize, and scale your AI applications and LLM usage effectively.
+- **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.
+- **Real-Time Data Streaming**: Unlike other platforms where you might wait minutes to see your data due to data being sent in batches, Doku is able to display data as it streams. This immediate insight enables quick decision-making and adjustments.
+- **Zero Added Latency**: Doku's smart data handling ensures rapid data processing without impacting your application's performance, maintaining the responsiveness of your LLM applications.
+- **Connect to Observability Platforms**: Doku seamlessly connects with leading observability platforms like Grafana Cloud and Datadog, among others to automatically export data.
-Whether you're working with OpenAI, Cohere, or Anthropic, It tracks all your LLM requests transparently and conveys the insights needed to make data-driven decisions. From monitoring usage and understanding latencies to managing costs and collaborating effortlessly, Doku grants you the lens to view your models in high definition.
+## How it works?
+![How it Works?](https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif)
-#### How it works
-![Doku Banner](https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif)
+### Step 1: Instrument your Application
+Integrating the `dokumetry` SDK into LLM applications is straightforward with SDKs designed for Python and NodeJS. Start monitoring for your LLM Application with just **two lines of code**:
-Leveraging Doku, you can get:
+For Python
+```python python
+import dokumetry
+
+dokumetry.init(llm=openai, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+```
+For NodeJS
+
+```javascript
+import DokuMetry from 'dokumetry';
-- 🕵️ **In-depth LLM Monitoring**: Track every request to LLM platforms like OpenAI with precision, ensuring comprehensive visibility over your model's interactions.
-- 🎛️ **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.
-- 📈 **Connect to Observability Platforms**: Export LLM Observablity data and insights from Doku to popular observability platforms such as Grafana OSS, Grafana Cloud, Datadog and New Relic.
-- 👥 **Team-centric Workflow**: Enhance team collaboration with seamless data sharing capabilities, creating an integrated environment for observability-driven teamwork.
+DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+```
-## Supported LLMs:
+### Step 2: Data processed by Doku Ingester
+Once the `dokumetry` SDKs are configured in your LLM application, Monitoring data starts streaming to the [Doku Ingester](https://github.com/dokulabs/doku/tree/main/src/ingester#readme). It processes and safely stores your data in ClickHouse, keeping your LLM Monitoring data **secure** and **compliant** in your environment.
-- ✅ [OpenAI](https://openai.com/)
-- ✅ [Cohere](https://cohere.com/)
-- ✅ [Anthropic](https://www.anthropic.com/)
+You can choose to use a new ClickHouse database setup or connect to your existing one to work with Doku.
-And this is only the beginning—as we grow, so will our list of supported LLM platforms. We're dedicated to continually refining our features to enhance your LLM and Generative AI observability experience.
+### Step 3: Visualize in your Observability Platform
+With your LLM monitoring data processed, connect Doku to your preferred Observability Platform to begin visualizing and analyzing your data in-depth.
+Stay tuned for the upcoming release of Doku UI, enhancing your data visualization capabilities further.
## 🚀 Getting Started with Doku
Jumpstart your journey with Doku by deploying it via our Helm chart, designed to simplify the installation process on any Kubernetes cluster.
-### Deploying with Helm 📦
+### Docker
+1. Create `docker-compose.yml`
+```yaml
+version: '3.8'
+
+services:
+ clickhouse:
+ image: clickhouse/clickhouse-server:24.1.5
+ container_name: clickhouse
+ environment:
+ CLICKHOUSE_PASSWORD: ${DOKU_DB_PASSWORD:-DOKU}
+ CLICKHOUSE_USER: ${DOKU_DB_USER:-default}
+ volumes:
+ - clickhouse-data:/var/lib/clickhouse
+ ports:
+ - "${DOKU_DB_PORT:-9000}:9000"
+ restart: always
+
+ doku-ingester:
+ image: ghcr.io/patcher99/doku-ingester:0.0.8
+ container_name: doku-ingester
+ environment:
+ DOKU_DB_HOST: clickhouse
+ DOKU_DB_PORT: ${DOKU_DB_PORT:-9000}
+ DOKU_DB_NAME: ${DOKU_DB_NAME:-default}
+ DOKU_DB_USER: ${DOKU_DB_USER:-default}
+ DOKU_DB_PASSWORD: ${DOKU_DB_PASSWORD:-DOKU}
+ ports:
+ - "9044:9044"
+ depends_on:
+ - clickhouse
+ restart: always
+
+volumes:
+ clickhouse-data:
+```
+
+2. Start Docker Compose
+```shell
+docker-compose up -d
+```
+### Kubernetes
To install the Doku Helm chart, follow these steps:
@@ -63,31 +127,32 @@ helm repo update
helm install doku dokulabs/doku
```
-**NOTE**:
-> As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `connections` configuration within the [values.yaml](https://github.com/dokulabs/doku/tree/main/helm/doku/values.yaml) file in the Helm Chart. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
-
For a detailed list of configurable parameters for the Helm chart, refer to the `values.yaml` file in the [Helm chart](https://github.com/dokulabs/doku/tree/main/helm/doku).
### 🔑 Generating an API Key
-Once Doku is up and running, proceed to generate your first API key:
+With Doku running, the next step is to generate an API key for secure communication between your applications and Doku.
-1. Hit the `/api/keys` endpoint of the Doku service:
+To generate your first API key, you can use the following command:
-```shell
-curl -X POST http://<Doku-URL>/api/keys \
--H 'Authorization: ""' \
--H 'Content-Type: application/json' \
--d '{"Name": "YourKeyName"}'
+```shell shell
+curl --request POST \
+ --url https://<YOUR_DOKU_INGESTER_URL>/api/keys \
+ --header 'Authorization: ""' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "name": "Patcher"
+ }'
```
**Note**:
-> - For your initial API call, `Authorization` header can be set to `""`.
-> - Store the provided API key securely; it will be required to pass the generated and a valid API Ke in `Authorization` header for subsequent API calls.
+> **Save the API Key** — This key is essential for configuring the `dokumetry` SDK.
+
+> For your first API call to generate the key, the Authorization header should be left blank. However, remember to include this API key in the Authorization header for all future API interactions and SDK configurations.
-### ⚡️ Automatically send LLM Observability Data to Doku
+### ⚡️ Instrument your Application
-With the `dokumetry` SDKs for [Python](https://github.com/dokulabs/dokumetry-python) and [NodeJS](https://github.com/dokulabs/dokumetry-node), sending observability data to Doku is just **TWO** lines of code in your application. Once integrated, the SDKs take care of capturing and conveying LLM usage data directly to your Doku instance, requiring minimal effort on your part.
+Choose the appropriate SDK for your LLM application's programming language and follow the steps to integrate monitoring with just **two lines of code**.
#### Python
@@ -102,7 +167,7 @@ Add the following two lines to your application code:
```python
import dokumetry
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")
```
##### Example Usage for monitoring `OpenAI` Usage:
@@ -116,7 +181,7 @@ client = OpenAI(
)
# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+dokumetry.init(llm=client, doku_url="YOUR_DOKU_INGESTER_URL", api_key="YOUR_DOKU_TOKEN")
chat_completion = client.chat.completions.create(
messages=[
@@ -144,7 +209,7 @@ Add the following two lines to your application code:
```javascript
import DokuMetry from 'dokumetry';
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})
```
##### Example Usage for monitoring `OpenAI` Usage:
@@ -158,7 +223,7 @@ const openai = new OpenAI({
});
// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_INGESTER_URL", apiKey: "YOUR_DOKU_TOKEN"})
async function main() {
const chatCompletion = await openai.chat.completions.create({
@@ -174,7 +239,7 @@ Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dok
## Security
-Doku uses key based authentication mechanism to ensure the security of your data. Be sure to keep your API keys confidential and manage permissions diligently. Refer to our [Security Policy](SECURITY)
+Doku uses key based authentication mechanism to ensure the security of your data and as Doku is self-hosted, The data stays within your environment.
## Contributing
diff --git a/docs/0.0.1/api-reference/introduction.mdx b/docs/0.0.1/api-reference/introduction.mdx
deleted file mode 100644
index c8afb2a5..00000000
--- a/docs/0.0.1/api-reference/introduction.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: 'Introduction'
-description: 'OpenAPI specification for API Endpoints in Doku'
----
-
-<Card
- title="API Keys Endpoints"
- icon="key"
- href="/0.0.1/api-reference/endpoint/api-keys/create"
->
- View the documentation for API Keys
-</Card>
-
-## Authentication
-
-All API endpoints are authenticated using Authetication Header.
-
-```json
-Authorization: <api-key>
-```
-
-<Info>
-For your initial API call, Authorization header can be set to "".
-Store the provided API key securely; it will be required to pass the generated and a valid API Key in Authorization header for subsequent API calls.
-</Info>
\ No newline at end of file
diff --git a/docs/0.0.1/api-reference/openiapi.yml b/docs/0.0.1/api-reference/openiapi.yml
deleted file mode 100644
index 281f249a..00000000
--- a/docs/0.0.1/api-reference/openiapi.yml
+++ /dev/null
@@ -1,100 +0,0 @@
-openapi: 3.0.0
-info:
- title: API Keys Service
- description: This service manages API keys through GET, POST, and DELETE operations.
- version: "1.0.0"
-
-servers:
- - url: https://127.0.0.1:9044/
-
-paths:
- /api/keys:
- get:
- summary: Get a list of API keys
- operationId: getApiKeys
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '200':
- description: A list of API keys
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
- post:
- summary: Create a new API key
- operationId: createApiKey
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '201':
- description: API key created
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
- delete:
- summary: Delete an API key
- operationId: deleteApiKey
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '200':
- description: API key deleted
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
-components:
- schemas:
- APIKeyRequest:
- type: object
- required:
- - name
- properties:
- name:
- type: string
-
- jsonResponse:
- type: object
- required:
- - status
- - message
- properties:
- status:
- type: integer
- message:
- type: string
-
- securitySchemes:
- ApiKeyAuth:
- type: apiKey
- in: header
- name: Authorization
\ No newline at end of file
diff --git a/docs/0.0.1/configuration.mdx b/docs/0.0.1/configuration.mdx
deleted file mode 100644
index f1d0dd2e..00000000
--- a/docs/0.0.1/configuration.mdx
+++ /dev/null
@@ -1,250 +0,0 @@
----
-title: 'Configuration'
-description: 'Configuring Options for Doku'
-icon: 'sliders'
----
-
-This document outlines the various options available for configuring Doku.
-For ease of use and clarity, we recommend naming the configuration file `doku.yml`
-
-
-## Properties
-
-<ResponseField name="ingester_port" type="String">
- The `ingesterPort` specifies the network port that the Ingestion Server will listen to for incoming data. You can set this to any available port on your system.
-
-**Example**:
-```yaml
-ingesterPort: 9044
-```
-</ResponseField>
-
-### Pricing Information Source
-<ResponseField name="pricingInfo" type="Object">
- Doku supports using either a local file or a URL to retrieve LLM Pricing data. Comment out the option you do not wish to use.
-</ResponseField>
-
-<Info>
-We strongly recommend using the `url` method with the value set as `https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json`.
-
-This ensures that you automatically retrieve the latest pricing information upon each startup, as the developers at Doku consistently refresh the pricing file with current data from OpenAI, Cohere and Anthropic.
-</Info>
-
-<ResponseField name="local_file" type="Object">
- Local File containing the Pricing Information JSON
- <Expandable title="properties">
- <ResponseField name="path" type="String">
- Specify the local file system path to a JSON file containing the LLM Pricing data.
- </ResponseField>
- </Expandable>
-
- **Example**:
- ```yaml
- pricingInfo:
- localFile:
- path: "/assets/pricing.json"
- ```
-</ResponseField>
-
-<ResponseField name="url" type="String">
- Provide the URL where the pricing data JSON file can be downloaded. Ensure the given URL is accessible.
-
- **Example**:
- ```yaml
- pricingInfo:
- url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json"
- ```
-</ResponseField>
-
-
-### Database Configuration
-
-<ResponseField name="dbConfig" type="Object">
- Configure the database connection details to connect Doku with TimescaleDB (or another Postgres compatible DB).
- <Expandable title="properties">
- <ResponseField name="name" type="String">
- Database name.
- </ResponseField>
- <ResponseField name="username" type="String">
- The username for the database.
- </ResponseField>
- <ResponseField name="password" type="String">
- The password for the database.
- </ResponseField>
- <ResponseField name="host" type="String">
- Host address for the database.
- </ResponseField>
- <ResponseField name="port" type="String">
- Network port for the database connection.
- </ResponseField>
- <ResponseField name="sslMode" type="String">
- The SSL mode for the database connection (e.g., "require" if SSL is needed).
- </ResponseField>
- <ResponseField name="maxOpenConns" type="String">
- Maximum number of concurrent open database connections.
- </ResponseField>
- <ResponseField name="maxIdleConns" type="String">
- Maximum number of idle database connections.
- </ResponseField>
- <ResponseField name="dataTable" type="String">
- Name of the table to store LLM Data.
- </ResponseField>
- <ResponseField name="apiKeyTable" type="String">
- Name of the table to store API Keys.
- </ResponseField>
- </Expandable>
-
- **Example**:
- ```yaml
- dbConfig:
- name: "mydatabase"
- username: "myusername"
- password: "mypassword"
- host: "mydbhost.example.com"
- port: 5432
- sslMode: "require"
- maxOpenConns: 15
- maxIdleConns: 10
- dataTable: "llm_data"
- apiKeyTable: "api_keys"
- ```
-</ResponseField>
-
-
-### Observability Platform Configuration
-
-<ResponseField name="observabilityPlatform" type="Object">
- Choose the external platform you wish to use for exporting observability data from Doku and set `enabled` to `true`. Fill in the required fields for the chosen platform. Only one platform can be selected at a time.
-
- The following sections show example configurations for different platforms - Grafana Cloud, New Relic, and DataDog. You will need to uncomment the applicable section and provide necessary credentials such as URLs, User IDs, and API Keys corresponding to your account on the observability platform.
- <Expandable title="properties">
- <ResponseField name="enabled" type="boolean">
- Boolean parameter to configure external Observability Platform
- </ResponseField>
- <ResponseField name="grafanaCloud" type="Object">
- Configuration for connecting Doku with Grafana Cloud.
- <Expandable title="properties">
- <ResponseField name="promUrl" type="String">
- URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance.
- </ResponseField>
- <ResponseField name="promUsername" type="String">
- Prometheus User ID of the Grafana Cloud Prometheus Instance.
- </ResponseField>
- <ResponseField name="lokiUrl" type="String">
- URL of the Loki Push URL of the Grafana Cloud Loki Instance.
- </ResponseField>
- <ResponseField name="lokiUsername" type="String">
- Loki Username of the Grafana Cloud Loki Instance.
- </ResponseField>
- <ResponseField name="accessToken" type="String">
- Access Token of the Grafana Cloud Instance.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- grafanaCloud:
- promUrl: "https://your-grafana-prometheus-url"
- promUsername: "your-prom-user-id"
- lokiUrl: "https://your-grafana-loki-url"
- lokiUsername: "your-loki-user-id"
- accessToken: "your-grafana-cloud-access-token"
- ```
- </Expandable>
- </ResponseField>
- <ResponseField name="datadog" type="Object">
- Configuration for connecting Doku with DataDog.
- <Expandable title="properties">
- <ResponseField name="metricsUrl" type="String">
- URL to the DataDog Metrics API.
- </ResponseField>
- <ResponseField name="logsUrl" type="String">
- URL to the DataDog Logs API.
- </ResponseField>
- <ResponseField name="apiKey" type="String">
- API Key of the DataDog Account.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- datadog:
- metricsUrl: "https://api.datadoghq.com/api/v1/series"
- logsUrl: "https://http.logs.datadoghq.com/api/v2/logs"
- apiKey: "datadog-api-key"
- ```
- </Expandable>
- </ResponseField>
- <ResponseField name="newRelic" type="Object">
- Configuration for connecting Doku with New Relic.
- <Expandable title="properties">
- <ResponseField name="metricsUrl" type="String">
- URL to the New Relic Metric API.
- </ResponseField>
- <ResponseField name="logsUrl" type="String">
- URL to the New Relic Log API.
- </ResponseField>
- <ResponseField name="apiKey" type="String">
- Ingest API Key of the New Relic Account.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- newRelic:
- metricsUrl: "https://metric-api.newrelic.com/metric/v1"
- logsUrl: "https://log-api.newrelic.com/log/v1"
- apiKey: "newrelic-api-key"
- ```
- </Expandable>
- </ResponseField>
- </Expandable>
-</ResponseField>
-
-Ensure that the file is correctly formatted in YAML and all necessary fields are populated based on your deployment needs. Save the file and restart the Doku service to apply the new configuration.
-
-## Example Configuration File
-
-```yaml doku.yml
-ingesterPort: 9044 # Port to run the Ingestion Server on, Example: 9044
-
-# Comment out either 'localFile' or 'url' to use only one at a time.
-pricingInfo:
- # localFile:
- # path: "/assets/pricing.json" # Path to local JSON file with LLM Pricing data
- url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json" # URL to download Pricing data file
-
-# Configuration for the Doku Backend Database (TimescaleDB)
-dbConfig:
- name: "DBNAME" # Name of the database, Example: "postgres"
- username: "USERNAME" # Username to connect to the database, Example: "admin"
- password: "PASSWORD" # Password to connect to the database, Example: "DOKU"
- host: "HOSTURL" # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
-# Configure Platform to export LLM Observability Data from Doku
-# Only one platform can be enabled at a time, To enable a platform, set enabled to true and fill in the required fields for that platform.
-observabilityPlatform:
- enabled: false # Enable or Disable the Observability Platform, Example: true
- # grafanaCloud:
- # promUrl: "influx-line-proxy-url" # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance
- # promUsername: "prometheus-userid" # Prometheus User ID of the Grafana Cloud Prometheus Instance
- # lokiUrl: "loki-push-url" # URL to the Loki Push URL of the Grafana Cloud Loki Instance
- # lokiUsername: "loki-username" # Loki Username of the Grafana Cloud Loki Instance
- # accessToken: "grafana-cloud-access-token" # Access Token of the Grafana Cloud Instance
-
- # newRelic:
- # metricsUrl: "https://metric-api.newrelic.com/metric/v1" # URL to the New Relic Metric API
- # logsUrl: "https://log-api.newrelic.com/log/v1" # URL to the New Relic Log API
- # key: "newrelic-api-key" # Ingest API Key of the New Relic Account
-
- # datadog:
- # metricsUrl: "https://api.datadoghq.com/api/v1/series" # URL to the DataDog Metrics API
- # logsUrl: "https://http.logs.datadoghq.com/api/v2/logs" # URL to the DataDog Logs API
- # apiKey: "datadog-api-key" # API Key of the DataDog Account
-```
\ No newline at end of file
diff --git a/docs/0.0.1/connections/datadog.mdx b/docs/0.0.1/connections/datadog.mdx
deleted file mode 100644
index 92dffa4f..00000000
--- a/docs/0.0.1/connections/datadog.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: 'DataDog'
-description: 'Connect Doku to DataDog'
----
-
-Doku can automatically send LLM usage data from Doku to DataDog using the [Submit Metrics API](https://docs.datadoghq.com/api/latest/metrics/#submit-metrics) and [Send Logs API](https://docs.datadoghq.com/api/latest/logs/#send-logs)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- datadog:
- metricsUrl: <your-datadog-metrics-url> # URL to the DataDog Metrics API
- logsUrl: <your-datadog-logs-url> # URL to the DataDog Logs API
- apiKey: <your-datadog-api-key> # API Key of the DataDog Account
-```
\ No newline at end of file
diff --git a/docs/0.0.1/connections/grafanacloud.mdx b/docs/0.0.1/connections/grafanacloud.mdx
deleted file mode 100644
index 044bba27..00000000
--- a/docs/0.0.1/connections/grafanacloud.mdx
+++ /dev/null
@@ -1,2351 +0,0 @@
----
-title: 'Grafana Cloud'
-description: 'Connect Doku to Grafana Cloud'
----
-
-<Frame>
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-1.jpg?raw=true" />
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-2.jpg?raw=true" />
-</Frame>
-
-Doku can automatically send LLM usage data from Doku to Grafana Cloud using the [Grafana Cloud Influx Telegraf](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-influxdb/push-from-telegraf/) and [Loki Push HTTP API](https://grafana.com/docs/loki/latest/reference/api/#push-log-entries-to-loki)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- grafanaCloud:
- promUrl: <your-grafana-cloud-influx-line-proxy-url> # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance
- promUsername: <your-prometheus-userid> # Prometheus User ID of the Grafana Cloud Prometheus Instance
- lokiUrl: <your-loki-push-url> # URL to the Loki Push URL of the Grafana Cloud Loki Instance
- lokiUsername: <your-loki-username> # Loki Username of the Grafana Cloud Loki Instance
- accessToken: <your-grafana-cloud-access-token> # Access Token of the Grafana Cloud Instance
-```
-
-## Grafana Resources
-
-<Accordion title="Dashboard">
- ```json
- {
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "grafana",
- "uid": "-- Grafana --"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "id": 14,
- "links": [
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Documentation",
- "tooltip": "",
- "type": "link",
- "url": "https://docs.dokulabs.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Community",
- "tooltip": "",
- "type": "link",
- "url": "https://dokulabs.slack.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Dokulabs GitHub",
- "tooltip": "",
- "type": "link",
- "url": "https://github.com/dokulabs/"
- }
- ],
- "liveNow": false,
- "panels": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 0,
- "y": 0
- },
- "id": 23,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 2,
- "x": 11,
- "y": 0
- },
- "id": 2,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "![Doku Logo](https://github.com/dokulabs/.github/blob/main/profile/assets/favicon.png?raw=true)",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 13,
- "y": 0
- },
- "id": 22,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the total number of requests sent to Large Language Models (LLM) Platforms in the selected time interval.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 4
- },
- "id": 3,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT count(*) FROM DOKU\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "COUNT",
- "parameters": [
- {
- "name": "environment",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Requests",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average time taken to process each request by the Large Language Models (LLM), offering a snapshot of system performance and efficiency.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "s",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 6,
- "y": 4
- },
- "id": 4,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(requestduration) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "requestduration",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Request Duration",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Total tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 1000
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 10,
- "y": 4
- },
- "id": 5,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_totalTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(totaltokens) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Tokens per Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average cost incurred per request to the LLM, helping monitor and optimize budget allocation for LLM usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 14,
- "y": 4
- },
- "id": 6,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(usagecost) FROM doku \nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Cost / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the total cost on LLM requests over the selected period.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 18,
- "y": 4
- },
- "id": 10,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT SUM(usagecost) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "SUM",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Cost",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the count of API requests made to LLMs over the selected time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 54,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "smooth",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 5,
- "w": 24,
- "x": 0,
- "y": 7
- },
- "id": 17,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count(count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval]))",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "Requests",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n DATE_TRUNC('day', \"time\") AS \"time\",\n COUNT(endpoint) AS total_requests\nFROM \n doku\nWHERE\n $__timeFilter(\"time\")\nGROUP BY \n DATE_TRUNC('day', \"time\")\nORDER BY \n \"time\";",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Requests overtime",
- "transformations": [],
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel illustrates the distribution of LLM requests across different usage categories: Chat Generations, Embeddings, Image Generations, Audio Generations, and Fine Tuning. It visualizes the relative volume of requests, helping to identify which types of operations are most frequently performed and providing insights into usage patterns by category.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "blue",
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "none",
- "unitScale": true
- },
- "overrides": [
- {
- "__systemRef": "hideSeriesFrom",
- "matcher": {
- "id": "byNames",
- "options": {
- "mode": "exclude",
- "names": [
- "Value (sum)",
- "Chat"
- ],
- "prefix": "All except:",
- "readOnly": true
- }
- },
- "properties": [
- {
- "id": "custom.hideFrom",
- "value": {
- "legend": false,
- "tooltip": false,
- "viz": true
- }
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 0,
- "y": 12
- },
- "id": 12,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n category,\n CAST(COUNT(*) AS INTEGER) AS Requests,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage\n FROM \n (\n SELECT \n CASE\n WHEN endpoint LIKE 'openai.chat%' THEN 'Chat'\n WHEN endpoint LIKE 'openai.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'anthropic.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.summarize%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.generate%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.chat%' THEN 'Chat'\n WHEN endpoint LIKE '%embed%' THEN 'Embeddings'\n WHEN endpoint LIKE 'openai.images%' THEN 'Image'\n WHEN endpoint LIKE 'openai.audio%' THEN 'Audio'\n WHEN endpoint LIKE 'openai.fine_tuning%' THEN 'Fine Tuning'\n END AS category,\n endpoint\n FROM doku\n WHERE $__timeFilter(time)\n ) AS subquery\n GROUP BY category",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage by Category",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "generation": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Displays the cost breakdown by provider (OpenAI, Cohere, Anthropic) for LLM requests, offering insights into financial deployment across different services.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 6,
- "y": 12
- },
- "id": 16,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Provider",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "generation": {
- "aggregations": []
- },
- "platform": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel presents a pie chart detailing the distribution of expenses for LLM requests by various applications. It shows how budget allocations are consumed by different applications, enabling a deeper understanding of cost drivers and facilitating cost optimization efforts.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 12,
- "y": 12
- },
- "id": 24,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Application",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "applicationName": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Visualizes the allocation of LLM request expenses across different environments, such as development, staging, and production. This breakdown helps in tracking and managing costs with respect to operational environments.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 18,
- "y": 12
- },
- "id": 25,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Environment",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "applicationName": {
- "aggregations": []
- },
- "environment": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Prompt tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 21
- },
- "id": 9,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_promptTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(prompttokens) FROM doku WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Prompt Tokens / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Provides a time-series analysis of token consumption for LLM requests, highlighting trends in usage intensity and complexity over time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlYlRd"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 50,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": 86400000,
- "lineInterpolation": "smooth",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 1,
- "pointSize": 6,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 18,
- "x": 6,
- "y": 21
- },
- "id": 11,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "avg(doku_llm_completionTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"})",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "Completion Tokens",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM doku",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "builder",
- "expr": "avg(doku_llm_promptTokens)",
- "format": "time_series",
- "fullMetaSearch": false,
- "hide": false,
- "includeNullMetadata": true,
- "legendFormat": "Prompt Tokens",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM doku",
- "refId": "B",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Token usage overtime",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Completion tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 24
- },
- "id": 7,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_completionTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(completiontokens) FROM doku WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Completion Tokens / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Displays the frequency of model usage over time, identifying the most utilised models and showcasing usage trends across different periods",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "purple",
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 27
- },
- "id": 13,
- "options": {
- "displayMode": "lcd",
- "maxVizHeight": 165,
- "minVizHeight": 0,
- "minVizWidth": 75,
- "namePlacement": "left",
- "orientation": "horizontal",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "showUnfilled": true,
- "sizing": "auto",
- "valueMode": "color"
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "topk(5,count by(model) (sum_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])))",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n model,\n total_count,\n percentage_usage\nFROM \n (\n SELECT \n model,\n COUNT(*) AS total_count,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage_usage\n FROM \n doku\n WHERE $__timeFilter(time)\n GROUP BY \n model\n ORDER BY \n percentage_usage DESC\n ) sub\nLIMIT 5;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Top models by usage",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "model": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- },
- {
- "id": "sortBy",
- "options": {
- "fields": {},
- "sort": [
- {
- "desc": true,
- "field": "Value (sum)"
- }
- ]
- }
- }
- ],
- "type": "bargauge"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Breaks down token usage across different LLM models, offering insights into which models are driving the highest token consumption.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 23,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 1,
- "pointSize": 9,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 27
- },
- "id": 14,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "sum_over_time(doku_llm_totalTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "{{model}}",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n DATE_TRUNC('day', \"time\") AS \"time\",\n model,\n COUNT(*) AS \"Model:\"\nFROM \n doku\nWHERE \n $__timeFilter(\"time\")\nGROUP BY \n 1, model\nORDER BY \n \"time\" ASC, model;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Token usage by model",
- "transformations": [],
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "description": "Displays a log of all prompt messages sent to the LLM, providing insights into the inputs and interactions leading up to LLM responses.",
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 33
- },
- "id": 26,
- "options": {
- "dedupStrategy": "none",
- "enableLogDetails": true,
- "prettifyLogMessage": true,
- "showCommonLabels": false,
- "showLabels": false,
- "showTime": true,
- "sortOrder": "Descending",
- "wrapLogMessage": false
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "editorMode": "code",
- "expr": "{job=\"doku\", type=\"prompt\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "hide": false,
- "queryType": "range",
- "refId": "B"
- }
- ],
- "title": "Prompts",
- "transformations": [
- {
- "id": "extractFields",
- "options": {
- "format": "auto",
- "source": "labels"
- }
- }
- ],
- "transparent": true,
- "type": "logs"
- },
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "description": "Displays a log of all responses from the LLM, offering a comprehensive view of how the model interprets prompts and the information it generates.",
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 33
- },
- "id": 27,
- "options": {
- "dedupStrategy": "none",
- "enableLogDetails": true,
- "prettifyLogMessage": true,
- "showCommonLabels": false,
- "showLabels": false,
- "showTime": true,
- "sortOrder": "Descending",
- "wrapLogMessage": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "editorMode": "code",
- "expr": "{job=\"doku\", type=\"response\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "hide": false,
- "queryType": "range",
- "refId": "B"
- }
- ],
- "title": "Responses",
- "transformations": [
- {
- "id": "extractFields",
- "options": {
- "format": "auto",
- "source": "labels"
- }
- }
- ],
- "transparent": true,
- "type": "logs"
- }
- ],
- "refresh": "",
- "schemaVersion": 39,
- "tags": [
- "Doku",
- "OpenAI",
- "Cohere",
- "Anthropic"
- ],
- "templating": {
- "list": [
- {
- "current": {
- "selected": true,
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
- },
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "definition": "label_values(applicationName)",
- "hide": 0,
- "includeAll": true,
- "label": "Application",
- "multi": true,
- "name": "Application",
- "options": [],
- "query": {
- "qryType": 1,
- "query": "label_values(applicationName)",
- "refId": "PrometheusVariableQueryEditor-VariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": true,
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
- },
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "definition": "label_values(environment)",
- "hide": 0,
- "includeAll": true,
- "label": "Environment",
- "multi": true,
- "name": "Environment",
- "options": [],
- "query": {
- "qryType": 1,
- "query": "label_values(environment)",
- "refId": "PrometheusVariableQueryEditor-VariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- }
- ]
- },
- "time": {
- "from": "now-24h",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Doku - LLM Monitoring",
- "uid": "doku-llm-monitoring",
- "version": 1,
- "weekStart": ""
- }
- ```
-</Accordion>
-
diff --git a/docs/0.0.1/connections/new-relic.mdx b/docs/0.0.1/connections/new-relic.mdx
deleted file mode 100644
index 391c8b9c..00000000
--- a/docs/0.0.1/connections/new-relic.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: 'New Relic'
-description: 'Connect Doku to New Relic'
----
-
-Doku can automatically send LLM usage data from Doku to New Relic using the [Report Metrics HTTP API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/report-metrics-metric-api/) and [Send Logs API](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api/)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- newRelic:
- metricsUrl: <your-new-relic-metrics-url> # URL to the New Relic Metric API
- logsUrl: <your-new-relic-logs-url> # URL to the New Relic Log API
- key: <your-new-relic-api-key> # Ingest API Key of the New Relic Account
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/introduction.mdx b/docs/0.0.1/dokumetry/introduction.mdx
deleted file mode 100644
index 055e373b..00000000
--- a/docs/0.0.1/dokumetry/introduction.mdx
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: 'Overview'
-description: 'Seamlessly send LLM usage data to Doku'
----
-
-[DokuMetry SDK](https://www.npmjs.com/package/dokumetry) (`dokumetry`) empowers you to effortlessly track and monitor language learning model (LLM) usage data and metrics from your Python/NodeJS code. It seamlessly integrates with major LLM Platforms:
-
-
-DokuMetry SDKs can currently track and monitor API usage for the below platforms
-<CardGroup cols={3}>
- <Card
- title="OpenAI"
- icon={
- <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>OpenAI</title>
- <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Cohere"
- icon={
- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">
- <g>
- <g>
- <g>
- <path d="M24.3,44.7c2,0,6-0.1,11.6-2.4c6.5-2.7,19.3-7.5,28.6-12.5c6.5-3.5,9.3-8.1,9.3-14.3C73.8,7,66.9,0,58.3,0
- h-36C10,0,0,10,0,22.3S9.4,44.7,24.3,44.7z">
- </path>
- <path d="M30.4,60c0-6,3.6-11.5,9.2-13.8l11.3-4.7C62.4,36.8,75,45.2,75,57.6C75,67.2,67.2,75,57.6,75l-12.3,0
- C37.1,75,30.4,68.3,30.4,60z">
- </path>
- <path d="M12.9,47.6L12.9,47.6C5.8,47.6,0,53.4,0,60.5v1.7C0,69.2,5.8,75,12.9,75h0c7.1,0,12.9-5.8,12.9-12.9v-1.7
- C25.7,53.4,20,47.6,12.9,47.6z">
- </path>
- </g>
- </g>
- </g>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Anthropic"
- icon={
- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">
- <path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path>
- <path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
-</CardGroup>
-
-All LLM observability data collected by DokuMetry is sent directly to the Doku Platform for streamlined tracking.
-
-## Features
-
-- **Effortless Setup:** Integrate full-featured LLM usage monitoring into your application with just two lines of code.
-- **Efficient Performance:** Designed for near-zero latency impact, allowing your applications to run smoothly without compromise.
-- **Secure and Reliable**: DokuMetry SDKs prioritize the safety and integrity of your data. All data transmission to Doku is conducted over secure HTTP, ensuring that your observability data is protected during transit.
-
-## Supported Languages
-
-<CardGroup cols={2}>
-<Card title="Python" href="/0.0.1/dokumetry/python" icon="python">
-</Card>
-<Card title="NodeJS" href="/0.0.1/dokumetry/node" icon="node-js">
-</Card>
-</CardGroup>
diff --git a/docs/0.0.1/dokumetry/node/examples/anthropic/anthropic-completions.mdx b/docs/0.0.1/dokumetry/node/examples/anthropic/anthropic-completions.mdx
deleted file mode 100644
index 6fbff10e..00000000
--- a/docs/0.0.1/dokumetry/node/examples/anthropic/anthropic-completions.mdx
+++ /dev/null
@@ -1,29 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor Anthropic Completions API Usage'
----
-
-## Completions
-
-```javascript
-import Anthropic from '@anthropic-ai/sdk';
-import DokuMetry from 'dokumetry';
-
-const anthropic = new Anthropic({
- apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]
-});
-
-// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await anthropic.completions.create({
- model: 'claude-2',
- max_tokens_to_sample: 300,
- prompt: `${Anthropic.HUMAN_PROMPT} Hello, Claude{Anthropic.AI_PROMPT}`,
- });
- console.log(completion.completion);
-}
-main().catch(console.error);
-```
-
diff --git a/docs/0.0.1/dokumetry/node/examples/cohere/chat.mdx b/docs/0.0.1/dokumetry/node/examples/cohere/chat.mdx
deleted file mode 100644
index fdc6a559..00000000
--- a/docs/0.0.1/dokumetry/node/examples/cohere/chat.mdx
+++ /dev/null
@@ -1,60 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor Cohere Chat API usage'
----
-
-## Chat
-<CodeGroup>
-
-```javascript No Streaming
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const response = await cohere.chat({
- message: 'Say this is a test',
- model: 'command',
- });
-
- console.log(response)
-})();
-```
-
-```javascript Streaming
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const chatStream = await cohere.chatStream({
- chatHistory: [
- { role: "USER", message: "Who discovered gravity?" },
- { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }
- ],
- message: "What year was he born?",
- // perform web search before answering the question. You can also use your own custom connector.
- connectors: [{ id: "web-search" }],
- });
-
- for await (const message of chatStream) {
- if (message.eventType === "text-generation") {
- console.log(message);
- }
- }
-})();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/examples/cohere/embed.mdx b/docs/0.0.1/dokumetry/node/examples/cohere/embed.mdx
deleted file mode 100644
index e11ba206..00000000
--- a/docs/0.0.1/dokumetry/node/examples/cohere/embed.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: 'Embed'
-description: 'Monitor Cohere Embed API usage'
----
-
-## Embed
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const embed = await cohere.embed({
- texts: ["hello", "goodbye"],
- model: "embed-english-v3.0",
- inputType: "classification",
- });
- console.log(embed);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/examples/cohere/generate.mdx b/docs/0.0.1/dokumetry/node/examples/cohere/generate.mdx
deleted file mode 100644
index b48cdd1c..00000000
--- a/docs/0.0.1/dokumetry/node/examples/cohere/generate.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 'Generate'
-description: 'Monitor Cohere Generate API usage'
----
-
-## Generate
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const generate = await cohere.generate({
- prompt: "Please explain to me how LLMs work",
- });
-
- console.log(generate);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/examples/cohere/summarize.mdx b/docs/0.0.1/dokumetry/node/examples/cohere/summarize.mdx
deleted file mode 100644
index 32cfd261..00000000
--- a/docs/0.0.1/dokumetry/node/examples/cohere/summarize.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'Summarize'
-description: 'Monitor Cohere Summarize API usage'
----
-
-## Summarize
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const summarize = await cohere.summarize({
- text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
- + "It may be made from milk or cream and is flavoured with a sweetener, "
- + "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
- + "or with fruit such as strawberries or peaches. "
- + "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
- + "Food coloring is sometimes added, in addition to stabilizers. "
- + "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
- + "and to prevent detectable ice crystals from forming. The result is a smooth, "
- + "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
- + "It becomes more malleable as its temperature increases.\n\n"
- + "The meaning of the name \"ice cream\" varies from one country to another. "
- + "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
- + "and most governments regulate the commercial use of the various terms according to the "
- + "relative quantities of the main ingredients, notably the amount of cream. "
- + "Products that do not meet the criteria to be called ice cream are sometimes labelled "
- + "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
- + "one word is used fo\r all variants. Analogues made from dairy alternatives, "
- + "such as goat's or sheep's milk, or milk substitutes "
- + "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
- + "lactose intolerant, allergic to dairy protein or vegan.",
- });
-
- console.log(summarize);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/examples/openai/audio.mdx b/docs/0.0.1/dokumetry/node/examples/openai/audio.mdx
deleted file mode 100644
index cd5c1107..00000000
--- a/docs/0.0.1/dokumetry/node/examples/openai/audio.mdx
+++ /dev/null
@@ -1,32 +0,0 @@
----
-title: 'Audio'
-description: 'Monitor OpenAI Audio API usage'
----
-
-## Create Speech
-
-```javascript
-import fs from "fs";
-import path from "path";
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-const speechFile = path.resolve("./speech.mp3");
-
-async function main() {
- const mp3 = await openai.audio.speech.create({
- model: "tts-1",
- voice: "alloy",
- input: "Today is a wonderful day to build something people love!",
- });
- console.log(speechFile);
- const buffer = Buffer.from(await mp3.arrayBuffer());
- await fs.promises.writeFile(speechFile, buffer);
-}
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/examples/openai/chat.mdx b/docs/0.0.1/dokumetry/node/examples/openai/chat.mdx
deleted file mode 100644
index 4400245f..00000000
--- a/docs/0.0.1/dokumetry/node/examples/openai/chat.mdx
+++ /dev/null
@@ -1,157 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor OpenAI Chat Completions API usage'
----
-
-## Chat Completions
-
-<CodeGroup>
-
-```javascript Default
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- messages: [{ role: "system", content: "You are a helpful assistant." }],
- model: "gpt-3.5-turbo",
- });
-
- console.log(completion.choices[0]);
-}
-
-main();
-```
-
-```javascript Image Input
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const response = await openai.chat.completions.create({
- model: "gpt-4-vision-preview",
- messages: [
- {
- role: "user",
- content: [
- { type: "text", text: "What’s in this image?" },
- {
- type: "image_url",
- image_url:
- "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
- },
- ],
- },
- ],
- });
- console.log(response.choices[0]);
-}
-main();
-```
-
-```javascript Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- model: "gpt-3.5-turbo",
- messages: [
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- stream: true,
- });
-
- for await (const chunk of completion) {
- console.log(chunk.choices[0].delta.content);
- }
-}
-
-main();
-```
-
-```javascript Functions
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];
- const tools = [
- {
- "type": "function",
- "function": {
- "name": "get_current_weather",
- "description": "Get the current weather in a given location",
- "parameters": {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and state, e.g. San Francisco, CA",
- },
- "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
- },
- "required": ["location"],
- },
- }
- }
- ];
-
- const response = await openai.chat.completions.create({
- model: "gpt-3.5-turbo",
- messages: messages,
- tools: tools,
- tool_choice: "auto",
- });
-
- console.log(response);
-}
-
-main();
-```
-
-```javascript LogProbs
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- messages: [{ role: "user", content: "Hello!" }],
- model: "gpt-3.5-turbo",
- logprobs: true,
- top_logprobs: 2,
- });
-
- console.log(completion.choices[0]);
-}
-
-main();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/examples/openai/chatCompletions.mdx b/docs/0.0.1/dokumetry/node/examples/openai/chatCompletions.mdx
deleted file mode 100644
index 3d7ea2d3..00000000
--- a/docs/0.0.1/dokumetry/node/examples/openai/chatCompletions.mdx
+++ /dev/null
@@ -1,53 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor OpenAI Completions API Usage'
----
-
-## Completions
-<CodeGroup>
-```javascript No Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.completions.create({
- model: "gpt-3.5-turbo-instruct",
- prompt: "Say this is a test.",
- max_tokens: 7,
- temperature: 0,
- });
-
- console.log(completion);
-}
-main();
-```
-
-```javascript Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const stream = await openai.completions.create({
- model: "gpt-3.5-turbo-instruct",
- prompt: "Say this is a test.",
- stream: true,
- });
-
- for await (const chunk of stream) {
- console.log(chunk.choices[0].text)
- }
-}
-main();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/examples/openai/embeddings.mdx b/docs/0.0.1/dokumetry/node/examples/openai/embeddings.mdx
deleted file mode 100644
index 7ecf6b51..00000000
--- a/docs/0.0.1/dokumetry/node/examples/openai/embeddings.mdx
+++ /dev/null
@@ -1,28 +0,0 @@
----
-title: 'Embeddings'
-description: 'Monitor OpenAI Embeddings API usage'
----
-
-## Create Embeddings
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const embedding = await openai.embeddings.create({
- model: "text-embedding-ada-002",
- input: "The quick brown fox jumped over the lazy dog",
- encoding_format: "float",
- });
-
- console.log(embedding);
-}
-
-main();
-```
diff --git a/docs/0.0.1/dokumetry/node/examples/openai/fine-tuning.mdx b/docs/0.0.1/dokumetry/node/examples/openai/fine-tuning.mdx
deleted file mode 100644
index 513a8575..00000000
--- a/docs/0.0.1/dokumetry/node/examples/openai/fine-tuning.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 'Fine Tuning'
-description: 'Monitor OpenAI Fine Tuning API usage'
----
-
-## Create Fine Tuning Job
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const fineTune = await openai.fineTuning.jobs.create({
- training_file: "file-abc123"
- });
-
- console.log(fineTune);
-}
-
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/examples/openai/image.mdx b/docs/0.0.1/dokumetry/node/examples/openai/image.mdx
deleted file mode 100644
index 06b196ab..00000000
--- a/docs/0.0.1/dokumetry/node/examples/openai/image.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: 'Image'
-description: 'Monitor OpenAI Image API usage'
----
-
-## Create Image
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });
-
- console.log(image.data);
-}
-main();
-```
-
-## Create Image Variation
-```javascript
-import fs from "fs";
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const image = await openai.images.createVariation({
- image: fs.createReadStream("otter.png"),
- });
-
- console.log(image.data);
-}
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/node/intro.mdx b/docs/0.0.1/dokumetry/node/intro.mdx
deleted file mode 100644
index 36194817..00000000
--- a/docs/0.0.1/dokumetry/node/intro.mdx
+++ /dev/null
@@ -1,125 +0,0 @@
----
-title: 'Introduction'
-description: 'Monitor your NodeJS LLM Application with DokuMetry'
----
-
-DokuMetry Node SDK is the official library from Doku to send LLM usage data from your NodeJS application to Doku.
-
-## Installation
-``` shell shell
-npm install dokumetry
-```
-
-## Usage
-
-### OpenAI
-
-```javascript openai.js
-import OpenAI from 'openai';
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI({
- apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]
-});
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const chatCompletion = await openai.chat.completions.create({
- messages: [{ role: 'user', content: 'What are the key to effective observability?' }],
- model: 'gpt-3.5-turbo',
- });
-}
-
-main();
-```
-
-The following OpenAI Endpoints are supported for monitoring with DokuMetry
-
-- [Chat completions](/0.0.1/dokumetry/node/examples/openai/chat)
-- [Image Create](/0.0.1/dokumetry/node/examples/openai/image#create-image) and [Image Variations](/0.0.1/dokumetry/node/examples/openai/image#create-image-variation)
-- [Audio Speech Create](/0.0.1/dokumetry/node/examples/openai/audio)
-- [Embeddings](/0.0.1/dokumetry/node/examples/openai/embeddings)
-- [Fine Tunings](/0.0.1/dokumetry/node/examples/openai/fine-tuning)
-- [Completions](/0.0.1/dokumetry/node/examples/openai/chatCompletions)
-
-### Cohere
-
-```javascript cohere.js
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- apiKey: "YOUR_API_KEY",
-});
-
-// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-(async () => {
- const prediction = await cohere.generate({
- prompt: "hello",
- maxTokens: 10,
- });
-
- console.log("Received prediction", prediction);
-})();
-```
-
-The following Cohere Endpoints are supported for monitoring with DokuMetry
-
-- [Chat](/0.0.1/dokumetry/node/examples/cohere/chat)
-- [Generate](/0.0.1/dokumetry/node/examples/cohere/generate)
-- [Summarize](/0.0.1/dokumetry/node/examples/cohere/summarize)
-- [Embed](/0.0.1/dokumetry/node/examples/cohere/embed)
-
-### Anthropic
-
-```javascript anthropic.js
-import Anthropic from '@anthropic-ai/sdk';
-import DokuMetry from 'dokumetry';
-
-const anthropic = new Anthropic({
- apiKey: 'my api key', // defaults to process.env["ANTHROPIC_API_KEY"]
-});
-
-// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await anthropic.completions.create({
- model: 'claude-2',
- max_tokens_to_sample: 300,
- prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,
- });
-}
-
-main();
-```
-
-The following Anthropic Endpoints are supported for monitoring with DokuMetry
-
-- [Completions](/0.0.1/dokumetry/node/examples/anthropic/anthropic-completions)
-
-## Parameters
-
-| Parameter | Description | Required |
-|-------------------|-----------------------------------------------------------|---------------|
-| llm | Language Learning Model (LLM) Object to track | Yes |
-| dokuUrl | URL of your Doku Instance | Yes |
-| apiKey | Your Doku API key | Yes |
-| environment | Custom environment tag to include in your metrics | Optional |
-| applicationName | Custom application name tag for your metrics | Optional |
-| skipResp | Skip response from the Doku Ingester for faster execution | Optional |
-
-## Advanced Usage
-When using DokuMetry in Production environments, It is recommened to set `skipResp: True` for faster porcessing.
-
-To filter your LLM Usage according application or the environment, set the `application` and `environment` parameters with the actual values.
-
-
-## Requirements
-NodeJS >= 18.0 is supported.
-
-If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/anthropic/anthropic-completions.mdx b/docs/0.0.1/dokumetry/python/examples/anthropic/anthropic-completions.mdx
deleted file mode 100644
index b2ea104b..00000000
--- a/docs/0.0.1/dokumetry/python/examples/anthropic/anthropic-completions.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor Anthropic Completions API Usage'
----
-
-## Completions
-
-```javascript
-from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
-import dokumetry
-
-anthropic = Anthropic(
- # defaults to os.environ.get("ANTHROPIC_API_KEY")
- api_key="my_api_key",
-)
-
-# Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = anthropic.completions.create(
- model="claude-2",
- max_tokens_to_sample=300,
- prompt=f"{HUMAN_PROMPT} Hello, Claude{AI_PROMPT}",
-)
-print(completion.completion)
-```
-
diff --git a/docs/0.0.1/dokumetry/python/examples/cohere/chat.mdx b/docs/0.0.1/dokumetry/python/examples/cohere/chat.mdx
deleted file mode 100644
index d8f8fb92..00000000
--- a/docs/0.0.1/dokumetry/python/examples/cohere/chat.mdx
+++ /dev/null
@@ -1,52 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor Cohere Chat API usage'
----
-
-## Chat
-<CodeGroup>
-
-```python No Streaming
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.chat(
- chat_history=[
- {"role": "USER", "message": "Who discovered gravity?"},
- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
- ],
- message="What year was he born?",
- # perform web search before answering the question. You can also use your own custom connector.
- connectors=[{"id": "web-search"}]
-)
-print(response)
-```
-
-```python Streaming
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.chat(
- chat_history=[
- {"role": "USER", "message": "Who discovered gravity?"},
- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
- ],
- message="What year was he born?",
- stream=True,
- # perform web search before answering the question. You can also use your own custom connector.
- connectors=[{"id": "web-search"}]
-)
-print(response)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/cohere/co-summarize.mdx b/docs/0.0.1/dokumetry/python/examples/cohere/co-summarize.mdx
deleted file mode 100644
index c9bfcc05..00000000
--- a/docs/0.0.1/dokumetry/python/examples/cohere/co-summarize.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: 'Summarize'
-description: 'Monitor Cohere Summarize API usage'
----
-
-## Summarize
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-text=(
- "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
- "It may be made from milk or cream and is flavoured with a sweetener, "
- "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
- "or with fruit such as strawberries or peaches. "
- "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
- "Food coloring is sometimes added, in addition to stabilizers. "
- "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
- "and to prevent detectable ice crystals from forming. The result is a smooth, "
- "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
- "It becomes more malleable as its temperature increases.\n\n"
- "The meaning of the name \"ice cream\" varies from one country to another. "
- "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
- "and most governments regulate the commercial use of the various terms according to the "
- "relative quantities of the main ingredients, notably the amount of cream. "
- "Products that do not meet the criteria to be called ice cream are sometimes labelled "
- "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
- "one word is used fo\r all variants. Analogues made from dairy alternatives, "
- "such as goat's or sheep's milk, or milk substitutes "
- "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
- "lactose intolerant, allergic to dairy protein or vegan."
-)
-
-response = co.summarize(
- text=text,
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/cohere/embed.mdx b/docs/0.0.1/dokumetry/python/examples/cohere/embed.mdx
deleted file mode 100644
index 05900ae2..00000000
--- a/docs/0.0.1/dokumetry/python/examples/cohere/embed.mdx
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: 'Embed'
-description: 'Monitor Cohere Embed API usage'
----
-
-## Embed
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.embed(
- texts=['hello', 'goodbye'],
- model='embed-english-v3.0',
- input_type='classification'
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/cohere/generate.mdx b/docs/0.0.1/dokumetry/python/examples/cohere/generate.mdx
deleted file mode 100644
index b137a0c9..00000000
--- a/docs/0.0.1/dokumetry/python/examples/cohere/generate.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Generate'
-description: 'Monitor Cohere Generate API usage'
----
-
-## Generate
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.generate(
- prompt='Please explain to me how LLMs work',
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/openai/audio.mdx b/docs/0.0.1/dokumetry/python/examples/openai/audio.mdx
deleted file mode 100644
index c927bb36..00000000
--- a/docs/0.0.1/dokumetry/python/examples/openai/audio.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: 'Audio'
-description: 'Monitor OpenAI Audio API usage'
----
-
-## Create Speech
-
-```python
-from pathlib import Path
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-speech_file_path = Path(__file__).parent / "speech.mp3"
-response = client.audio.speech.create(
- model="tts-1",
- voice="alloy",
- input="The quick brown fox jumped over the lazy dog."
-)
-response.stream_to_file(speech_file_path)
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/openai/chat.mdx b/docs/0.0.1/dokumetry/python/examples/openai/chat.mdx
deleted file mode 100644
index 5c97d068..00000000
--- a/docs/0.0.1/dokumetry/python/examples/openai/chat.mdx
+++ /dev/null
@@ -1,143 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor OpenAI Chat Completions API usage'
----
-
-## Chat Completions
-
-<CodeGroup>
-
-```python Default
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ]
-)
-
-print(completion.choices[0].message)
-```
-
-```python Image Input
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = client.chat.completions.create(
- model="gpt-4-vision-preview",
- messages=[
- {
- "role": "user",
- "content": [
- {"type": "text", "text": "What’s in this image?"},
- {
- "type": "image_url",
- "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
- },
- ],
- }
- ],
- max_tokens=300,
-)
-
-print(response.choices[0])
-```
-
-```python Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- stream=True
-)
-
-for chunk in completion:
- print(chunk.choices[0].delta)
-```
-
-```python Functions
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-tools = [
- {
- "type": "function",
- "function": {
- "name": "get_current_weather",
- "description": "Get the current weather in a given location",
- "parameters": {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and state, e.g. San Francisco, CA",
- },
- "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
- },
- "required": ["location"],
- },
- }
- }
-]
-messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=messages,
- tools=tools,
- tool_choice="auto"
-)
-
-print(completion)
-```
-
-```python LogProbs
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "user", "content": "Hello!"}
- ],
- logprobs=True,
- top_logprobs=2
-)
-
-print(completion.choices[0].message)
-print(completion.choices[0].logprobs)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/openai/completions.mdx b/docs/0.0.1/dokumetry/python/examples/openai/completions.mdx
deleted file mode 100644
index ab3beb87..00000000
--- a/docs/0.0.1/dokumetry/python/examples/openai/completions.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor OpenAI Completions API Usage'
----
-
-## Completions
-<CodeGroup>
-```python No Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.completions.create(
- model="gpt-3.5-turbo-instruct",
- prompt="Say this is a test",
- max_tokens=7,
- temperature=0
-)
-```
-
-```python Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-for chunk in client.completions.create(
- model="gpt-3.5-turbo-instruct",
- prompt="Say this is a test",
- max_tokens=7,
- temperature=0,
- stream=True
-):
-
-print(chunk.choices[0].text)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/openai/embeddings.mdx b/docs/0.0.1/dokumetry/python/examples/openai/embeddings.mdx
deleted file mode 100644
index 6c22743a..00000000
--- a/docs/0.0.1/dokumetry/python/examples/openai/embeddings.mdx
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: 'Embeddings'
-description: 'Monitor OpenAI Embeddings API usage'
----
-
-## Create Embeddings
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.embeddings.create(
- model="text-embedding-ada-002",
- input="The food was delicious and the waiter...",
- encoding_format="float"
-)
-```
diff --git a/docs/0.0.1/dokumetry/python/examples/openai/fine-tuning.mdx b/docs/0.0.1/dokumetry/python/examples/openai/fine-tuning.mdx
deleted file mode 100644
index 4de9f9c7..00000000
--- a/docs/0.0.1/dokumetry/python/examples/openai/fine-tuning.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Fine Tuning'
-description: 'Monitor OpenAI Fine Tuning API usage'
----
-
-## Create Fine Tuning Job
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.fine_tuning.jobs.create(
- training_file="file-abc123",
- model="gpt-3.5-turbo"
-)
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/examples/openai/image.mdx b/docs/0.0.1/dokumetry/python/examples/openai/image.mdx
deleted file mode 100644
index 87df73ea..00000000
--- a/docs/0.0.1/dokumetry/python/examples/openai/image.mdx
+++ /dev/null
@@ -1,40 +0,0 @@
----
-title: 'Image'
-description: 'Monitor OpenAI Image API usage'
----
-
-## Create Image
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.images.generate(
- model="dall-e-3",
- prompt="A cute baby sea otter",
- n=1,
- size="1024x1024"
-)
-```
-
-## Create Image Variation
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = client.images.create_variation(
- image=open("image_edit_original.png", "rb"),
- n=2,
- size="1024x1024"
-)
-```
\ No newline at end of file
diff --git a/docs/0.0.1/dokumetry/python/introduction.mdx b/docs/0.0.1/dokumetry/python/introduction.mdx
deleted file mode 100644
index 67555b7d..00000000
--- a/docs/0.0.1/dokumetry/python/introduction.mdx
+++ /dev/null
@@ -1,119 +0,0 @@
----
-title: 'Introduction'
-description: 'Monitor your Python LLM Application with DokuMetry'
----
-
-DokuMetry Python SDK is the official library from Doku to send LLM usage data from your Python application to Doku.
-
-## Installation
-``` shell shell
-pip install dokumetry
-```
-
-## Usage
-
-### OpenAI
-
-``` python openai.py
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI(
- api_key="YOUR_OPENAI_KEY"
-)
-
-# Pass the above `client` object along with your Doku URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-chat_completion = client.chat.completions.create(
- messages=[
- {
- "role": "user",
- "content": "What is LLM Observability",
- }
- ],
- model="gpt-3.5-turbo",
-)
-```
-
-The following OpenAI Endpoints are supported for monitoring with DokuMetry
-
-- [Chat completions](/0.0.1/dokumetry/python/examples/openai/chat)
-- [Image Create](/0.0.1/dokumetry/python/examples/openai/image#create-image) and [Image Variations](/0.0.1/dokumetry/python/examples/openai/image#create-image-variation)
-- [Audio Speech Create](/0.0.1/dokumetry/python/examples/openai/audio)
-- [Embeddings](/0.0.1/dokumetry/python/examples/openai/embeddings)
-- [Fine Tunings](/0.0.1/dokumetry/python/examples/openai/fine-tuning)
-- [Completions](/0.0.1/dokumetry/python/examples/openai/completions)
-
-### Cohere
-
-```python cohere.py
-import cohere
-import dokumetry
-
-# initialize the Cohere Client with an API Key
-co = cohere.Client('YOUR_API_KEY')
-
-# Pass the above `co` object along with your Doku URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-# generate a prediction for a prompt
-prediction = co.chat(message='What is LLM Observability?', model='command')
-
-# print the predicted text
-print(f'Chatbot: {prediction.text}')
-```
-
-The following Cohere Endpoints are supported for monitoring with DokuMetry
-
-- [Chat](/0.0.1/dokumetry/python/examples/cohere/chat)
-- [Generate](/0.0.1/dokumetry/python/examples/cohere/generate)
-- [Summarize](/0.0.1/dokumetry/python/examples/cohere/co-summarize)
-- [Embed](/0.0.1/dokumetry/python/examples/cohere/embed)
-
-### Anthropic
-
-```python anthropic.py
-from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
-import dokumetry
-
-anthropic = Anthropic(
- # defaults to os.environ.get("ANTHROPIC_API_KEY")
- api_key="my api key",
-)
-
-# Pass the above `anthropic` object along with your Doku URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = anthropic.completions.create(
- model="claude-2",
- max_tokens_to_sample=300,
- prompt=f"{HUMAN_PROMPT} What is LLM Observability?{AI_PROMPT}",
-)
-print(completion.completion)
-```
-
-The following Anthropic Endpoints are supported for monitoring with DokuMetry
-
-- [Completions](/0.0.1/dokumetry/python/examples/anthropic/anthropic-completions.mdx)
-
-## Parameters
-
-| Parameter | Description | Required |
-|-------------------|-----------------------------------------------------------|---------------|
-| llm | Language Learning Model (LLM) Object to track | Yes |
-| doku_url | URL of your Doku Instance | Yes |
-| api_key | Your Doku API key | Yes |
-| environment | Custom environment tag to include in your metrics | Optional |
-| application_name | Custom application name tag for your metrics | Optional |
-| skip_resp | Skip response from the Doku Ingester for faster execution | Optional |
-
-## Advanced Usage
-When using DokuMetry in Production environments, It is recommened to set `skip_resp = true` for faster porcessing.
-
-To filter your LLM Usage according application or the environment, set the `application` and `environment` paramaters with the actual values.
-
-## Requirements
-Python >= 3.7 is supported.
-
-If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).
\ No newline at end of file
diff --git a/docs/0.0.1/installation.mdx b/docs/0.0.1/installation.mdx
deleted file mode 100644
index ce2d9c0a..00000000
--- a/docs/0.0.1/installation.mdx
+++ /dev/null
@@ -1,273 +0,0 @@
----
-title: 'Installing Doku'
-description: 'Deploy Doku in your preferred environment'
-icon: 'circle-down'
----
-
-Doku flexibly adapts to your preferred environment. Select a deployment method that best fits your setup:
-
-<CardGroup cols={2}>
- <Card
- title="Kubernetes"
- icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>Kubernetes</title>
- <path fill="#FFA500" d="M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"/></svg>}
- href="/0.0.1/installation#kubernetes"
- >
- Deploy Doku in a Kubernetes Cluster using Helm
- </Card>
- <Card
- title="Docker"
- icon="docker"
- href="/0.0.1/installation#docker"
- >
- Deploy Doku using docker compose
- </Card>
- <Card
- title="Linux"
- icon="linux"
- href="/0.0.1/installation#linux"
- >
- Deploy Doku in a Linux Host
- </Card>
- <Card
- title="Windows"
- icon="windows"
- href="/0.0.1/installation#windows"
- >
- Deploy Doku in a Windows Host
- </Card>
-</CardGroup>
-
-## Kubernetes
-
-Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://github.com/dokulabs/helm/tree/main/charts/doku) for a reliable and scalable solution.
-<Steps>
- <Step title="Helm Repo Setup">
- ```shell shell
- helm repo add dokulabs https://dokulabs.github.io/helm/
- helm repo update
- ```
- </Step>
- <Step title="Installing the Helm Chart">
- ```shell shell
- helm install doku dokulabs/doku --version 0.0.7
- ```
- </Step>
-</Steps>
-<Info>As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [values.yaml](https://github.com/dokulabs/helm/blob/main/charts/doku/values.yaml) file. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.</Info>
-
-## Docker
-Quickly spin up Doku using Docker for a fast and straightforward setup.
-
-<Steps>
- <Step title="Install TimescaleDB">
- <Steps>
- <Step title="Pull TimescaleDB Image">
- ```shell
- docker pull timescale/timescaledb-ha:pg14-ts2.14
- ```
- </Step>
- <Step title="Run TimescaleDB Image">
- ```shell
- docker run -d --name timescaledb -p 127.0.0.1:5432:5432 \
- -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg14-ts2.14
- ```
- </Step>
- </Steps>
- </Step>
- <Step title="Install Doku">
- <Steps>
- <Step title="Pull Doku Image">
- ```shell
- docker pull ghcr.io/dokulabs/doku-ingester:0.0.1
- ```
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.1/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Run the Doku Image">
- ```shell
- docker run -d --name doku -p 127.0.0.1:9044:9044 -v /doku.yml:/doku.yml dokulabs/ingester:0.0.1 --config /doku.yml
- ```
- </Step>
- </Steps>
- </Step>
-</Steps>
-
-## Linux
-<Steps>
- <Step title="Install TimescaleDB">
- Follow the Instructions [here](https://docs.timescale.com/self-hosted/latest/install/installation-linux/#installing-self-hosted-timescaledb-on-debian-based-systems) to install TimescaleDB in your Linux host.
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.1/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Install Doku in a linux Host">
- <Tabs>
- <Tab title="Linux">
- <CodeGroup>
- ```shell amd64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.1/ingester-linux-amd64
- chmod +x ingester-linux-amd64
- ./ingester-linux-amd64 --config doku.yml
- ```
-
- ```shell arm64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.1/ingester-linux-arm64
- chmod +x ingester-linux-arm64
- ./ingester-linux-arm64 --config doku.yml
- ```
-
- ```shell arm
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.1/ingester-linux-arm
- chmod +x ingester-linux-arm
- ./ingester-linux-arm --config doku.yml
- ```
-
- ```shell ppc64le
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.1/ingester-linux-ppc64le
- chmod +x ingester-linux-ppc64le
- ./ingester-linux-ppc64le --config doku.yml
- ```
- </CodeGroup>
- </Tab>
- <Tab title="Darwin">
- <CodeGroup>
- ```shell amd64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.1/ingester-darwin-amd64
- chmod +x ingester-darwin-amd64
- ./ingester-darwin-amd64 --config doku.yml
- ```
-
- ```shell arm64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.1/ingester-darwin-arm64
- chmod +x ingester-darwin-arm64
- ./ingester-darwin-arm64 --config doku.yml
- ```
- </CodeGroup>
- </Tab>
- </Tabs>
- </Step>
-</Steps>
-
-## Windows
-<Steps>
- <Step title="Install TimescaleDB">
- <Steps>
- Download and install the Visual C++ Redistributable for Visual Studio from [www.microsoft.com](https://www.microsoft.com/en-us/download/details.aspx?id=48145).
-
- Download and install PostgreSQL from [www.postgresql.org](https://www.postgresql.org/download/windows/). You might need to add the `pg_config` file location to your path. In the Windows Search tool, search for `system environment variables`. The path should be `C:\Program Files\PostgreSQL\<version>\bin`.
-
- Download the TimescaleDB installation `.zip` file from [Windows releases](https://docs.timescale.com/self-hosted/latest/install/installation-windows/#windows-releases).
-
- Locate the downloaded file on your local file system, and extract the files.
-
- In the extracted TimescaleDB directory, right-click the `setup.exe` file and select `Run as Administrator` to start the installer.
- </Steps>
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.1/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Install Doku in a Windows Host">
- <CodeGroup>
- ```shell amd64
- invoke-WebRequest -Uri "https://github.com/dokulabs/doku/releases/download/0.0.1/ingester-windows-amd64" -OutFile "ingester.exe"
- .\ingester.exe --config doku.yml
- ```
-
- ```shell 386
- invoke-WebRequest -Uri "https://github.com/dokulabs/doku/releases/download/0.0.1/ingester-windows-386" -OutFile "ingester.exe"
- .\ingester.exe --config doku.yml
- ```
- </CodeGroup>
- </Step>
-</Steps>
-
diff --git a/docs/0.0.1/intro.mdx b/docs/0.0.1/intro.mdx
deleted file mode 100644
index 16e1c7d4..00000000
--- a/docs/0.0.1/intro.mdx
+++ /dev/null
@@ -1,111 +0,0 @@
----
-title: What is Doku?
-description: 'Monitor and evalute your LLM Applications'
----
-
-Doku is an open-source observability tool engineered for Large Language Models (LLMs). Designed for ease of integration into existing LLM applications, Doku offers unparalleled insights into usage, performance, and overhead—allowing you to analyze, optimize, and scale your AI applications and LLM usage effectively.
-
-Whether you're working with OpenAI, Cohere, or Anthropic, It tracks all your LLM requests transparently and conveys the insights needed to make data-driven decisions. From monitoring usage and understanding latencies to managing costs and collaborating effortlessly, Doku grants you the lens to view your models in high definition.
-
-## How it works
-
-<Frame>
- <img src="https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif" />
-</Frame>
-### Application Integration with Two Lines of Code
-Start by incorporating the DokuMetry SDK into your application. With SDKs tailored for both Python and NodeJS, Doku fits into your tech stack with minimal changes. Just a **two lines** of code is all it takes to begin:
-
-For Python and NodeJS projects, just import the DokuMetry SDK and initialize it as follows:
- <CodeGroup>
- ```python python
- import dokumetry
- dokumetry.init(llm=openai, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
- ```
-
- ```javascript NodeJS
- import DokuMetry from 'dokumetry';
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
- ```
- </CodeGroup>
-Find detailed instructions at the [DokuMetry SDK Documentation](/0.0.1/dokumetry/introduction).
-
-### The Doku Ingester: Your Data Processing Workhorse
-
-Upon SDK setup, data from your LLM operations is automatically collected. The DokuMetry SDKs transmit this usage data over HTTP in the background to the [Doku Ingester](https://github.com/dokulabs/doku/tree/main/src/ingester#readme).
-
-The ingester is the core engine where the magic happens:
-- **Data Collection**: Effortlessly captures live data from your LLM interactions without complicating your existing codebase.
-- **Cost Analysis**: Enriches your data with cost considerations, providing a financial perspective to your analytics.
-- **Secure Storage**: All processed information is securely stored in TimescaleDB, providing you with a scalable, time-series database that can handle large volumes of observability data.
-
-You have the choice to set up a fresh TimescaleDB instance or connect Doku to your existing one. Whichever path you choose, your data resides within your control, reinforcing your data security and operational compliance.
-
-## Features
-Leveraging Doku, you can get:
-
-- **In-depth LLM Monitoring**: Track every request to LLM platforms like OpenAI with precision, ensuring comprehensive visibility over your model's interactions.
-- **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.
-- **Connect to Observability Platforms**: Export LLM Observablity data and insights from Doku to popular observability platforms such as Grafana Cloud or Datadog.
-- **Team-centric Workflow**: Enhance team collaboration with seamless data sharing capabilities, creating an integrated environment for observability-driven teamwork.
-
-## Supported LLM Platforms
-<CardGroup cols={3}>
- <Card
- title="OpenAI"
- icon={
- <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>OpenAI</title>
- <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Cohere"
- icon={
- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">
- <g>
- <g>
- <g>
- <path d="M24.3,44.7c2,0,6-0.1,11.6-2.4c6.5-2.7,19.3-7.5,28.6-12.5c6.5-3.5,9.3-8.1,9.3-14.3C73.8,7,66.9,0,58.3,0
- h-36C10,0,0,10,0,22.3S9.4,44.7,24.3,44.7z">
- </path>
- <path d="M30.4,60c0-6,3.6-11.5,9.2-13.8l11.3-4.7C62.4,36.8,75,45.2,75,57.6C75,67.2,67.2,75,57.6,75l-12.3,0
- C37.1,75,30.4,68.3,30.4,60z">
- </path>
- <path d="M12.9,47.6L12.9,47.6C5.8,47.6,0,53.4,0,60.5v1.7C0,69.2,5.8,75,12.9,75h0c7.1,0,12.9-5.8,12.9-12.9v-1.7
- C25.7,53.4,20,47.6,12.9,47.6z">
- </path>
- </g>
- </g>
- </g>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Anthropic"
- icon={
- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">
- <path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path>
- <path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
-</CardGroup>
-
-## Getting Started
-Select from the following guides to learn more about how to use Doku:
-
-<CardGroup cols={2}>
-<Card title="Quickstart" href="/0.0.1/quickstart" icon='bolt'>
-Get Started with monitoring your LLM Applications in 3 simple steps
-</Card>
-<Card title="Connections" href="/0.0.1/connections/intro" icon='connectdevelop'>
-Connect to your existing Observablity Platform
-</Card>
-</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/api-reference/endpoint/api-keys/create.mdx b/docs/0.0.2/api-reference/endpoint/api-keys/create.mdx
deleted file mode 100644
index cce6cecf..00000000
--- a/docs/0.0.2/api-reference/endpoint/api-keys/create.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'Create API Key'
-openapi: 'POST /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.2/api-reference/endpoint/api-keys/delete.mdx b/docs/0.0.2/api-reference/endpoint/api-keys/delete.mdx
deleted file mode 100644
index fbb9e963..00000000
--- a/docs/0.0.2/api-reference/endpoint/api-keys/delete.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'Delete API Key'
-openapi: 'DELETE /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.2/api-reference/endpoint/api-keys/get.mdx b/docs/0.0.2/api-reference/endpoint/api-keys/get.mdx
deleted file mode 100644
index 3ecec318..00000000
--- a/docs/0.0.2/api-reference/endpoint/api-keys/get.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'GET API Key'
-openapi: 'GET /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.2/api-reference/openiapi.yml b/docs/0.0.2/api-reference/openiapi.yml
deleted file mode 100644
index f1c7dc5b..00000000
--- a/docs/0.0.2/api-reference/openiapi.yml
+++ /dev/null
@@ -1,100 +0,0 @@
-openapi: 3.0.0
-info:
- title: API Keys Service
- description: This service manages API keys through GET, POST, and DELETE operations.
- version: "0.0.2"
-
-servers:
- - url: https://127.0.0.1:9044/
-
-paths:
- /api/keys:
- get:
- summary: Get a list of API keys
- operationId: getApiKeys
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '200':
- description: A list of API keys
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
- post:
- summary: Create a new API key
- operationId: createApiKey
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '201':
- description: API key created
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
- delete:
- summary: Delete an API key
- operationId: deleteApiKey
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '200':
- description: API key deleted
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
-components:
- schemas:
- APIKeyRequest:
- type: object
- required:
- - name
- properties:
- name:
- type: string
-
- jsonResponse:
- type: object
- required:
- - status
- - message
- properties:
- status:
- type: integer
- message:
- type: string
-
- securitySchemes:
- ApiKeyAuth:
- type: apiKey
- in: header
- name: Authorization
\ No newline at end of file
diff --git a/docs/0.0.2/configure.mdx b/docs/0.0.2/configure.mdx
deleted file mode 100644
index f1d0dd2e..00000000
--- a/docs/0.0.2/configure.mdx
+++ /dev/null
@@ -1,250 +0,0 @@
----
-title: 'Configuration'
-description: 'Configuring Options for Doku'
-icon: 'sliders'
----
-
-This document outlines the various options available for configuring Doku.
-For ease of use and clarity, we recommend naming the configuration file `doku.yml`
-
-
-## Properties
-
-<ResponseField name="ingester_port" type="String">
- The `ingesterPort` specifies the network port that the Ingestion Server will listen to for incoming data. You can set this to any available port on your system.
-
-**Example**:
-```yaml
-ingesterPort: 9044
-```
-</ResponseField>
-
-### Pricing Information Source
-<ResponseField name="pricingInfo" type="Object">
- Doku supports using either a local file or a URL to retrieve LLM Pricing data. Comment out the option you do not wish to use.
-</ResponseField>
-
-<Info>
-We strongly recommend using the `url` method with the value set as `https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json`.
-
-This ensures that you automatically retrieve the latest pricing information upon each startup, as the developers at Doku consistently refresh the pricing file with current data from OpenAI, Cohere and Anthropic.
-</Info>
-
-<ResponseField name="local_file" type="Object">
- Local File containing the Pricing Information JSON
- <Expandable title="properties">
- <ResponseField name="path" type="String">
- Specify the local file system path to a JSON file containing the LLM Pricing data.
- </ResponseField>
- </Expandable>
-
- **Example**:
- ```yaml
- pricingInfo:
- localFile:
- path: "/assets/pricing.json"
- ```
-</ResponseField>
-
-<ResponseField name="url" type="String">
- Provide the URL where the pricing data JSON file can be downloaded. Ensure the given URL is accessible.
-
- **Example**:
- ```yaml
- pricingInfo:
- url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json"
- ```
-</ResponseField>
-
-
-### Database Configuration
-
-<ResponseField name="dbConfig" type="Object">
- Configure the database connection details to connect Doku with TimescaleDB (or another Postgres compatible DB).
- <Expandable title="properties">
- <ResponseField name="name" type="String">
- Database name.
- </ResponseField>
- <ResponseField name="username" type="String">
- The username for the database.
- </ResponseField>
- <ResponseField name="password" type="String">
- The password for the database.
- </ResponseField>
- <ResponseField name="host" type="String">
- Host address for the database.
- </ResponseField>
- <ResponseField name="port" type="String">
- Network port for the database connection.
- </ResponseField>
- <ResponseField name="sslMode" type="String">
- The SSL mode for the database connection (e.g., "require" if SSL is needed).
- </ResponseField>
- <ResponseField name="maxOpenConns" type="String">
- Maximum number of concurrent open database connections.
- </ResponseField>
- <ResponseField name="maxIdleConns" type="String">
- Maximum number of idle database connections.
- </ResponseField>
- <ResponseField name="dataTable" type="String">
- Name of the table to store LLM Data.
- </ResponseField>
- <ResponseField name="apiKeyTable" type="String">
- Name of the table to store API Keys.
- </ResponseField>
- </Expandable>
-
- **Example**:
- ```yaml
- dbConfig:
- name: "mydatabase"
- username: "myusername"
- password: "mypassword"
- host: "mydbhost.example.com"
- port: 5432
- sslMode: "require"
- maxOpenConns: 15
- maxIdleConns: 10
- dataTable: "llm_data"
- apiKeyTable: "api_keys"
- ```
-</ResponseField>
-
-
-### Observability Platform Configuration
-
-<ResponseField name="observabilityPlatform" type="Object">
- Choose the external platform you wish to use for exporting observability data from Doku and set `enabled` to `true`. Fill in the required fields for the chosen platform. Only one platform can be selected at a time.
-
- The following sections show example configurations for different platforms - Grafana Cloud, New Relic, and DataDog. You will need to uncomment the applicable section and provide necessary credentials such as URLs, User IDs, and API Keys corresponding to your account on the observability platform.
- <Expandable title="properties">
- <ResponseField name="enabled" type="boolean">
- Boolean parameter to configure external Observability Platform
- </ResponseField>
- <ResponseField name="grafanaCloud" type="Object">
- Configuration for connecting Doku with Grafana Cloud.
- <Expandable title="properties">
- <ResponseField name="promUrl" type="String">
- URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance.
- </ResponseField>
- <ResponseField name="promUsername" type="String">
- Prometheus User ID of the Grafana Cloud Prometheus Instance.
- </ResponseField>
- <ResponseField name="lokiUrl" type="String">
- URL of the Loki Push URL of the Grafana Cloud Loki Instance.
- </ResponseField>
- <ResponseField name="lokiUsername" type="String">
- Loki Username of the Grafana Cloud Loki Instance.
- </ResponseField>
- <ResponseField name="accessToken" type="String">
- Access Token of the Grafana Cloud Instance.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- grafanaCloud:
- promUrl: "https://your-grafana-prometheus-url"
- promUsername: "your-prom-user-id"
- lokiUrl: "https://your-grafana-loki-url"
- lokiUsername: "your-loki-user-id"
- accessToken: "your-grafana-cloud-access-token"
- ```
- </Expandable>
- </ResponseField>
- <ResponseField name="datadog" type="Object">
- Configuration for connecting Doku with DataDog.
- <Expandable title="properties">
- <ResponseField name="metricsUrl" type="String">
- URL to the DataDog Metrics API.
- </ResponseField>
- <ResponseField name="logsUrl" type="String">
- URL to the DataDog Logs API.
- </ResponseField>
- <ResponseField name="apiKey" type="String">
- API Key of the DataDog Account.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- datadog:
- metricsUrl: "https://api.datadoghq.com/api/v1/series"
- logsUrl: "https://http.logs.datadoghq.com/api/v2/logs"
- apiKey: "datadog-api-key"
- ```
- </Expandable>
- </ResponseField>
- <ResponseField name="newRelic" type="Object">
- Configuration for connecting Doku with New Relic.
- <Expandable title="properties">
- <ResponseField name="metricsUrl" type="String">
- URL to the New Relic Metric API.
- </ResponseField>
- <ResponseField name="logsUrl" type="String">
- URL to the New Relic Log API.
- </ResponseField>
- <ResponseField name="apiKey" type="String">
- Ingest API Key of the New Relic Account.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- newRelic:
- metricsUrl: "https://metric-api.newrelic.com/metric/v1"
- logsUrl: "https://log-api.newrelic.com/log/v1"
- apiKey: "newrelic-api-key"
- ```
- </Expandable>
- </ResponseField>
- </Expandable>
-</ResponseField>
-
-Ensure that the file is correctly formatted in YAML and all necessary fields are populated based on your deployment needs. Save the file and restart the Doku service to apply the new configuration.
-
-## Example Configuration File
-
-```yaml doku.yml
-ingesterPort: 9044 # Port to run the Ingestion Server on, Example: 9044
-
-# Comment out either 'localFile' or 'url' to use only one at a time.
-pricingInfo:
- # localFile:
- # path: "/assets/pricing.json" # Path to local JSON file with LLM Pricing data
- url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json" # URL to download Pricing data file
-
-# Configuration for the Doku Backend Database (TimescaleDB)
-dbConfig:
- name: "DBNAME" # Name of the database, Example: "postgres"
- username: "USERNAME" # Username to connect to the database, Example: "admin"
- password: "PASSWORD" # Password to connect to the database, Example: "DOKU"
- host: "HOSTURL" # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
-# Configure Platform to export LLM Observability Data from Doku
-# Only one platform can be enabled at a time, To enable a platform, set enabled to true and fill in the required fields for that platform.
-observabilityPlatform:
- enabled: false # Enable or Disable the Observability Platform, Example: true
- # grafanaCloud:
- # promUrl: "influx-line-proxy-url" # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance
- # promUsername: "prometheus-userid" # Prometheus User ID of the Grafana Cloud Prometheus Instance
- # lokiUrl: "loki-push-url" # URL to the Loki Push URL of the Grafana Cloud Loki Instance
- # lokiUsername: "loki-username" # Loki Username of the Grafana Cloud Loki Instance
- # accessToken: "grafana-cloud-access-token" # Access Token of the Grafana Cloud Instance
-
- # newRelic:
- # metricsUrl: "https://metric-api.newrelic.com/metric/v1" # URL to the New Relic Metric API
- # logsUrl: "https://log-api.newrelic.com/log/v1" # URL to the New Relic Log API
- # key: "newrelic-api-key" # Ingest API Key of the New Relic Account
-
- # datadog:
- # metricsUrl: "https://api.datadoghq.com/api/v1/series" # URL to the DataDog Metrics API
- # logsUrl: "https://http.logs.datadoghq.com/api/v2/logs" # URL to the DataDog Logs API
- # apiKey: "datadog-api-key" # API Key of the DataDog Account
-```
\ No newline at end of file
diff --git a/docs/0.0.2/connections/datadog.mdx b/docs/0.0.2/connections/datadog.mdx
deleted file mode 100644
index 92dffa4f..00000000
--- a/docs/0.0.2/connections/datadog.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: 'DataDog'
-description: 'Connect Doku to DataDog'
----
-
-Doku can automatically send LLM usage data from Doku to DataDog using the [Submit Metrics API](https://docs.datadoghq.com/api/latest/metrics/#submit-metrics) and [Send Logs API](https://docs.datadoghq.com/api/latest/logs/#send-logs)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- datadog:
- metricsUrl: <your-datadog-metrics-url> # URL to the DataDog Metrics API
- logsUrl: <your-datadog-logs-url> # URL to the DataDog Logs API
- apiKey: <your-datadog-api-key> # API Key of the DataDog Account
-```
\ No newline at end of file
diff --git a/docs/0.0.2/connections/grafanacloud.mdx b/docs/0.0.2/connections/grafanacloud.mdx
deleted file mode 100644
index 044bba27..00000000
--- a/docs/0.0.2/connections/grafanacloud.mdx
+++ /dev/null
@@ -1,2351 +0,0 @@
----
-title: 'Grafana Cloud'
-description: 'Connect Doku to Grafana Cloud'
----
-
-<Frame>
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-1.jpg?raw=true" />
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-2.jpg?raw=true" />
-</Frame>
-
-Doku can automatically send LLM usage data from Doku to Grafana Cloud using the [Grafana Cloud Influx Telegraf](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-influxdb/push-from-telegraf/) and [Loki Push HTTP API](https://grafana.com/docs/loki/latest/reference/api/#push-log-entries-to-loki)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- grafanaCloud:
- promUrl: <your-grafana-cloud-influx-line-proxy-url> # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance
- promUsername: <your-prometheus-userid> # Prometheus User ID of the Grafana Cloud Prometheus Instance
- lokiUrl: <your-loki-push-url> # URL to the Loki Push URL of the Grafana Cloud Loki Instance
- lokiUsername: <your-loki-username> # Loki Username of the Grafana Cloud Loki Instance
- accessToken: <your-grafana-cloud-access-token> # Access Token of the Grafana Cloud Instance
-```
-
-## Grafana Resources
-
-<Accordion title="Dashboard">
- ```json
- {
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "grafana",
- "uid": "-- Grafana --"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "id": 14,
- "links": [
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Documentation",
- "tooltip": "",
- "type": "link",
- "url": "https://docs.dokulabs.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Community",
- "tooltip": "",
- "type": "link",
- "url": "https://dokulabs.slack.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Dokulabs GitHub",
- "tooltip": "",
- "type": "link",
- "url": "https://github.com/dokulabs/"
- }
- ],
- "liveNow": false,
- "panels": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 0,
- "y": 0
- },
- "id": 23,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 2,
- "x": 11,
- "y": 0
- },
- "id": 2,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "![Doku Logo](https://github.com/dokulabs/.github/blob/main/profile/assets/favicon.png?raw=true)",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 13,
- "y": 0
- },
- "id": 22,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the total number of requests sent to Large Language Models (LLM) Platforms in the selected time interval.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 4
- },
- "id": 3,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT count(*) FROM DOKU\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "COUNT",
- "parameters": [
- {
- "name": "environment",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Requests",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average time taken to process each request by the Large Language Models (LLM), offering a snapshot of system performance and efficiency.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "s",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 6,
- "y": 4
- },
- "id": 4,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(requestduration) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "requestduration",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Request Duration",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Total tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 1000
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 10,
- "y": 4
- },
- "id": 5,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_totalTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(totaltokens) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Tokens per Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average cost incurred per request to the LLM, helping monitor and optimize budget allocation for LLM usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 14,
- "y": 4
- },
- "id": 6,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(usagecost) FROM doku \nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Cost / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the total cost on LLM requests over the selected period.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 18,
- "y": 4
- },
- "id": 10,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT SUM(usagecost) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "SUM",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Cost",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the count of API requests made to LLMs over the selected time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 54,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "smooth",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 5,
- "w": 24,
- "x": 0,
- "y": 7
- },
- "id": 17,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count(count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval]))",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "Requests",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n DATE_TRUNC('day', \"time\") AS \"time\",\n COUNT(endpoint) AS total_requests\nFROM \n doku\nWHERE\n $__timeFilter(\"time\")\nGROUP BY \n DATE_TRUNC('day', \"time\")\nORDER BY \n \"time\";",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Requests overtime",
- "transformations": [],
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel illustrates the distribution of LLM requests across different usage categories: Chat Generations, Embeddings, Image Generations, Audio Generations, and Fine Tuning. It visualizes the relative volume of requests, helping to identify which types of operations are most frequently performed and providing insights into usage patterns by category.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "blue",
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "none",
- "unitScale": true
- },
- "overrides": [
- {
- "__systemRef": "hideSeriesFrom",
- "matcher": {
- "id": "byNames",
- "options": {
- "mode": "exclude",
- "names": [
- "Value (sum)",
- "Chat"
- ],
- "prefix": "All except:",
- "readOnly": true
- }
- },
- "properties": [
- {
- "id": "custom.hideFrom",
- "value": {
- "legend": false,
- "tooltip": false,
- "viz": true
- }
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 0,
- "y": 12
- },
- "id": 12,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n category,\n CAST(COUNT(*) AS INTEGER) AS Requests,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage\n FROM \n (\n SELECT \n CASE\n WHEN endpoint LIKE 'openai.chat%' THEN 'Chat'\n WHEN endpoint LIKE 'openai.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'anthropic.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.summarize%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.generate%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.chat%' THEN 'Chat'\n WHEN endpoint LIKE '%embed%' THEN 'Embeddings'\n WHEN endpoint LIKE 'openai.images%' THEN 'Image'\n WHEN endpoint LIKE 'openai.audio%' THEN 'Audio'\n WHEN endpoint LIKE 'openai.fine_tuning%' THEN 'Fine Tuning'\n END AS category,\n endpoint\n FROM doku\n WHERE $__timeFilter(time)\n ) AS subquery\n GROUP BY category",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage by Category",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "generation": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Displays the cost breakdown by provider (OpenAI, Cohere, Anthropic) for LLM requests, offering insights into financial deployment across different services.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 6,
- "y": 12
- },
- "id": 16,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Provider",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "generation": {
- "aggregations": []
- },
- "platform": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel presents a pie chart detailing the distribution of expenses for LLM requests by various applications. It shows how budget allocations are consumed by different applications, enabling a deeper understanding of cost drivers and facilitating cost optimization efforts.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 12,
- "y": 12
- },
- "id": 24,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Application",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "applicationName": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Visualizes the allocation of LLM request expenses across different environments, such as development, staging, and production. This breakdown helps in tracking and managing costs with respect to operational environments.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 18,
- "y": 12
- },
- "id": 25,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Environment",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "applicationName": {
- "aggregations": []
- },
- "environment": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Prompt tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 21
- },
- "id": 9,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_promptTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(prompttokens) FROM doku WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Prompt Tokens / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Provides a time-series analysis of token consumption for LLM requests, highlighting trends in usage intensity and complexity over time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlYlRd"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 50,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": 86400000,
- "lineInterpolation": "smooth",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 1,
- "pointSize": 6,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 18,
- "x": 6,
- "y": 21
- },
- "id": 11,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "avg(doku_llm_completionTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"})",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "Completion Tokens",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM doku",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "builder",
- "expr": "avg(doku_llm_promptTokens)",
- "format": "time_series",
- "fullMetaSearch": false,
- "hide": false,
- "includeNullMetadata": true,
- "legendFormat": "Prompt Tokens",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM doku",
- "refId": "B",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Token usage overtime",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Completion tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 24
- },
- "id": 7,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_completionTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(completiontokens) FROM doku WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Completion Tokens / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Displays the frequency of model usage over time, identifying the most utilised models and showcasing usage trends across different periods",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "purple",
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 27
- },
- "id": 13,
- "options": {
- "displayMode": "lcd",
- "maxVizHeight": 165,
- "minVizHeight": 0,
- "minVizWidth": 75,
- "namePlacement": "left",
- "orientation": "horizontal",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "showUnfilled": true,
- "sizing": "auto",
- "valueMode": "color"
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "topk(5,count by(model) (sum_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])))",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n model,\n total_count,\n percentage_usage\nFROM \n (\n SELECT \n model,\n COUNT(*) AS total_count,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage_usage\n FROM \n doku\n WHERE $__timeFilter(time)\n GROUP BY \n model\n ORDER BY \n percentage_usage DESC\n ) sub\nLIMIT 5;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Top models by usage",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "model": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- },
- {
- "id": "sortBy",
- "options": {
- "fields": {},
- "sort": [
- {
- "desc": true,
- "field": "Value (sum)"
- }
- ]
- }
- }
- ],
- "type": "bargauge"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Breaks down token usage across different LLM models, offering insights into which models are driving the highest token consumption.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 23,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 1,
- "pointSize": 9,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 27
- },
- "id": 14,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "sum_over_time(doku_llm_totalTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "{{model}}",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n DATE_TRUNC('day', \"time\") AS \"time\",\n model,\n COUNT(*) AS \"Model:\"\nFROM \n doku\nWHERE \n $__timeFilter(\"time\")\nGROUP BY \n 1, model\nORDER BY \n \"time\" ASC, model;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Token usage by model",
- "transformations": [],
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "description": "Displays a log of all prompt messages sent to the LLM, providing insights into the inputs and interactions leading up to LLM responses.",
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 33
- },
- "id": 26,
- "options": {
- "dedupStrategy": "none",
- "enableLogDetails": true,
- "prettifyLogMessage": true,
- "showCommonLabels": false,
- "showLabels": false,
- "showTime": true,
- "sortOrder": "Descending",
- "wrapLogMessage": false
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "editorMode": "code",
- "expr": "{job=\"doku\", type=\"prompt\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "hide": false,
- "queryType": "range",
- "refId": "B"
- }
- ],
- "title": "Prompts",
- "transformations": [
- {
- "id": "extractFields",
- "options": {
- "format": "auto",
- "source": "labels"
- }
- }
- ],
- "transparent": true,
- "type": "logs"
- },
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "description": "Displays a log of all responses from the LLM, offering a comprehensive view of how the model interprets prompts and the information it generates.",
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 33
- },
- "id": 27,
- "options": {
- "dedupStrategy": "none",
- "enableLogDetails": true,
- "prettifyLogMessage": true,
- "showCommonLabels": false,
- "showLabels": false,
- "showTime": true,
- "sortOrder": "Descending",
- "wrapLogMessage": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "editorMode": "code",
- "expr": "{job=\"doku\", type=\"response\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "hide": false,
- "queryType": "range",
- "refId": "B"
- }
- ],
- "title": "Responses",
- "transformations": [
- {
- "id": "extractFields",
- "options": {
- "format": "auto",
- "source": "labels"
- }
- }
- ],
- "transparent": true,
- "type": "logs"
- }
- ],
- "refresh": "",
- "schemaVersion": 39,
- "tags": [
- "Doku",
- "OpenAI",
- "Cohere",
- "Anthropic"
- ],
- "templating": {
- "list": [
- {
- "current": {
- "selected": true,
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
- },
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "definition": "label_values(applicationName)",
- "hide": 0,
- "includeAll": true,
- "label": "Application",
- "multi": true,
- "name": "Application",
- "options": [],
- "query": {
- "qryType": 1,
- "query": "label_values(applicationName)",
- "refId": "PrometheusVariableQueryEditor-VariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": true,
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
- },
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "definition": "label_values(environment)",
- "hide": 0,
- "includeAll": true,
- "label": "Environment",
- "multi": true,
- "name": "Environment",
- "options": [],
- "query": {
- "qryType": 1,
- "query": "label_values(environment)",
- "refId": "PrometheusVariableQueryEditor-VariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- }
- ]
- },
- "time": {
- "from": "now-24h",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Doku - LLM Monitoring",
- "uid": "doku-llm-monitoring",
- "version": 1,
- "weekStart": ""
- }
- ```
-</Accordion>
-
diff --git a/docs/0.0.2/connections/grafanaoss.mdx b/docs/0.0.2/connections/grafanaoss.mdx
deleted file mode 100644
index ce236a73..00000000
--- a/docs/0.0.2/connections/grafanaoss.mdx
+++ /dev/null
@@ -1,1846 +0,0 @@
----
-title: 'Grafana OSS'
-description: 'Connect Doku to Grafana OSS'
----
-
-<Frame>
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-1.jpg?raw=true" />
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-3.jpg?raw=true" />
-</Frame>
-
-You can add the Doku's backend storage database (`TimescaleDB`) as a datasource in Grafana.
-
-## Steps
-
-1. Navigate to your Grafana Instance.
-1. Login with your credentials.
-1. Click on the **Connection** on the left sidebar to open the **Data Sources**.
-1. Click the **Add data source** button.
-1. In the search box, type "PostgreSQL" as `TimescaleDB` is an extension of PostgreSQL
-1.In the settings form, fill in the details to connect to your TimescaleDB/PostgreSQL database:
- - **Name**: Enter the name for the datasource as `Doku`.
- - **Host**: Provide the host address and port of your PostgreSQL server (e.g., `127.0.0.1`).
- - **Database**: Enter the name of the database. Default database used by Doku is `postgres`.
- - **TLS/SSL Setiing**: Enter the securtity to use for connection. Default used by Doku is `require`.
- - **User**: The username for the database. Default user used by Doku is `admin`.
- - **Password**: The password for the database. Default password used by Doku is `Doku`.
-1. Optionally customize the **Max open connections**, **Max idle connections**, and **Connection Max Lifetime**.
-1. Click the **Save & Test** button at the bottom of the page.
-
-Grafana will attempt to connect to the database using the provided settings. If everything is configured correctly, you will see a message indicating the data source is working.
-
-## Grafana Resources
-
-<Accordion title="Dashboard">
- ```json
- {
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "grafana",
- "uid": "-- Grafana --"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "id": 8,
- "links": [
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Documentation",
- "tooltip": "",
- "type": "link",
- "url": "https://grafana.com/docs/grafana/latest/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Community",
- "tooltip": "",
- "type": "link",
- "url": "https://dokulabs.slack.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Dokulabs GitHub",
- "tooltip": "",
- "type": "link",
- "url": "https://github.com/dokulabs/"
- }
- ],
- "liveNow": false,
- "panels": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 0,
- "y": 0
- },
- "id": 23,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 2,
- "x": 11,
- "y": 0
- },
- "id": 2,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "![Doku Logo](https://github.com/dokulabs/.github/blob/main/profile/assets/favicon.png?raw=true)",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 13,
- "y": 0
- },
- "id": 22,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the total number of requests sent to Large Language Models (LLM) Platforms in the selected time interval.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "yellow",
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 4
- },
- "id": 3,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT count(*) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "COUNT",
- "parameters": [
- {
- "name": "environment",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Requests",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average time taken to process each request by the Large Language Models (LLM), offering a snapshot of system performance and efficiency.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "s"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 6,
- "y": 4
- },
- "id": 4,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(requestduration) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "requestduration",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Request Duration",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Total tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 1000
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 10,
- "y": 4
- },
- "id": 5,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(totaltokens) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Tokens per Request",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average cost incurred per request to the LLM, helping monitor and optimize budget allocation for LLM usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 14,
- "y": 4
- },
- "id": 6,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(usagecost) FROM DOKU_LLM_DATA \nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Cost / Request",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the total cost on LLM requests over the selected period.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 18,
- "y": 4
- },
- "id": 10,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT SUM(usagecost) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "SUM",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Cost",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the count of API requests made to LLMs over the selected time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic-by-name"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 100,
- "gradientMode": "opacity",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 5,
- "w": 24,
- "x": 0,
- "y": 7
- },
- "id": 17,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT\n DATE_TRUNC('day', \"time\") AS \"time\",\n COUNT(endpoint) AS total_requests\nFROM \n DOKU_LLM_DATA\nWHERE\n $__timeFilter(\"time\")\nGROUP BY \n DATE_TRUNC('day', \"time\")\nORDER BY \n \"time\";",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Requests / Day",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel illustrates the distribution of LLM requests across different usage categories: Chat Generations, Embeddings, Image Generations, Audio Generations, and Fine Tuning. It visualizes the relative volume of requests, helping to identify which types of operations are most frequently performed and providing insights into usage patterns by category.\n\n",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": []
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 0,
- "y": 12
- },
- "id": 12,
- "options": {
- "displayLabels": [
- "name",
- "percent"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [],
- "fields": "/^requests$/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \n category,\n CAST(COUNT(*) AS INTEGER) AS Requests,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage\n FROM \n (\n SELECT \n CASE\n WHEN endpoint LIKE 'openai.chat%' THEN 'Chat'\n WHEN endpoint LIKE 'openai.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'anthropic.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.summarize%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.generate%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.chat%' THEN 'Chat'\n WHEN endpoint LIKE '%embed%' THEN 'Embeddings'\n WHEN endpoint LIKE 'openai.images%' THEN 'Image'\n WHEN endpoint LIKE 'openai.audio%' THEN 'Audio'\n WHEN endpoint LIKE 'openai.fine_tuning%' THEN 'Fine Tuning'\n END AS category,\n endpoint\n FROM DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n ) AS subquery\n GROUP BY category",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage by Category",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Displays the cost breakdown by provider (OpenAI, Cohere, Anthropic) for LLM requests, offering insights into financial deployment across different services.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 6,
- "y": 12
- },
- "id": 16,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n DOKU_LLM_DATA\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Provider",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel presents a pie chart detailing the distribution of expenses for LLM requests by various applications. It shows how budget allocations are consumed by different applications, enabling a deeper understanding of cost drivers and facilitating cost optimization efforts.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 12,
- "y": 12
- },
- "id": 18,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "uniqueValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": " SELECT\n applicationName,\n sum(usageCost) AS \"usageCost\"\n FROM\n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY\n applicationName\n ORDER BY\n \"usageCost\" DESC",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Application",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Visualizes the allocation of LLM request expenses across different environments, such as development, staging, and production. This breakdown helps in tracking and managing costs with respect to operational environments.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 18,
- "y": 12
- },
- "id": 19,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "uniqueValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": " SELECT\n environment,\n sum(usageCost) AS \"usageCost\"\n FROM\n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY\n environment\n ORDER BY\n \"usageCost\" DESC",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Environment",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Prompt tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 21
- },
- "id": 9,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(prompttokens) FROM DOKU_LLM_DATA WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Prompt Tokens / Request",
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Provides a time-series analysis of token consumption for LLM requests, highlighting trends in usage intensity and complexity over time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 10,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": 86400000,
- "lineInterpolation": "linear",
- "lineStyle": {
- "fill": "solid"
- },
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "never",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 18,
- "x": 6,
- "y": 21
- },
- "id": 11,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM DOKU_LLM_DATA",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Token usage",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Completion tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 24
- },
- "id": 7,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(completiontokens) FROM DOKU_LLM_DATA WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Completion Tokens / Request",
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Displays the frequency of model usage over time, identifying the most utilised models and showcasing usage trends across different periods",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "purple",
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 27
- },
- "id": 13,
- "options": {
- "displayMode": "lcd",
- "maxVizHeight": 167,
- "minVizHeight": 10,
- "minVizWidth": 75,
- "namePlacement": "top",
- "orientation": "horizontal",
- "reduceOptions": {
- "calcs": [
- "sum"
- ],
- "fields": "/^total_count$/",
- "values": true
- },
- "showUnfilled": true,
- "sizing": "manual",
- "valueMode": "text"
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \n model,\n total_count,\n percentage_usage\nFROM \n (\n SELECT \n model,\n COUNT(*) AS total_count,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage_usage\n FROM \n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY \n model\n ORDER BY \n percentage_usage DESC\n ) sub\nLIMIT 5;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Top models by usage",
- "type": "bargauge"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Breaks down token usage across different LLM models, offering insights into which models are driving the highest token consumption.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 27
- },
- "id": 14,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT \n DATE_TRUNC('day', \"time\") AS \"time\",\n model,\n COUNT(*) AS \"Model:\"\nFROM \n DOKU_LLM_DATA\nWHERE \n $__timeFilter(\"time\")\nGROUP BY \n 1, model\nORDER BY \n \"time\" ASC, model;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Model usage by day",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Table showing prompts and responses along with their associated costs and token usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic-by-name"
- },
- "custom": {
- "align": "center",
- "cellOptions": {
- "mode": "gradient",
- "type": "color-background"
- },
- "filterable": true,
- "inspect": true
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 24,
- "x": 0,
- "y": 33
- },
- "id": 15,
- "options": {
- "cellHeight": "sm",
- "footer": {
- "countRows": false,
- "fields": "",
- "reducer": [
- "sum"
- ],
- "show": false
- },
- "showHeader": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \"time\", applicationName, model, prompt, response, usageCost FROM DOKU_LLM_DATA WHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "endpoint",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "prompt",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "response",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "User Activity",
- "transparent": true,
- "type": "table"
- }
- ],
- "refresh": "",
- "schemaVersion": 39,
- "tags": [
- "Doku",
- "OpenAI",
- "Cohere",
- "Anthropic"
- ],
- "templating": {
- "list": [
- {
- "current": {
- "selected": true,
- "text": "grafana-postgresql-datasource",
- "value": "dbd38750-cf8a-4f35-a031-af943c441f1d"
- },
- "hide": 0,
- "includeAll": false,
- "label": "Datasource",
- "multi": false,
- "name": "datasource",
- "options": [],
- "query": "grafana-postgresql-datasource",
- "queryValue": "",
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "type": "datasource"
- }
- ]
- },
- "time": {
- "from": "now-7d",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Doku - LLM Monitoring",
- "uid": "doku-llm-monitoring",
- "version": 1,
- "weekStart": ""
- }
- ```
-</Accordion>
-
diff --git a/docs/0.0.2/connections/intro.mdx b/docs/0.0.2/connections/intro.mdx
deleted file mode 100644
index 178e4173..00000000
--- a/docs/0.0.2/connections/intro.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Introduction'
-description: 'Connect to your existing Observablity Platform'
----
-
-Doku streamlines the observability experience by delivering processed LLM data right to the observability platform you are already familiar with. We recognize how crucial it is for developers to aggregate all application-related data, encompassing LLM usage metrics, into a single source of truth.
-
-This integration allows you to visualize and assess your entire application landscape in one integrated Observability platform, thereby refining your monitoring approaches and sharpening your decision-making.
-
-Below is a list of observability platforms that work seamlessly with Doku, allowing for integrated and expanded insights.
-
-<CardGroup cols={2}>
- <Card title="Grafana OSS" href="/0.0.2/connections/grafanaoss" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
- </Card>
- <Card title="Grafana Cloud" href="/0.0.2/connections/grafanacloud" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
- </Card>
- <Card title="DataDog" href="/0.0.2/connections/datadog" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Datadog</title><path d="M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"/></svg>}>
- </Card>
- <Card title="New Relic" href="/0.0.2/connections/new-relic" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>New Relic</title><path d="M8.0015 14.3091v7.384L12.0008 24V12.0008L1.6078 5.9996v4.6167ZM12.0008 0 2.8232 5.2976 6.8209 7.606l5.1799-2.9893 6.3936 3.6913v7.384l-5.1783 2.9908v4.6167l9.176-5.2991V5.9996Z"/></svg>}>
- </Card>
-</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/connections/new-relic.mdx b/docs/0.0.2/connections/new-relic.mdx
deleted file mode 100644
index 391c8b9c..00000000
--- a/docs/0.0.2/connections/new-relic.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: 'New Relic'
-description: 'Connect Doku to New Relic'
----
-
-Doku can automatically send LLM usage data from Doku to New Relic using the [Report Metrics HTTP API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/report-metrics-metric-api/) and [Send Logs API](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api/)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- newRelic:
- metricsUrl: <your-new-relic-metrics-url> # URL to the New Relic Metric API
- logsUrl: <your-new-relic-logs-url> # URL to the New Relic Log API
- key: <your-new-relic-api-key> # Ingest API Key of the New Relic Account
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/introduction.mdx b/docs/0.0.2/dokumetry/introduction.mdx
deleted file mode 100644
index 248e7bc4..00000000
--- a/docs/0.0.2/dokumetry/introduction.mdx
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: 'Overview'
-description: 'Seamlessly send LLM usage data to Doku'
----
-
-[DokuMetry SDK](https://www.npmjs.com/package/dokumetry) (`dokumetry`) empowers you to effortlessly track and monitor language learning model (LLM) usage data and metrics from your Python/NodeJS code. It seamlessly integrates with major LLM Platforms:
-
-
-DokuMetry SDKs can currently track and monitor API usage for the below platforms
-<CardGroup cols={3}>
- <Card
- title="OpenAI"
- icon={
- <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>OpenAI</title>
- <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Cohere"
- icon={
- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">
- <g>
- <g>
- <g>
- <path d="M24.3,44.7c2,0,6-0.1,11.6-2.4c6.5-2.7,19.3-7.5,28.6-12.5c6.5-3.5,9.3-8.1,9.3-14.3C73.8,7,66.9,0,58.3,0
- h-36C10,0,0,10,0,22.3S9.4,44.7,24.3,44.7z">
- </path>
- <path d="M30.4,60c0-6,3.6-11.5,9.2-13.8l11.3-4.7C62.4,36.8,75,45.2,75,57.6C75,67.2,67.2,75,57.6,75l-12.3,0
- C37.1,75,30.4,68.3,30.4,60z">
- </path>
- <path d="M12.9,47.6L12.9,47.6C5.8,47.6,0,53.4,0,60.5v1.7C0,69.2,5.8,75,12.9,75h0c7.1,0,12.9-5.8,12.9-12.9v-1.7
- C25.7,53.4,20,47.6,12.9,47.6z">
- </path>
- </g>
- </g>
- </g>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Anthropic"
- icon={
- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">
- <path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path>
- <path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
-</CardGroup>
-
-All LLM observability data collected by DokuMetry is sent directly to the Doku Platform for streamlined tracking.
-
-## Features
-
-- **Effortless Setup:** Integrate full-featured LLM usage monitoring into your application with just two lines of code.
-- **Efficient Performance:** Designed for near-zero latency impact, allowing your applications to run smoothly without compromise.
-- **Secure and Reliable**: DokuMetry SDKs prioritize the safety and integrity of your data. All data transmission to Doku is conducted over secure HTTP, ensuring that your observability data is protected during transit.
-
-## Supported Languages
-
-<CardGroup cols={2}>
-<Card title="Python" href="/0.0.2/dokumetry/python" icon="python">
-</Card>
-<Card title="NodeJS" href="/0.0.2/dokumetry/node" icon="node-js">
-</Card>
-</CardGroup>
diff --git a/docs/0.0.2/dokumetry/node/examples/anthropic/anthropic-completions.mdx b/docs/0.0.2/dokumetry/node/examples/anthropic/anthropic-completions.mdx
deleted file mode 100644
index 6fbff10e..00000000
--- a/docs/0.0.2/dokumetry/node/examples/anthropic/anthropic-completions.mdx
+++ /dev/null
@@ -1,29 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor Anthropic Completions API Usage'
----
-
-## Completions
-
-```javascript
-import Anthropic from '@anthropic-ai/sdk';
-import DokuMetry from 'dokumetry';
-
-const anthropic = new Anthropic({
- apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]
-});
-
-// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await anthropic.completions.create({
- model: 'claude-2',
- max_tokens_to_sample: 300,
- prompt: `${Anthropic.HUMAN_PROMPT} Hello, Claude{Anthropic.AI_PROMPT}`,
- });
- console.log(completion.completion);
-}
-main().catch(console.error);
-```
-
diff --git a/docs/0.0.2/dokumetry/node/examples/cohere/chat.mdx b/docs/0.0.2/dokumetry/node/examples/cohere/chat.mdx
deleted file mode 100644
index fdc6a559..00000000
--- a/docs/0.0.2/dokumetry/node/examples/cohere/chat.mdx
+++ /dev/null
@@ -1,60 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor Cohere Chat API usage'
----
-
-## Chat
-<CodeGroup>
-
-```javascript No Streaming
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const response = await cohere.chat({
- message: 'Say this is a test',
- model: 'command',
- });
-
- console.log(response)
-})();
-```
-
-```javascript Streaming
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const chatStream = await cohere.chatStream({
- chatHistory: [
- { role: "USER", message: "Who discovered gravity?" },
- { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }
- ],
- message: "What year was he born?",
- // perform web search before answering the question. You can also use your own custom connector.
- connectors: [{ id: "web-search" }],
- });
-
- for await (const message of chatStream) {
- if (message.eventType === "text-generation") {
- console.log(message);
- }
- }
-})();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/examples/cohere/embed.mdx b/docs/0.0.2/dokumetry/node/examples/cohere/embed.mdx
deleted file mode 100644
index e11ba206..00000000
--- a/docs/0.0.2/dokumetry/node/examples/cohere/embed.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: 'Embed'
-description: 'Monitor Cohere Embed API usage'
----
-
-## Embed
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const embed = await cohere.embed({
- texts: ["hello", "goodbye"],
- model: "embed-english-v3.0",
- inputType: "classification",
- });
- console.log(embed);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/examples/cohere/generate.mdx b/docs/0.0.2/dokumetry/node/examples/cohere/generate.mdx
deleted file mode 100644
index b48cdd1c..00000000
--- a/docs/0.0.2/dokumetry/node/examples/cohere/generate.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 'Generate'
-description: 'Monitor Cohere Generate API usage'
----
-
-## Generate
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const generate = await cohere.generate({
- prompt: "Please explain to me how LLMs work",
- });
-
- console.log(generate);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/examples/cohere/summarize.mdx b/docs/0.0.2/dokumetry/node/examples/cohere/summarize.mdx
deleted file mode 100644
index 32cfd261..00000000
--- a/docs/0.0.2/dokumetry/node/examples/cohere/summarize.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'Summarize'
-description: 'Monitor Cohere Summarize API usage'
----
-
-## Summarize
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const summarize = await cohere.summarize({
- text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
- + "It may be made from milk or cream and is flavoured with a sweetener, "
- + "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
- + "or with fruit such as strawberries or peaches. "
- + "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
- + "Food coloring is sometimes added, in addition to stabilizers. "
- + "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
- + "and to prevent detectable ice crystals from forming. The result is a smooth, "
- + "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
- + "It becomes more malleable as its temperature increases.\n\n"
- + "The meaning of the name \"ice cream\" varies from one country to another. "
- + "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
- + "and most governments regulate the commercial use of the various terms according to the "
- + "relative quantities of the main ingredients, notably the amount of cream. "
- + "Products that do not meet the criteria to be called ice cream are sometimes labelled "
- + "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
- + "one word is used fo\r all variants. Analogues made from dairy alternatives, "
- + "such as goat's or sheep's milk, or milk substitutes "
- + "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
- + "lactose intolerant, allergic to dairy protein or vegan.",
- });
-
- console.log(summarize);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/examples/openai/audio.mdx b/docs/0.0.2/dokumetry/node/examples/openai/audio.mdx
deleted file mode 100644
index cd5c1107..00000000
--- a/docs/0.0.2/dokumetry/node/examples/openai/audio.mdx
+++ /dev/null
@@ -1,32 +0,0 @@
----
-title: 'Audio'
-description: 'Monitor OpenAI Audio API usage'
----
-
-## Create Speech
-
-```javascript
-import fs from "fs";
-import path from "path";
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-const speechFile = path.resolve("./speech.mp3");
-
-async function main() {
- const mp3 = await openai.audio.speech.create({
- model: "tts-1",
- voice: "alloy",
- input: "Today is a wonderful day to build something people love!",
- });
- console.log(speechFile);
- const buffer = Buffer.from(await mp3.arrayBuffer());
- await fs.promises.writeFile(speechFile, buffer);
-}
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/examples/openai/chat.mdx b/docs/0.0.2/dokumetry/node/examples/openai/chat.mdx
deleted file mode 100644
index 4400245f..00000000
--- a/docs/0.0.2/dokumetry/node/examples/openai/chat.mdx
+++ /dev/null
@@ -1,157 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor OpenAI Chat Completions API usage'
----
-
-## Chat Completions
-
-<CodeGroup>
-
-```javascript Default
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- messages: [{ role: "system", content: "You are a helpful assistant." }],
- model: "gpt-3.5-turbo",
- });
-
- console.log(completion.choices[0]);
-}
-
-main();
-```
-
-```javascript Image Input
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const response = await openai.chat.completions.create({
- model: "gpt-4-vision-preview",
- messages: [
- {
- role: "user",
- content: [
- { type: "text", text: "What’s in this image?" },
- {
- type: "image_url",
- image_url:
- "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
- },
- ],
- },
- ],
- });
- console.log(response.choices[0]);
-}
-main();
-```
-
-```javascript Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- model: "gpt-3.5-turbo",
- messages: [
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- stream: true,
- });
-
- for await (const chunk of completion) {
- console.log(chunk.choices[0].delta.content);
- }
-}
-
-main();
-```
-
-```javascript Functions
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];
- const tools = [
- {
- "type": "function",
- "function": {
- "name": "get_current_weather",
- "description": "Get the current weather in a given location",
- "parameters": {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and state, e.g. San Francisco, CA",
- },
- "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
- },
- "required": ["location"],
- },
- }
- }
- ];
-
- const response = await openai.chat.completions.create({
- model: "gpt-3.5-turbo",
- messages: messages,
- tools: tools,
- tool_choice: "auto",
- });
-
- console.log(response);
-}
-
-main();
-```
-
-```javascript LogProbs
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- messages: [{ role: "user", content: "Hello!" }],
- model: "gpt-3.5-turbo",
- logprobs: true,
- top_logprobs: 2,
- });
-
- console.log(completion.choices[0]);
-}
-
-main();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/examples/openai/chatCompletions.mdx b/docs/0.0.2/dokumetry/node/examples/openai/chatCompletions.mdx
deleted file mode 100644
index 3d7ea2d3..00000000
--- a/docs/0.0.2/dokumetry/node/examples/openai/chatCompletions.mdx
+++ /dev/null
@@ -1,53 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor OpenAI Completions API Usage'
----
-
-## Completions
-<CodeGroup>
-```javascript No Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.completions.create({
- model: "gpt-3.5-turbo-instruct",
- prompt: "Say this is a test.",
- max_tokens: 7,
- temperature: 0,
- });
-
- console.log(completion);
-}
-main();
-```
-
-```javascript Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const stream = await openai.completions.create({
- model: "gpt-3.5-turbo-instruct",
- prompt: "Say this is a test.",
- stream: true,
- });
-
- for await (const chunk of stream) {
- console.log(chunk.choices[0].text)
- }
-}
-main();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/examples/openai/embeddings.mdx b/docs/0.0.2/dokumetry/node/examples/openai/embeddings.mdx
deleted file mode 100644
index 7ecf6b51..00000000
--- a/docs/0.0.2/dokumetry/node/examples/openai/embeddings.mdx
+++ /dev/null
@@ -1,28 +0,0 @@
----
-title: 'Embeddings'
-description: 'Monitor OpenAI Embeddings API usage'
----
-
-## Create Embeddings
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const embedding = await openai.embeddings.create({
- model: "text-embedding-ada-002",
- input: "The quick brown fox jumped over the lazy dog",
- encoding_format: "float",
- });
-
- console.log(embedding);
-}
-
-main();
-```
diff --git a/docs/0.0.2/dokumetry/node/examples/openai/fine-tuning.mdx b/docs/0.0.2/dokumetry/node/examples/openai/fine-tuning.mdx
deleted file mode 100644
index 513a8575..00000000
--- a/docs/0.0.2/dokumetry/node/examples/openai/fine-tuning.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 'Fine Tuning'
-description: 'Monitor OpenAI Fine Tuning API usage'
----
-
-## Create Fine Tuning Job
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const fineTune = await openai.fineTuning.jobs.create({
- training_file: "file-abc123"
- });
-
- console.log(fineTune);
-}
-
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/examples/openai/image.mdx b/docs/0.0.2/dokumetry/node/examples/openai/image.mdx
deleted file mode 100644
index 06b196ab..00000000
--- a/docs/0.0.2/dokumetry/node/examples/openai/image.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: 'Image'
-description: 'Monitor OpenAI Image API usage'
----
-
-## Create Image
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });
-
- console.log(image.data);
-}
-main();
-```
-
-## Create Image Variation
-```javascript
-import fs from "fs";
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const image = await openai.images.createVariation({
- image: fs.createReadStream("otter.png"),
- });
-
- console.log(image.data);
-}
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/node/introduction.mdx b/docs/0.0.2/dokumetry/node/introduction.mdx
deleted file mode 100644
index 92984a8d..00000000
--- a/docs/0.0.2/dokumetry/node/introduction.mdx
+++ /dev/null
@@ -1,125 +0,0 @@
----
-title: 'Introduction'
-description: 'Monitor your NodeJS LLM Application with DokuMetry'
----
-
-DokuMetry Node SDK is the official library from Doku to send LLM usage data from your NodeJS application to Doku.
-
-## Installation
-``` shell shell
-npm install dokumetry
-```
-
-## Usage
-
-### OpenAI
-
-```javascript openai.js
-import OpenAI from 'openai';
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI({
- apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]
-});
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const chatCompletion = await openai.chat.completions.create({
- messages: [{ role: 'user', content: 'What are the key to effective observability?' }],
- model: 'gpt-3.5-turbo',
- });
-}
-
-main();
-```
-
-The following OpenAI Endpoints are supported for monitoring with DokuMetry
-
-- [Chat completions](/0.0.2/dokumetry/node/examples/openai/chat)
-- [Image Create](/0.0.2/dokumetry/node/examples/openai/image#create-image) and [Image Variations](/0.0.2/dokumetry/node/examples/openai/image#create-image-variation)
-- [Audio Speech Create](/0.0.2/dokumetry/node/examples/openai/audio)
-- [Embeddings](/0.0.2/dokumetry/node/examples/openai/embeddings)
-- [Fine Tunings](/0.0.2/dokumetry/node/examples/openai/fine-tuning)
-- [Completions](/0.0.2/dokumetry/node/examples/openai/chatCompletions)
-
-### Cohere
-
-```javascript cohere.js
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- apiKey: "YOUR_API_KEY",
-});
-
-// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-(async () => {
- const prediction = await cohere.generate({
- prompt: "hello",
- maxTokens: 10,
- });
-
- console.log("Received prediction", prediction);
-})();
-```
-
-The following Cohere Endpoints are supported for monitoring with DokuMetry
-
-- [Chat](/0.0.2/dokumetry/node/examples/cohere/chat)
-- [Generate](/0.0.2/dokumetry/node/examples/cohere/generate)
-- [Summarize](/0.0.2/dokumetry/node/examples/cohere/summarize)
-- [Embed](/0.0.2/dokumetry/node/examples/cohere/embed)
-
-### Anthropic
-
-```javascript anthropic.js
-import Anthropic from '@anthropic-ai/sdk';
-import DokuMetry from 'dokumetry';
-
-const anthropic = new Anthropic({
- apiKey: 'my api key', // defaults to process.env["ANTHROPIC_API_KEY"]
-});
-
-// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await anthropic.completions.create({
- model: 'claude-2',
- max_tokens_to_sample: 300,
- prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,
- });
-}
-
-main();
-```
-
-The following Anthropic Endpoints are supported for monitoring with DokuMetry
-
-- [Completions](/0.0.2/dokumetry/node/examples/anthropic/anthropic-completions)
-
-## Parameters
-
-| Parameter | Description | Required |
-|-------------------|-----------------------------------------------------------|---------------|
-| llm | Language Learning Model (LLM) Object to track | Yes |
-| dokuUrl | URL of your Doku Instance | Yes |
-| apiKey | Your Doku API key | Yes |
-| environment | Custom environment tag to include in your metrics | Optional |
-| applicationName | Custom application name tag for your metrics | Optional |
-| skipResp | Skip response from the Doku Ingester for faster execution | Optional |
-
-## Advanced Usage
-When using DokuMetry in Production environments, It is recommened to set `skipResp: True` for faster porcessing.
-
-To filter your LLM Usage according application or the environment, set the `application` and `environment` parameters with the actual values.
-
-
-## Requirements
-NodeJS >= 18.0 is supported.
-
-If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/anthropic/anthropic-completions.mdx b/docs/0.0.2/dokumetry/python/examples/anthropic/anthropic-completions.mdx
deleted file mode 100644
index b2ea104b..00000000
--- a/docs/0.0.2/dokumetry/python/examples/anthropic/anthropic-completions.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor Anthropic Completions API Usage'
----
-
-## Completions
-
-```javascript
-from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
-import dokumetry
-
-anthropic = Anthropic(
- # defaults to os.environ.get("ANTHROPIC_API_KEY")
- api_key="my_api_key",
-)
-
-# Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = anthropic.completions.create(
- model="claude-2",
- max_tokens_to_sample=300,
- prompt=f"{HUMAN_PROMPT} Hello, Claude{AI_PROMPT}",
-)
-print(completion.completion)
-```
-
diff --git a/docs/0.0.2/dokumetry/python/examples/cohere/chat.mdx b/docs/0.0.2/dokumetry/python/examples/cohere/chat.mdx
deleted file mode 100644
index d8f8fb92..00000000
--- a/docs/0.0.2/dokumetry/python/examples/cohere/chat.mdx
+++ /dev/null
@@ -1,52 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor Cohere Chat API usage'
----
-
-## Chat
-<CodeGroup>
-
-```python No Streaming
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.chat(
- chat_history=[
- {"role": "USER", "message": "Who discovered gravity?"},
- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
- ],
- message="What year was he born?",
- # perform web search before answering the question. You can also use your own custom connector.
- connectors=[{"id": "web-search"}]
-)
-print(response)
-```
-
-```python Streaming
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.chat(
- chat_history=[
- {"role": "USER", "message": "Who discovered gravity?"},
- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
- ],
- message="What year was he born?",
- stream=True,
- # perform web search before answering the question. You can also use your own custom connector.
- connectors=[{"id": "web-search"}]
-)
-print(response)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/cohere/co-summarize.mdx b/docs/0.0.2/dokumetry/python/examples/cohere/co-summarize.mdx
deleted file mode 100644
index c9bfcc05..00000000
--- a/docs/0.0.2/dokumetry/python/examples/cohere/co-summarize.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: 'Summarize'
-description: 'Monitor Cohere Summarize API usage'
----
-
-## Summarize
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-text=(
- "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
- "It may be made from milk or cream and is flavoured with a sweetener, "
- "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
- "or with fruit such as strawberries or peaches. "
- "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
- "Food coloring is sometimes added, in addition to stabilizers. "
- "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
- "and to prevent detectable ice crystals from forming. The result is a smooth, "
- "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
- "It becomes more malleable as its temperature increases.\n\n"
- "The meaning of the name \"ice cream\" varies from one country to another. "
- "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
- "and most governments regulate the commercial use of the various terms according to the "
- "relative quantities of the main ingredients, notably the amount of cream. "
- "Products that do not meet the criteria to be called ice cream are sometimes labelled "
- "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
- "one word is used fo\r all variants. Analogues made from dairy alternatives, "
- "such as goat's or sheep's milk, or milk substitutes "
- "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
- "lactose intolerant, allergic to dairy protein or vegan."
-)
-
-response = co.summarize(
- text=text,
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/cohere/embed.mdx b/docs/0.0.2/dokumetry/python/examples/cohere/embed.mdx
deleted file mode 100644
index 05900ae2..00000000
--- a/docs/0.0.2/dokumetry/python/examples/cohere/embed.mdx
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: 'Embed'
-description: 'Monitor Cohere Embed API usage'
----
-
-## Embed
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.embed(
- texts=['hello', 'goodbye'],
- model='embed-english-v3.0',
- input_type='classification'
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/cohere/generate.mdx b/docs/0.0.2/dokumetry/python/examples/cohere/generate.mdx
deleted file mode 100644
index b137a0c9..00000000
--- a/docs/0.0.2/dokumetry/python/examples/cohere/generate.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Generate'
-description: 'Monitor Cohere Generate API usage'
----
-
-## Generate
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.generate(
- prompt='Please explain to me how LLMs work',
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/openai/audio.mdx b/docs/0.0.2/dokumetry/python/examples/openai/audio.mdx
deleted file mode 100644
index c927bb36..00000000
--- a/docs/0.0.2/dokumetry/python/examples/openai/audio.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: 'Audio'
-description: 'Monitor OpenAI Audio API usage'
----
-
-## Create Speech
-
-```python
-from pathlib import Path
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-speech_file_path = Path(__file__).parent / "speech.mp3"
-response = client.audio.speech.create(
- model="tts-1",
- voice="alloy",
- input="The quick brown fox jumped over the lazy dog."
-)
-response.stream_to_file(speech_file_path)
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/openai/chat.mdx b/docs/0.0.2/dokumetry/python/examples/openai/chat.mdx
deleted file mode 100644
index 5c97d068..00000000
--- a/docs/0.0.2/dokumetry/python/examples/openai/chat.mdx
+++ /dev/null
@@ -1,143 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor OpenAI Chat Completions API usage'
----
-
-## Chat Completions
-
-<CodeGroup>
-
-```python Default
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ]
-)
-
-print(completion.choices[0].message)
-```
-
-```python Image Input
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = client.chat.completions.create(
- model="gpt-4-vision-preview",
- messages=[
- {
- "role": "user",
- "content": [
- {"type": "text", "text": "What’s in this image?"},
- {
- "type": "image_url",
- "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
- },
- ],
- }
- ],
- max_tokens=300,
-)
-
-print(response.choices[0])
-```
-
-```python Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- stream=True
-)
-
-for chunk in completion:
- print(chunk.choices[0].delta)
-```
-
-```python Functions
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-tools = [
- {
- "type": "function",
- "function": {
- "name": "get_current_weather",
- "description": "Get the current weather in a given location",
- "parameters": {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and state, e.g. San Francisco, CA",
- },
- "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
- },
- "required": ["location"],
- },
- }
- }
-]
-messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=messages,
- tools=tools,
- tool_choice="auto"
-)
-
-print(completion)
-```
-
-```python LogProbs
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "user", "content": "Hello!"}
- ],
- logprobs=True,
- top_logprobs=2
-)
-
-print(completion.choices[0].message)
-print(completion.choices[0].logprobs)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/openai/completions.mdx b/docs/0.0.2/dokumetry/python/examples/openai/completions.mdx
deleted file mode 100644
index ab3beb87..00000000
--- a/docs/0.0.2/dokumetry/python/examples/openai/completions.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor OpenAI Completions API Usage'
----
-
-## Completions
-<CodeGroup>
-```python No Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.completions.create(
- model="gpt-3.5-turbo-instruct",
- prompt="Say this is a test",
- max_tokens=7,
- temperature=0
-)
-```
-
-```python Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-for chunk in client.completions.create(
- model="gpt-3.5-turbo-instruct",
- prompt="Say this is a test",
- max_tokens=7,
- temperature=0,
- stream=True
-):
-
-print(chunk.choices[0].text)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/openai/embeddings.mdx b/docs/0.0.2/dokumetry/python/examples/openai/embeddings.mdx
deleted file mode 100644
index 6c22743a..00000000
--- a/docs/0.0.2/dokumetry/python/examples/openai/embeddings.mdx
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: 'Embeddings'
-description: 'Monitor OpenAI Embeddings API usage'
----
-
-## Create Embeddings
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.embeddings.create(
- model="text-embedding-ada-002",
- input="The food was delicious and the waiter...",
- encoding_format="float"
-)
-```
diff --git a/docs/0.0.2/dokumetry/python/examples/openai/fine-tuning.mdx b/docs/0.0.2/dokumetry/python/examples/openai/fine-tuning.mdx
deleted file mode 100644
index 4de9f9c7..00000000
--- a/docs/0.0.2/dokumetry/python/examples/openai/fine-tuning.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Fine Tuning'
-description: 'Monitor OpenAI Fine Tuning API usage'
----
-
-## Create Fine Tuning Job
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.fine_tuning.jobs.create(
- training_file="file-abc123",
- model="gpt-3.5-turbo"
-)
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/examples/openai/image.mdx b/docs/0.0.2/dokumetry/python/examples/openai/image.mdx
deleted file mode 100644
index 87df73ea..00000000
--- a/docs/0.0.2/dokumetry/python/examples/openai/image.mdx
+++ /dev/null
@@ -1,40 +0,0 @@
----
-title: 'Image'
-description: 'Monitor OpenAI Image API usage'
----
-
-## Create Image
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.images.generate(
- model="dall-e-3",
- prompt="A cute baby sea otter",
- n=1,
- size="1024x1024"
-)
-```
-
-## Create Image Variation
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = client.images.create_variation(
- image=open("image_edit_original.png", "rb"),
- n=2,
- size="1024x1024"
-)
-```
\ No newline at end of file
diff --git a/docs/0.0.2/dokumetry/python/introduction.mdx b/docs/0.0.2/dokumetry/python/introduction.mdx
deleted file mode 100644
index 92e19a8c..00000000
--- a/docs/0.0.2/dokumetry/python/introduction.mdx
+++ /dev/null
@@ -1,119 +0,0 @@
----
-title: 'Introduction'
-description: 'Monitor your Python LLM Application with DokuMetry'
----
-
-DokuMetry Python SDK is the official library from Doku to send LLM usage data from your Python application to Doku.
-
-## Installation
-``` shell shell
-pip install dokumetry
-```
-
-## Usage
-
-### OpenAI
-
-``` python openai.py
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI(
- api_key="YOUR_OPENAI_KEY"
-)
-
-# Pass the above `client` object along with your Doku URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-chat_completion = client.chat.completions.create(
- messages=[
- {
- "role": "user",
- "content": "What is LLM Observability",
- }
- ],
- model="gpt-3.5-turbo",
-)
-```
-
-The following OpenAI Endpoints are supported for monitoring with DokuMetry
-
-- [Chat completions](/0.0.2/dokumetry/python/examples/openai/chat)
-- [Image Create](/0.0.2/dokumetry/python/examples/openai/image#create-image) and [Image Variations](/0.0.2/dokumetry/python/examples/openai/image#create-image-variation)
-- [Audio Speech Create](/0.0.2/dokumetry/python/examples/openai/audio)
-- [Embeddings](/0.0.2/dokumetry/python/examples/openai/embeddings)
-- [Fine Tunings](/0.0.2/dokumetry/python/examples/openai/fine-tuning)
-- [Completions](/0.0.2/dokumetry/python/examples/openai/completions)
-
-### Cohere
-
-```python cohere.py
-import cohere
-import dokumetry
-
-# initialize the Cohere Client with an API Key
-co = cohere.Client('YOUR_API_KEY')
-
-# Pass the above `co` object along with your Doku URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-# generate a prediction for a prompt
-prediction = co.chat(message='What is LLM Observability?', model='command')
-
-# print the predicted text
-print(f'Chatbot: {prediction.text}')
-```
-
-The following Cohere Endpoints are supported for monitoring with DokuMetry
-
-- [Chat](/0.0.2/dokumetry/python/examples/cohere/chat)
-- [Generate](/0.0.2/dokumetry/python/examples/cohere/generate)
-- [Summarize](/0.0.2/dokumetry/python/examples/cohere/co-summarize)
-- [Embed](/0.0.2/dokumetry/python/examples/cohere/embed)
-
-### Anthropic
-
-```python anthropic.py
-from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
-import dokumetry
-
-anthropic = Anthropic(
- # defaults to os.environ.get("ANTHROPIC_API_KEY")
- api_key="my api key",
-)
-
-# Pass the above `anthropic` object along with your Doku URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = anthropic.completions.create(
- model="claude-2",
- max_tokens_to_sample=300,
- prompt=f"{HUMAN_PROMPT} What is LLM Observability?{AI_PROMPT}",
-)
-print(completion.completion)
-```
-
-The following Anthropic Endpoints are supported for monitoring with DokuMetry
-
-- [Completions](/0.0.2/dokumetry/python/examples/anthropic/anthropic-completions.mdx)
-
-## Parameters
-
-| Parameter | Description | Required |
-|-------------------|-----------------------------------------------------------|---------------|
-| llm | Language Learning Model (LLM) Object to track | Yes |
-| doku_url | URL of your Doku Instance | Yes |
-| api_key | Your Doku API key | Yes |
-| environment | Custom environment tag to include in your metrics | Optional |
-| application_name | Custom application name tag for your metrics | Optional |
-| skip_resp | Skip response from the Doku Ingester for faster execution | Optional |
-
-## Advanced Usage
-When using DokuMetry in Production environments, It is recommened to set `skip_resp = true` for faster porcessing.
-
-To filter your LLM Usage according application or the environment, set the `application` and `environment` paramaters with the actual values.
-
-## Requirements
-Python >= 3.7 is supported.
-
-If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).
\ No newline at end of file
diff --git a/docs/0.0.2/installation.mdx b/docs/0.0.2/installation.mdx
deleted file mode 100644
index dd60a6bb..00000000
--- a/docs/0.0.2/installation.mdx
+++ /dev/null
@@ -1,273 +0,0 @@
----
-title: 'Installing Doku'
-description: 'Deploy Doku in your preferred environment'
-icon: 'circle-down'
----
-
-Doku flexibly adapts to your preferred environment. Select a deployment method that best fits your setup:
-
-<CardGroup cols={2}>
- <Card
- title="Kubernetes"
- icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>Kubernetes</title>
- <path fill="#FFA500" d="M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"/></svg>}
- href="/0.0.2/installation#kubernetes"
- >
- Deploy Doku in a Kubernetes Cluster using Helm
- </Card>
- <Card
- title="Docker"
- icon="docker"
- href="/0.0.2/installation#docker"
- >
- Deploy Doku using docker compose
- </Card>
- <Card
- title="Linux"
- icon="linux"
- href="/0.0.2/installation#linux"
- >
- Deploy Doku in a Linux Host
- </Card>
- <Card
- title="Windows"
- icon="windows"
- href="/0.0.2/installation#windows"
- >
- Deploy Doku in a Windows Host
- </Card>
-</CardGroup>
-
-## Kubernetes
-
-Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://github.com/dokulabs/helm/tree/main/charts/doku) for a reliable and scalable solution.
-<Steps>
- <Step title="Helm Repo Setup">
- ```shell shell
- helm repo add dokulabs https://dokulabs.github.io/helm/
- helm repo update
- ```
- </Step>
- <Step title="Installing the Helm Chart">
- ```shell shell
- helm install doku dokulabs/doku --version 0.0.8
- ```
- </Step>
-</Steps>
-<Info>As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [values.yaml](https://github.com/dokulabs/helm/blob/main/charts/doku/values.yaml) file. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.</Info>
-
-## Docker
-Quickly spin up Doku using Docker for a fast and straightforward setup.
-
-<Steps>
- <Step title="Install TimescaleDB">
- <Steps>
- <Step title="Pull TimescaleDB Image">
- ```shell
- docker pull timescale/timescaledb-ha:pg14-ts2.14
- ```
- </Step>
- <Step title="Run TimescaleDB Image">
- ```shell
- docker run -d --name timescaledb -p 127.0.0.1:5432:5432 \
- -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg14-ts2.14
- ```
- </Step>
- </Steps>
- </Step>
- <Step title="Install Doku">
- <Steps>
- <Step title="Pull Doku Image">
- ```shell
- docker pull ghcr.io/dokulabs/doku-ingester:0.0.2
- ```
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.2/configure#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Run the Doku Image">
- ```shell
- docker run -d --name doku -p 127.0.0.2:9044:9044 -v /doku.yml:/doku.yml dokulabs/ingester:0.0.2 --config /doku.yml
- ```
- </Step>
- </Steps>
- </Step>
-</Steps>
-
-## Linux
-<Steps>
- <Step title="Install TimescaleDB">
- Follow the Instructions [here](https://docs.timescale.com/self-hosted/latest/install/installation-linux/#installing-self-hosted-timescaledb-on-debian-based-systems) to install TimescaleDB in your Linux host.
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.2/configure#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Install Doku in a linux Host">
- <Tabs>
- <Tab title="Linux">
- <CodeGroup>
- ```shell amd64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.2/ingester-linux-amd64
- chmod +x ingester-linux-amd64
- ./ingester-linux-amd64 --config doku.yml
- ```
-
- ```shell arm64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.2/ingester-linux-arm64
- chmod +x ingester-linux-arm64
- ./ingester-linux-arm64 --config doku.yml
- ```
-
- ```shell arm
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.2/ingester-linux-arm
- chmod +x ingester-linux-arm
- ./ingester-linux-arm --config doku.yml
- ```
-
- ```shell ppc64le
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.2/ingester-linux-ppc64le
- chmod +x ingester-linux-ppc64le
- ./ingester-linux-ppc64le --config doku.yml
- ```
- </CodeGroup>
- </Tab>
- <Tab title="Darwin">
- <CodeGroup>
- ```shell amd64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.2/ingester-darwin-amd64
- chmod +x ingester-darwin-amd64
- ./ingester-darwin-amd64 --config doku.yml
- ```
-
- ```shell arm64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.2/ingester-darwin-arm64
- chmod +x ingester-darwin-arm64
- ./ingester-darwin-arm64 --config doku.yml
- ```
- </CodeGroup>
- </Tab>
- </Tabs>
- </Step>
-</Steps>
-
-## Windows
-<Steps>
- <Step title="Install TimescaleDB">
- <Steps>
- Download and install the Visual C++ Redistributable for Visual Studio from [www.microsoft.com](https://www.microsoft.com/en-us/download/details.aspx?id=48145).
-
- Download and install PostgreSQL from [www.postgresql.org](https://www.postgresql.org/download/windows/). You might need to add the `pg_config` file location to your path. In the Windows Search tool, search for `system environment variables`. The path should be `C:\Program Files\PostgreSQL\<version>\bin`.
-
- Download the TimescaleDB installation `.zip` file from [Windows releases](https://docs.timescale.com/self-hosted/latest/install/installation-windows/#windows-releases).
-
- Locate the downloaded file on your local file system, and extract the files.
-
- In the extracted TimescaleDB directory, right-click the `setup.exe` file and select `Run as Administrator` to start the installer.
- </Steps>
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.2/configure#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Install Doku in a Windows Host">
- <CodeGroup>
- ```shell amd64
- invoke-WebRequest -Uri "https://github.com/dokulabs/doku/releases/download/0.0.2/ingester-windows-amd64" -OutFile "ingester.exe"
- .\ingester.exe --config doku.yml
- ```
-
- ```shell 386
- invoke-WebRequest -Uri "https://github.com/dokulabs/doku/releases/download/0.0.2/ingester-windows-386" -OutFile "ingester.exe"
- .\ingester.exe --config doku.yml
- ```
- </CodeGroup>
- </Step>
-</Steps>
-
diff --git a/docs/0.0.2/introduction.mdx b/docs/0.0.2/introduction.mdx
deleted file mode 100644
index 1f58467c..00000000
--- a/docs/0.0.2/introduction.mdx
+++ /dev/null
@@ -1,111 +0,0 @@
----
-title: What is Doku?
-description: 'Monitor and evalute your LLM Applications'
----
-
-Doku is an open-source observability tool engineered for Large Language Models (LLMs). Designed for ease of integration into existing LLM applications, Doku offers unparalleled insights into usage, performance, and overhead—allowing you to analyze, optimize, and scale your AI applications and LLM usage effectively.
-
-Whether you're working with OpenAI, Cohere, or Anthropic, It tracks all your LLM requests transparently and conveys the insights needed to make data-driven decisions. From monitoring usage and understanding latencies to managing costs and collaborating effortlessly, Doku grants you the lens to view your models in high definition.
-
-## How it works
-
-<Frame>
- <img src="https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif" />
-</Frame>
-### Application Integration with Two Lines of Code
-Start by incorporating the DokuMetry SDK into your application. With SDKs tailored for both Python and NodeJS, Doku fits into your tech stack with minimal changes. Just a **two lines** of code is all it takes to begin:
-
-For Python and NodeJS projects, just import the DokuMetry SDK and initialize it as follows:
- <CodeGroup>
- ```python python
- import dokumetry
- dokumetry.init(llm=openai, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
- ```
-
- ```javascript NodeJS
- import DokuMetry from 'dokumetry';
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
- ```
- </CodeGroup>
-Find detailed instructions at the [DokuMetry SDK Documentation](/0.0.2/dokumetry/introduction).
-
-### The Doku Ingester: Your Data Processing Workhorse
-
-Upon SDK setup, data from your LLM operations is automatically collected. The DokuMetry SDKs transmit this usage data over HTTP in the background to the [Doku Ingester](https://github.com/dokulabs/doku/tree/main/src/ingester#readme).
-
-The ingester is the core engine where the magic happens:
-- **Data Collection**: Effortlessly captures live data from your LLM interactions without complicating your existing codebase.
-- **Cost Analysis**: Enriches your data with cost considerations, providing a financial perspective to your analytics.
-- **Secure Storage**: All processed information is securely stored in TimescaleDB, providing you with a scalable, time-series database that can handle large volumes of observability data.
-
-You have the choice to set up a fresh TimescaleDB instance or connect Doku to your existing one. Whichever path you choose, your data resides within your control, reinforcing your data security and operational compliance.
-
-## Features
-Leveraging Doku, you can get:
-
-- **In-depth LLM Monitoring**: Track every request to LLM platforms like OpenAI with precision, ensuring comprehensive visibility over your model's interactions.
-- **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.
-- **Connect to Observability Platforms**: Export LLM Observablity data and insights from Doku to popular observability platforms such as Grafana Cloud or Datadog.
-- **Team-centric Workflow**: Enhance team collaboration with seamless data sharing capabilities, creating an integrated environment for observability-driven teamwork.
-
-## Supported LLM Platforms
-<CardGroup cols={3}>
- <Card
- title="OpenAI"
- icon={
- <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>OpenAI</title>
- <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Cohere"
- icon={
- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">
- <g>
- <g>
- <g>
- <path d="M24.3,44.7c2,0,6-0.1,11.6-2.4c6.5-2.7,19.3-7.5,28.6-12.5c6.5-3.5,9.3-8.1,9.3-14.3C73.8,7,66.9,0,58.3,0
- h-36C10,0,0,10,0,22.3S9.4,44.7,24.3,44.7z">
- </path>
- <path d="M30.4,60c0-6,3.6-11.5,9.2-13.8l11.3-4.7C62.4,36.8,75,45.2,75,57.6C75,67.2,67.2,75,57.6,75l-12.3,0
- C37.1,75,30.4,68.3,30.4,60z">
- </path>
- <path d="M12.9,47.6L12.9,47.6C5.8,47.6,0,53.4,0,60.5v1.7C0,69.2,5.8,75,12.9,75h0c7.1,0,12.9-5.8,12.9-12.9v-1.7
- C25.7,53.4,20,47.6,12.9,47.6z">
- </path>
- </g>
- </g>
- </g>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Anthropic"
- icon={
- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">
- <path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path>
- <path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
-</CardGroup>
-
-## Getting Started
-Select from the following guides to learn more about how to use Doku:
-
-<CardGroup cols={2}>
-<Card title="Quickstart" href="/0.0.2/quickstart" icon='bolt'>
-Get Started with monitoring your LLM Applications in 3 simple steps
-</Card>
-<Card title="Connections" href="/0.0.2/connections/intro" icon='connectdevelop'>
-Connect to your existing Observablity Platform
-</Card>
-</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.2/quickstart.mdx b/docs/0.0.2/quickstart.mdx
deleted file mode 100644
index 109424ac..00000000
--- a/docs/0.0.2/quickstart.mdx
+++ /dev/null
@@ -1,150 +0,0 @@
----
-title: 'Quickstart'
-description: 'Quickly start **monitoring** your **LLM Applications** in just **two lines** of code'
-icon: 'bolt'
----
-
-This guide will walk you through setting up your monitoring system with minimal effort. In just a few steps, you'll be able to track and analyze the performance and usage of your Large Language Model (LLM) applications.
-
-## Prerequistes
-- Ensure you have access to a **Kubernetes Cluster**. You can quickly spin up a Kubernetes Cluster using [Kind](https://github.com/kubernetes-sigs/kind?tab=readme-ov-file#installation-and-usage)
-
-## Get Started
-
-<Steps>
- <Step title="Install Doku in a Kubernetes Cluster">
- <Steps>
- <Step title="Helm Repo Setup">
- ```shell shell
- helm repo add dokulabs https://dokulabs.github.io/helm/
- helm repo update
- ```
- </Step>
- <Step title="Installing the Helm Chart">
- ```shell shell
- helm install doku dokulabs/doku --version 0.0.8
- ```
- </Step>
- </Steps>
- </Step>
- <Step title="Generate an API Key">
- With Doku running, the next step is to [generate an API key](/0.0.2/api-reference/endpoint/api-keys/create) for secure communication between your applications and Doku.
-
- To generate your first API key, you can use the following command:
-
- ```shell shell
- curl --request POST \
- --url https://<your-doku-url>/api/keys \
- --header 'Authorization: ""' \
- --header 'Content-Type: application/json' \
- --data '{
- "name": "Admin"
- }'
- ```
-
- Make sure to store the returned API key securely, as it's necessary for authorizing future API calls with Doku.
-
- <Info>
- During your initial request to generate an API key, you can leave the Authorization header empty (i.e., `""`). For subsequent requests, you will need to supply the generated API key.
- </Info>
-
- </Step>
- <Step title="Instrument your code">
- Choose the appropriate SDK for your application's programming language and follow the steps to integrate monitoring with just a couple of lines of code.
- <Tabs>
- <Tab title="Python">
- <Steps>
- <Step title="Install the dokumetry Python SDK using pip">
- ```shell
- pip install dokumetry
- ```
- </Step>
- <Step title="Add the following two lines to your application code:">
- Add the snippet below to your Python application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.
-
- ```python
- import dokumetry
-
- dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
- ```
-
- Example Usage for monitoring `OpenAI` Usage:
-
- ```python
- from openai import OpenAI
- import dokumetry
-
- client = OpenAI(
- api_key="YOUR_OPENAI_KEY"
- )
-
- # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
- dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
- chat_completion = client.chat.completions.create(
- messages=[
- {
- "role": "user",
- "content": "What is LLM Observability",
- }
- ],
- model="gpt-3.5-turbo",
- )
- ```
-
- Refer to the `dokumetry` [Python SDK repository](https://github.com/dokulabs/dokumetry-python) or the [DokuMetry Docs](/0.0.2/dokumetry/python/introduction) for more advanced configurations and use cases.
- </Step>
- </Steps>
- </Tab>
- <Tab title="NodeJS">
- <Steps>
- <Step title="Install the dokumetry NodeJS SDK using npm">
- ```shell
- npm install dokumetry
- ```
- </Step>
- <Step title="Add the following two lines to your application code">
- Add the snippet below to your NodeJS application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.
- ```javascript
- import DokuMetry from 'dokumetry';
-
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
- ```
-
- Example Usage for monitoring `OpenAI` Usage:
-
- ```javascript
- import OpenAI from 'openai';
- import DokuMetry from 'dokumetry';
-
- const openai = new OpenAI({
- apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]
- });
-
- // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- async function main() {
- const chatCompletion = await openai.chat.completions.create({
- messages: [{ role: 'user', content: 'What are the key to effective observability?' }],
- model: 'gpt-3.5-turbo',
- });
- }
-
- main();
- ```
-
- Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dokumetry-node) or the [DokuMetry Docs](/0.0.2/dokumetry/node/introduction) for more advanced configurations and use cases.
- </Step>
- </Steps>
- </Tab>
- </Tabs>
- </Step>
-</Steps>
-
-## (Optional) Export Data
-<Card title="Connections" href="/0.0.2/connections/intro" icon='connectdevelop'>
-Connect to your existing Observablity Platform
-</Card>
-
-You're all set! Following these steps should have you on your way to effectively monitoring your LLM applications. If you have any questions or need support, reach out to our [community](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA).
\ No newline at end of file
diff --git a/docs/0.0.3/api-reference/endpoint/api-keys/create.mdx b/docs/0.0.3/api-reference/endpoint/api-keys/create.mdx
deleted file mode 100644
index cce6cecf..00000000
--- a/docs/0.0.3/api-reference/endpoint/api-keys/create.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'Create API Key'
-openapi: 'POST /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.3/api-reference/endpoint/api-keys/delete.mdx b/docs/0.0.3/api-reference/endpoint/api-keys/delete.mdx
deleted file mode 100644
index fbb9e963..00000000
--- a/docs/0.0.3/api-reference/endpoint/api-keys/delete.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'Delete API Key'
-openapi: 'DELETE /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.3/api-reference/endpoint/api-keys/get.mdx b/docs/0.0.3/api-reference/endpoint/api-keys/get.mdx
deleted file mode 100644
index 3ecec318..00000000
--- a/docs/0.0.3/api-reference/endpoint/api-keys/get.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'GET API Key'
-openapi: 'GET /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.3/api-reference/introduction.mdx b/docs/0.0.3/api-reference/introduction.mdx
deleted file mode 100644
index a19a5702..00000000
--- a/docs/0.0.3/api-reference/introduction.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: 'Introduction'
-description: 'OpenAPI specification for API Endpoints in Doku'
----
-
-<Card
- title="API Keys Endpoints"
- icon="key"
- href="/0.0.3/api-reference/endpoint/api-keys/create"
->
- View the documentation for API Keys
-</Card>
-
-## Authentication
-
-All API endpoints are authenticated using Authetication Header.
-
-```json
-Authorization: <api-key>
-```
-
-<Info>
-For your initial API call, Authorization header can be set to "".
-Store the provided API key securely; it will be required to pass the generated and a valid API Key in Authorization header for subsequent API calls.
-</Info>
\ No newline at end of file
diff --git a/docs/0.0.3/api-reference/openiapi.yml b/docs/0.0.3/api-reference/openiapi.yml
deleted file mode 100644
index f1c7dc5b..00000000
--- a/docs/0.0.3/api-reference/openiapi.yml
+++ /dev/null
@@ -1,100 +0,0 @@
-openapi: 3.0.0
-info:
- title: API Keys Service
- description: This service manages API keys through GET, POST, and DELETE operations.
- version: "0.0.2"
-
-servers:
- - url: https://127.0.0.1:9044/
-
-paths:
- /api/keys:
- get:
- summary: Get a list of API keys
- operationId: getApiKeys
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '200':
- description: A list of API keys
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
- post:
- summary: Create a new API key
- operationId: createApiKey
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '201':
- description: API key created
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
- delete:
- summary: Delete an API key
- operationId: deleteApiKey
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '200':
- description: API key deleted
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
-components:
- schemas:
- APIKeyRequest:
- type: object
- required:
- - name
- properties:
- name:
- type: string
-
- jsonResponse:
- type: object
- required:
- - status
- - message
- properties:
- status:
- type: integer
- message:
- type: string
-
- securitySchemes:
- ApiKeyAuth:
- type: apiKey
- in: header
- name: Authorization
\ No newline at end of file
diff --git a/docs/0.0.3/configuration.mdx b/docs/0.0.3/configuration.mdx
deleted file mode 100644
index 06aa3b98..00000000
--- a/docs/0.0.3/configuration.mdx
+++ /dev/null
@@ -1,254 +0,0 @@
----
-title: 'Configuration'
-description: 'Configuring Options for Doku'
-icon: 'sliders'
----
-
-This document outlines the various options available for configuring Doku.
-For ease of use and clarity, we recommend naming the configuration file `doku.yml`
-
-
-## Properties
-
-<ResponseField name="ingesterPort" type="String">
- The `ingesterPort` specifies the network port that the Ingestion Server will listen to for incoming data. You can set this to any available port on your system.
-
-**Example**:
-```yaml
-ingesterPort: 9044
-```
-</ResponseField>
-
-<ResponseField name="retentionPeriod" type="String">
- The `retentionPeriod` field indicates how long the LLM Monitoring data will be stored before it is deleted. For example, you can specify a retention period of "6 months" to keep the data for six months before it is automatically removed.
-
-**Example**:
-```yaml
-retentionPeriod: "6 months"
-```
-</ResponseField>
-
-### Pricing Information Source
-
-<ResponseField name="pricingInfo" type="Object">
- Doku supports using either a local file or a URL to retrieve LLM Pricing data. Comment out the option you do not wish to use.
-</ResponseField>
-
-<Info>
-We strongly recommend using the `url` method with the value set as `https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json`.
-
-This ensures that you automatically retrieve the latest pricing information upon each startup, as the developers at Doku consistently refresh the pricing file with current data from OpenAI, Cohere and Anthropic.
-</Info>
-
-<ResponseField name="local_file" type="Object">
- Local File containing the Pricing Information JSON
- <Expandable title="properties">
- <ResponseField name="path" type="String">
- Specify the local file system path to a JSON file containing the LLM Pricing data.
- </ResponseField>
- </Expandable>
-
- **Example**:
- ```yaml
- pricingInfo:
- localFile:
- path: "/assets/pricing.json"
- ```
-</ResponseField>
-
-<ResponseField name="url" type="String">
- Provide the URL where the pricing data JSON file can be downloaded. Ensure the given URL is accessible.
-
- **Example**:
- ```yaml
- pricingInfo:
- url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json"
- ```
-</ResponseField>
-
-
-### Database Configuration
-
-<ResponseField name="dbConfig" type="Object">
- Configure the database connection details to connect Doku with TimescaleDB (or another Postgres compatible DB).
- <Expandable title="properties">
- <ResponseField name="name" type="String">
- Database name.
- </ResponseField>
- <ResponseField name="username" type="String">
- The username for the database.
- </ResponseField>
- <ResponseField name="password" type="String">
- The password for the database.
- </ResponseField>
- <ResponseField name="host" type="String">
- Host address for the database.
- </ResponseField>
- <ResponseField name="port" type="String">
- Network port for the database connection.
- </ResponseField>
- <ResponseField name="sslMode" type="String">
- The SSL mode for the database connection (e.g., "require" if SSL is needed).
- </ResponseField>
- <ResponseField name="maxOpenConns" type="String">
- Maximum number of concurrent open database connections.
- </ResponseField>
- <ResponseField name="maxIdleConns" type="String">
- Maximum number of idle database connections.
- </ResponseField>
- </Expandable>
-
- **Example**:
- ```yaml
- dbConfig:
- name: "mydatabase"
- username: "myusername"
- password: "mypassword"
- host: "mydbhost.example.com"
- port: 5432
- sslMode: "require"
- maxOpenConns: 15
- maxIdleConns: 10
- dataTable: "llm_data"
- apiKeyTable: "api_keys"
- ```
-</ResponseField>
-
-
-### Connections Configuration
-
-<ResponseField name="observabilityPlatform" type="Object">
- Choose the external platform you wish to use for exporting observability data from Doku and set `enabled` to `true`. Fill in the required fields for the chosen platform. Only one platform can be selected at a time.
-
- The following sections show example configurations for different platforms - Grafana Cloud, New Relic, and DataDog. You will need to uncomment the applicable section and provide necessary credentials such as URLs, User IDs, and API Keys corresponding to your account on the observability platform.
- <Expandable title="properties">
- <ResponseField name="enabled" type="boolean">
- Boolean parameter to configure external Observability Platform
- </ResponseField>
- <ResponseField name="grafanaCloud" type="Object">
- Configuration for connecting Doku with Grafana Cloud.
- <Expandable title="properties">
- <ResponseField name="promUrl" type="String">
- URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance.
- </ResponseField>
- <ResponseField name="promUsername" type="String">
- Prometheus User ID of the Grafana Cloud Prometheus Instance.
- </ResponseField>
- <ResponseField name="lokiUrl" type="String">
- URL of the Loki Push URL of the Grafana Cloud Loki Instance.
- </ResponseField>
- <ResponseField name="lokiUsername" type="String">
- Loki Username of the Grafana Cloud Loki Instance.
- </ResponseField>
- <ResponseField name="accessToken" type="String">
- Access Token of the Grafana Cloud Instance.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- grafanaCloud:
- promUrl: "https://your-grafana-prometheus-url"
- promUsername: "your-prom-user-id"
- lokiUrl: "https://your-grafana-loki-url"
- lokiUsername: "your-loki-user-id"
- accessToken: "your-grafana-cloud-access-token"
- ```
- </Expandable>
- </ResponseField>
- <ResponseField name="datadog" type="Object">
- Configuration for connecting Doku with DataDog.
- <Expandable title="properties">
- <ResponseField name="metricsUrl" type="String">
- URL to the DataDog Metrics API.
- </ResponseField>
- <ResponseField name="logsUrl" type="String">
- URL to the DataDog Logs API.
- </ResponseField>
- <ResponseField name="apiKey" type="String">
- API Key of the DataDog Account.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- datadog:
- metricsUrl: "https://api.datadoghq.com/api/v1/series"
- logsUrl: "https://http.logs.datadoghq.com/api/v2/logs"
- apiKey: "datadog-api-key"
- ```
- </Expandable>
- </ResponseField>
- <ResponseField name="newRelic" type="Object">
- Configuration for connecting Doku with New Relic.
- <Expandable title="properties">
- <ResponseField name="metricsUrl" type="String">
- URL to the New Relic Metric API.
- </ResponseField>
- <ResponseField name="logsUrl" type="String">
- URL to the New Relic Log API.
- </ResponseField>
- <ResponseField name="apiKey" type="String">
- Ingest API Key of the New Relic Account.
- </ResponseField>
- **Example**:
- ```yaml
- observabilityPlatform:
- enabled: true
- newRelic:
- metricsUrl: "https://metric-api.newrelic.com/metric/v1"
- logsUrl: "https://log-api.newrelic.com/log/v1"
- apiKey: "newrelic-api-key"
- ```
- </Expandable>
- </ResponseField>
- </Expandable>
-</ResponseField>
-
-Ensure that the file is correctly formatted in YAML and all necessary fields are populated based on your deployment needs. Save the file and restart the Doku service to apply the new configuration.
-
-## Example Configuration File
-
-```yaml doku.yml
-ingesterPort: 9044 # Port to run the Ingestion Server on, Example: 9044
-
-retentionPeriod: "6 months" # Retention Period for the LLM Data, Example: "24 hours", "7 days", "6 months"
-
-# Comment out either 'localFile' or 'url' to use only one at a time.
-pricingInfo:
- # localFile:
- # path: "/assets/pricing.json" # Path to local JSON file with LLM Pricing data
- url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json" # URL to download Pricing data file
-
-# Configuration for the Doku Backend Database (TimescaleDB)
-dbConfig:
- name: "DBNAME" # Name of the database, Example: "postgres"
- username: "USERNAME" # Username to connect to the database, Example: "admin"
- password: "PASSWORD" # Password to connect to the database, Example: "DOKU"
- host: "HOSTURL" # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
-
-# Configure Platform to export LLM Observability Data from Doku
-# Only one platform can be enabled at a time, To enable a platform, set enabled to true and fill in the required fields for that platform.
-observabilityPlatform:
- enabled: false # Enable or Disable the Observability Platform, Example: true
- # grafanaCloud:
- # promUrl: "influx-line-proxy-url" # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance
- # promUsername: "prometheus-userid" # Prometheus User ID of the Grafana Cloud Prometheus Instance
- # lokiUrl: "loki-push-url" # URL to the Loki Push URL of the Grafana Cloud Loki Instance
- # lokiUsername: "loki-username" # Loki Username of the Grafana Cloud Loki Instance
- # accessToken: "grafana-cloud-access-token" # Access Token of the Grafana Cloud Instance
-
- # newRelic:
- # metricsUrl: "https://metric-api.newrelic.com/metric/v1" # URL to the New Relic Metric API
- # logsUrl: "https://log-api.newrelic.com/log/v1" # URL to the New Relic Log API
- # key: "newrelic-api-key" # Ingest API Key of the New Relic Account
-
- # datadog:
- # metricsUrl: "https://api.datadoghq.com/api/v1/series" # URL to the DataDog Metrics API
- # logsUrl: "https://http.logs.datadoghq.com/api/v2/logs" # URL to the DataDog Logs API
- # apiKey: "datadog-api-key" # API Key of the DataDog Account
-```
\ No newline at end of file
diff --git a/docs/0.0.3/connections/datadog.mdx b/docs/0.0.3/connections/datadog.mdx
deleted file mode 100644
index 92dffa4f..00000000
--- a/docs/0.0.3/connections/datadog.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: 'DataDog'
-description: 'Connect Doku to DataDog'
----
-
-Doku can automatically send LLM usage data from Doku to DataDog using the [Submit Metrics API](https://docs.datadoghq.com/api/latest/metrics/#submit-metrics) and [Send Logs API](https://docs.datadoghq.com/api/latest/logs/#send-logs)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- datadog:
- metricsUrl: <your-datadog-metrics-url> # URL to the DataDog Metrics API
- logsUrl: <your-datadog-logs-url> # URL to the DataDog Logs API
- apiKey: <your-datadog-api-key> # API Key of the DataDog Account
-```
\ No newline at end of file
diff --git a/docs/0.0.3/connections/grafanacloud.mdx b/docs/0.0.3/connections/grafanacloud.mdx
deleted file mode 100644
index 044bba27..00000000
--- a/docs/0.0.3/connections/grafanacloud.mdx
+++ /dev/null
@@ -1,2351 +0,0 @@
----
-title: 'Grafana Cloud'
-description: 'Connect Doku to Grafana Cloud'
----
-
-<Frame>
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-1.jpg?raw=true" />
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-2.jpg?raw=true" />
-</Frame>
-
-Doku can automatically send LLM usage data from Doku to Grafana Cloud using the [Grafana Cloud Influx Telegraf](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-influxdb/push-from-telegraf/) and [Loki Push HTTP API](https://grafana.com/docs/loki/latest/reference/api/#push-log-entries-to-loki)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- grafanaCloud:
- promUrl: <your-grafana-cloud-influx-line-proxy-url> # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance
- promUsername: <your-prometheus-userid> # Prometheus User ID of the Grafana Cloud Prometheus Instance
- lokiUrl: <your-loki-push-url> # URL to the Loki Push URL of the Grafana Cloud Loki Instance
- lokiUsername: <your-loki-username> # Loki Username of the Grafana Cloud Loki Instance
- accessToken: <your-grafana-cloud-access-token> # Access Token of the Grafana Cloud Instance
-```
-
-## Grafana Resources
-
-<Accordion title="Dashboard">
- ```json
- {
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "grafana",
- "uid": "-- Grafana --"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "id": 14,
- "links": [
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Documentation",
- "tooltip": "",
- "type": "link",
- "url": "https://docs.dokulabs.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Community",
- "tooltip": "",
- "type": "link",
- "url": "https://dokulabs.slack.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Dokulabs GitHub",
- "tooltip": "",
- "type": "link",
- "url": "https://github.com/dokulabs/"
- }
- ],
- "liveNow": false,
- "panels": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 0,
- "y": 0
- },
- "id": 23,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 2,
- "x": 11,
- "y": 0
- },
- "id": 2,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "![Doku Logo](https://github.com/dokulabs/.github/blob/main/profile/assets/favicon.png?raw=true)",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 13,
- "y": 0
- },
- "id": 22,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.4.0-65875",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the total number of requests sent to Large Language Models (LLM) Platforms in the selected time interval.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 4
- },
- "id": 3,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT count(*) FROM DOKU\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "COUNT",
- "parameters": [
- {
- "name": "environment",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Requests",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average time taken to process each request by the Large Language Models (LLM), offering a snapshot of system performance and efficiency.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "s",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 6,
- "y": 4
- },
- "id": 4,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(requestduration) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "requestduration",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Request Duration",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Total tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 1000
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 10,
- "y": 4
- },
- "id": 5,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_totalTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(totaltokens) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Tokens per Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average cost incurred per request to the LLM, helping monitor and optimize budget allocation for LLM usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 14,
- "y": 4
- },
- "id": 6,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(usagecost) FROM doku \nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Cost / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the total cost on LLM requests over the selected period.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 18,
- "y": 4
- },
- "id": 10,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT SUM(usagecost) FROM doku\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "SUM",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Cost",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the count of API requests made to LLMs over the selected time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 54,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "smooth",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 5,
- "w": 24,
- "x": 0,
- "y": 7
- },
- "id": 17,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count(count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval]))",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "Requests",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n DATE_TRUNC('day', \"time\") AS \"time\",\n COUNT(endpoint) AS total_requests\nFROM \n doku\nWHERE\n $__timeFilter(\"time\")\nGROUP BY \n DATE_TRUNC('day', \"time\")\nORDER BY \n \"time\";",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Total Requests overtime",
- "transformations": [],
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel illustrates the distribution of LLM requests across different usage categories: Chat Generations, Embeddings, Image Generations, Audio Generations, and Fine Tuning. It visualizes the relative volume of requests, helping to identify which types of operations are most frequently performed and providing insights into usage patterns by category.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "blue",
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "none",
- "unitScale": true
- },
- "overrides": [
- {
- "__systemRef": "hideSeriesFrom",
- "matcher": {
- "id": "byNames",
- "options": {
- "mode": "exclude",
- "names": [
- "Value (sum)",
- "Chat"
- ],
- "prefix": "All except:",
- "readOnly": true
- }
- },
- "properties": [
- {
- "id": "custom.hideFrom",
- "value": {
- "legend": false,
- "tooltip": false,
- "viz": true
- }
- }
- ]
- }
- ]
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 0,
- "y": 12
- },
- "id": 12,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "count_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n category,\n CAST(COUNT(*) AS INTEGER) AS Requests,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage\n FROM \n (\n SELECT \n CASE\n WHEN endpoint LIKE 'openai.chat%' THEN 'Chat'\n WHEN endpoint LIKE 'openai.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'anthropic.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.summarize%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.generate%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.chat%' THEN 'Chat'\n WHEN endpoint LIKE '%embed%' THEN 'Embeddings'\n WHEN endpoint LIKE 'openai.images%' THEN 'Image'\n WHEN endpoint LIKE 'openai.audio%' THEN 'Audio'\n WHEN endpoint LIKE 'openai.fine_tuning%' THEN 'Fine Tuning'\n END AS category,\n endpoint\n FROM doku\n WHERE $__timeFilter(time)\n ) AS subquery\n GROUP BY category",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage by Category",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "generation": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Displays the cost breakdown by provider (OpenAI, Cohere, Anthropic) for LLM requests, offering insights into financial deployment across different services.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 6,
- "y": 12
- },
- "id": 16,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Provider",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "generation": {
- "aggregations": []
- },
- "platform": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel presents a pie chart detailing the distribution of expenses for LLM requests by various applications. It shows how budget allocations are consumed by different applications, enabling a deeper understanding of cost drivers and facilitating cost optimization efforts.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 12,
- "y": 12
- },
- "id": 24,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Application",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "applicationName": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Visualizes the allocation of LLM request expenses across different environments, such as development, staging, and production. This breakdown helps in tracking and managing costs with respect to operational environments.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 18,
- "y": 12
- },
- "id": 25,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_usageCost{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n doku\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "useBackend": false
- }
- ],
- "title": "Usage cost by Environment",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "applicationName": {
- "aggregations": []
- },
- "environment": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Prompt tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 21
- },
- "id": 9,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_promptTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(prompttokens) FROM doku WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Prompt Tokens / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Provides a time-series analysis of token consumption for LLM requests, highlighting trends in usage intensity and complexity over time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlYlRd"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 50,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": 86400000,
- "lineInterpolation": "smooth",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 1,
- "pointSize": 6,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 18,
- "x": 6,
- "y": 21
- },
- "id": 11,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "avg(doku_llm_completionTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"})",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "Completion Tokens",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM doku",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "builder",
- "expr": "avg(doku_llm_promptTokens)",
- "format": "time_series",
- "fullMetaSearch": false,
- "hide": false,
- "includeNullMetadata": true,
- "legendFormat": "Prompt Tokens",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM doku",
- "refId": "B",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Token usage overtime",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "This panel shows the average count of Completion tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 24
- },
- "id": 7,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "showPercentChange": false,
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "doku_llm_completionTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT AVG(completiontokens) FROM doku WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Avg Completion Tokens / Request",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "mean"
- ],
- "operation": "aggregate"
- },
- "job": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- }
- ],
- "type": "stat"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Displays the frequency of model usage over time, identifying the most utilised models and showcasing usage trends across different periods",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "purple",
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 27
- },
- "id": 13,
- "options": {
- "displayMode": "lcd",
- "maxVizHeight": 165,
- "minVizHeight": 0,
- "minVizWidth": 75,
- "namePlacement": "left",
- "orientation": "horizontal",
- "reduceOptions": {
- "calcs": [
- "allValues"
- ],
- "fields": "",
- "values": true
- },
- "showUnfilled": true,
- "sizing": "auto",
- "valueMode": "color"
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "topk(5,count by(model) (sum_over_time(doku_llm_requestDuration{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])))",
- "format": "table",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "__auto",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n model,\n total_count,\n percentage_usage\nFROM \n (\n SELECT \n model,\n COUNT(*) AS total_count,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage_usage\n FROM \n doku\n WHERE $__timeFilter(time)\n GROUP BY \n model\n ORDER BY \n percentage_usage DESC\n ) sub\nLIMIT 5;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Top models by usage",
- "transformations": [
- {
- "id": "groupBy",
- "options": {
- "fields": {
- "Value": {
- "aggregations": [
- "sum"
- ],
- "operation": "aggregate"
- },
- "model": {
- "aggregations": [],
- "operation": "groupby"
- }
- }
- }
- },
- {
- "id": "sortBy",
- "options": {
- "fields": {},
- "sort": [
- {
- "desc": true,
- "field": "Value (sum)"
- }
- ]
- }
- }
- ],
- "type": "bargauge"
- },
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "description": "Breaks down token usage across different LLM models, offering insights into which models are driving the highest token consumption.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 23,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 1,
- "pointSize": 9,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none",
- "unitScale": true
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 27
- },
- "id": 14,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "disableTextWrap": false,
- "editorMode": "code",
- "expr": "sum_over_time(doku_llm_totalTokens{job=\"doku\", applicationName=~\"$Application\", environment=~\"$Environment\"}[$__interval])",
- "format": "time_series",
- "fullMetaSearch": false,
- "includeNullMetadata": true,
- "legendFormat": "{{model}}",
- "range": true,
- "rawQuery": true,
- "rawSql": "SELECT \n DATE_TRUNC('day', \"time\") AS \"time\",\n model,\n COUNT(*) AS \"Model:\"\nFROM \n doku\nWHERE \n $__timeFilter(\"time\")\nGROUP BY \n 1, model\nORDER BY \n \"time\" ASC, model;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku",
- "useBackend": false
- }
- ],
- "title": "Token usage by model",
- "transformations": [],
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "description": "Displays a log of all prompt messages sent to the LLM, providing insights into the inputs and interactions leading up to LLM responses.",
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 0,
- "y": 33
- },
- "id": 26,
- "options": {
- "dedupStrategy": "none",
- "enableLogDetails": true,
- "prettifyLogMessage": true,
- "showCommonLabels": false,
- "showLabels": false,
- "showTime": true,
- "sortOrder": "Descending",
- "wrapLogMessage": false
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "editorMode": "code",
- "expr": "{job=\"doku\", type=\"prompt\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "hide": false,
- "queryType": "range",
- "refId": "B"
- }
- ],
- "title": "Prompts",
- "transformations": [
- {
- "id": "extractFields",
- "options": {
- "format": "auto",
- "source": "labels"
- }
- }
- ],
- "transparent": true,
- "type": "logs"
- },
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "description": "Displays a log of all responses from the LLM, offering a comprehensive view of how the model interprets prompts and the information it generates.",
- "gridPos": {
- "h": 8,
- "w": 12,
- "x": 12,
- "y": 33
- },
- "id": 27,
- "options": {
- "dedupStrategy": "none",
- "enableLogDetails": true,
- "prettifyLogMessage": true,
- "showCommonLabels": false,
- "showLabels": false,
- "showTime": true,
- "sortOrder": "Descending",
- "wrapLogMessage": true
- },
- "pluginVersion": "10.4.0-65875",
- "targets": [
- {
- "datasource": {
- "type": "loki",
- "uid": "grafanacloud-logs"
- },
- "editorMode": "code",
- "expr": "{job=\"doku\", type=\"response\", applicationName=~\"$Application\", environment=~\"$Environment\"}",
- "hide": false,
- "queryType": "range",
- "refId": "B"
- }
- ],
- "title": "Responses",
- "transformations": [
- {
- "id": "extractFields",
- "options": {
- "format": "auto",
- "source": "labels"
- }
- }
- ],
- "transparent": true,
- "type": "logs"
- }
- ],
- "refresh": "",
- "schemaVersion": 39,
- "tags": [
- "Doku",
- "OpenAI",
- "Cohere",
- "Anthropic"
- ],
- "templating": {
- "list": [
- {
- "current": {
- "selected": true,
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
- },
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "definition": "label_values(applicationName)",
- "hide": 0,
- "includeAll": true,
- "label": "Application",
- "multi": true,
- "name": "Application",
- "options": [],
- "query": {
- "qryType": 1,
- "query": "label_values(applicationName)",
- "refId": "PrometheusVariableQueryEditor-VariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- },
- {
- "current": {
- "selected": true,
- "text": [
- "All"
- ],
- "value": [
- "$__all"
- ]
- },
- "datasource": {
- "type": "prometheus",
- "uid": "grafanacloud-prom"
- },
- "definition": "label_values(environment)",
- "hide": 0,
- "includeAll": true,
- "label": "Environment",
- "multi": true,
- "name": "Environment",
- "options": [],
- "query": {
- "qryType": 1,
- "query": "label_values(environment)",
- "refId": "PrometheusVariableQueryEditor-VariableQuery"
- },
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "sort": 0,
- "type": "query"
- }
- ]
- },
- "time": {
- "from": "now-24h",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Doku - LLM Monitoring",
- "uid": "doku-llm-monitoring",
- "version": 1,
- "weekStart": ""
- }
- ```
-</Accordion>
-
diff --git a/docs/0.0.3/connections/grafanaoss.mdx b/docs/0.0.3/connections/grafanaoss.mdx
deleted file mode 100644
index ce236a73..00000000
--- a/docs/0.0.3/connections/grafanaoss.mdx
+++ /dev/null
@@ -1,1846 +0,0 @@
----
-title: 'Grafana OSS'
-description: 'Connect Doku to Grafana OSS'
----
-
-<Frame>
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-1.jpg?raw=true" />
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-3.jpg?raw=true" />
-</Frame>
-
-You can add the Doku's backend storage database (`TimescaleDB`) as a datasource in Grafana.
-
-## Steps
-
-1. Navigate to your Grafana Instance.
-1. Login with your credentials.
-1. Click on the **Connection** on the left sidebar to open the **Data Sources**.
-1. Click the **Add data source** button.
-1. In the search box, type "PostgreSQL" as `TimescaleDB` is an extension of PostgreSQL
-1.In the settings form, fill in the details to connect to your TimescaleDB/PostgreSQL database:
- - **Name**: Enter the name for the datasource as `Doku`.
- - **Host**: Provide the host address and port of your PostgreSQL server (e.g., `127.0.0.1`).
- - **Database**: Enter the name of the database. Default database used by Doku is `postgres`.
- - **TLS/SSL Setiing**: Enter the securtity to use for connection. Default used by Doku is `require`.
- - **User**: The username for the database. Default user used by Doku is `admin`.
- - **Password**: The password for the database. Default password used by Doku is `Doku`.
-1. Optionally customize the **Max open connections**, **Max idle connections**, and **Connection Max Lifetime**.
-1. Click the **Save & Test** button at the bottom of the page.
-
-Grafana will attempt to connect to the database using the provided settings. If everything is configured correctly, you will see a message indicating the data source is working.
-
-## Grafana Resources
-
-<Accordion title="Dashboard">
- ```json
- {
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "grafana",
- "uid": "-- Grafana --"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "id": 8,
- "links": [
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Documentation",
- "tooltip": "",
- "type": "link",
- "url": "https://grafana.com/docs/grafana/latest/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Community",
- "tooltip": "",
- "type": "link",
- "url": "https://dokulabs.slack.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Dokulabs GitHub",
- "tooltip": "",
- "type": "link",
- "url": "https://github.com/dokulabs/"
- }
- ],
- "liveNow": false,
- "panels": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 0,
- "y": 0
- },
- "id": 23,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 2,
- "x": 11,
- "y": 0
- },
- "id": 2,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "![Doku Logo](https://github.com/dokulabs/.github/blob/main/profile/assets/favicon.png?raw=true)",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 13,
- "y": 0
- },
- "id": 22,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the total number of requests sent to Large Language Models (LLM) Platforms in the selected time interval.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "yellow",
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 4
- },
- "id": 3,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT count(*) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "COUNT",
- "parameters": [
- {
- "name": "environment",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Requests",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average time taken to process each request by the Large Language Models (LLM), offering a snapshot of system performance and efficiency.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "s"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 6,
- "y": 4
- },
- "id": 4,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(requestduration) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "requestduration",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Request Duration",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Total tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 1000
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 10,
- "y": 4
- },
- "id": 5,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(totaltokens) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Tokens per Request",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average cost incurred per request to the LLM, helping monitor and optimize budget allocation for LLM usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 14,
- "y": 4
- },
- "id": 6,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(usagecost) FROM DOKU_LLM_DATA \nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Cost / Request",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the total cost on LLM requests over the selected period.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 18,
- "y": 4
- },
- "id": 10,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT SUM(usagecost) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "SUM",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Cost",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the count of API requests made to LLMs over the selected time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic-by-name"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 100,
- "gradientMode": "opacity",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 5,
- "w": 24,
- "x": 0,
- "y": 7
- },
- "id": 17,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT\n DATE_TRUNC('day', \"time\") AS \"time\",\n COUNT(endpoint) AS total_requests\nFROM \n DOKU_LLM_DATA\nWHERE\n $__timeFilter(\"time\")\nGROUP BY \n DATE_TRUNC('day', \"time\")\nORDER BY \n \"time\";",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Requests / Day",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel illustrates the distribution of LLM requests across different usage categories: Chat Generations, Embeddings, Image Generations, Audio Generations, and Fine Tuning. It visualizes the relative volume of requests, helping to identify which types of operations are most frequently performed and providing insights into usage patterns by category.\n\n",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": []
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 0,
- "y": 12
- },
- "id": 12,
- "options": {
- "displayLabels": [
- "name",
- "percent"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [],
- "fields": "/^requests$/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \n category,\n CAST(COUNT(*) AS INTEGER) AS Requests,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage\n FROM \n (\n SELECT \n CASE\n WHEN endpoint LIKE 'openai.chat%' THEN 'Chat'\n WHEN endpoint LIKE 'openai.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'anthropic.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.summarize%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.generate%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.chat%' THEN 'Chat'\n WHEN endpoint LIKE '%embed%' THEN 'Embeddings'\n WHEN endpoint LIKE 'openai.images%' THEN 'Image'\n WHEN endpoint LIKE 'openai.audio%' THEN 'Audio'\n WHEN endpoint LIKE 'openai.fine_tuning%' THEN 'Fine Tuning'\n END AS category,\n endpoint\n FROM DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n ) AS subquery\n GROUP BY category",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage by Category",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Displays the cost breakdown by provider (OpenAI, Cohere, Anthropic) for LLM requests, offering insights into financial deployment across different services.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 6,
- "y": 12
- },
- "id": 16,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n DOKU_LLM_DATA\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Provider",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel presents a pie chart detailing the distribution of expenses for LLM requests by various applications. It shows how budget allocations are consumed by different applications, enabling a deeper understanding of cost drivers and facilitating cost optimization efforts.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 12,
- "y": 12
- },
- "id": 18,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "uniqueValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": " SELECT\n applicationName,\n sum(usageCost) AS \"usageCost\"\n FROM\n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY\n applicationName\n ORDER BY\n \"usageCost\" DESC",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Application",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Visualizes the allocation of LLM request expenses across different environments, such as development, staging, and production. This breakdown helps in tracking and managing costs with respect to operational environments.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 18,
- "y": 12
- },
- "id": 19,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "uniqueValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": " SELECT\n environment,\n sum(usageCost) AS \"usageCost\"\n FROM\n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY\n environment\n ORDER BY\n \"usageCost\" DESC",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Environment",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Prompt tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 21
- },
- "id": 9,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(prompttokens) FROM DOKU_LLM_DATA WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Prompt Tokens / Request",
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Provides a time-series analysis of token consumption for LLM requests, highlighting trends in usage intensity and complexity over time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 10,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": 86400000,
- "lineInterpolation": "linear",
- "lineStyle": {
- "fill": "solid"
- },
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "never",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 18,
- "x": 6,
- "y": 21
- },
- "id": 11,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM DOKU_LLM_DATA",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Token usage",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Completion tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 24
- },
- "id": 7,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(completiontokens) FROM DOKU_LLM_DATA WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Completion Tokens / Request",
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Displays the frequency of model usage over time, identifying the most utilised models and showcasing usage trends across different periods",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "purple",
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 27
- },
- "id": 13,
- "options": {
- "displayMode": "lcd",
- "maxVizHeight": 167,
- "minVizHeight": 10,
- "minVizWidth": 75,
- "namePlacement": "top",
- "orientation": "horizontal",
- "reduceOptions": {
- "calcs": [
- "sum"
- ],
- "fields": "/^total_count$/",
- "values": true
- },
- "showUnfilled": true,
- "sizing": "manual",
- "valueMode": "text"
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \n model,\n total_count,\n percentage_usage\nFROM \n (\n SELECT \n model,\n COUNT(*) AS total_count,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage_usage\n FROM \n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY \n model\n ORDER BY \n percentage_usage DESC\n ) sub\nLIMIT 5;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Top models by usage",
- "type": "bargauge"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Breaks down token usage across different LLM models, offering insights into which models are driving the highest token consumption.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 27
- },
- "id": 14,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT \n DATE_TRUNC('day', \"time\") AS \"time\",\n model,\n COUNT(*) AS \"Model:\"\nFROM \n DOKU_LLM_DATA\nWHERE \n $__timeFilter(\"time\")\nGROUP BY \n 1, model\nORDER BY \n \"time\" ASC, model;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Model usage by day",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Table showing prompts and responses along with their associated costs and token usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic-by-name"
- },
- "custom": {
- "align": "center",
- "cellOptions": {
- "mode": "gradient",
- "type": "color-background"
- },
- "filterable": true,
- "inspect": true
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 24,
- "x": 0,
- "y": 33
- },
- "id": 15,
- "options": {
- "cellHeight": "sm",
- "footer": {
- "countRows": false,
- "fields": "",
- "reducer": [
- "sum"
- ],
- "show": false
- },
- "showHeader": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \"time\", applicationName, model, prompt, response, usageCost FROM DOKU_LLM_DATA WHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "endpoint",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "prompt",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "response",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "User Activity",
- "transparent": true,
- "type": "table"
- }
- ],
- "refresh": "",
- "schemaVersion": 39,
- "tags": [
- "Doku",
- "OpenAI",
- "Cohere",
- "Anthropic"
- ],
- "templating": {
- "list": [
- {
- "current": {
- "selected": true,
- "text": "grafana-postgresql-datasource",
- "value": "dbd38750-cf8a-4f35-a031-af943c441f1d"
- },
- "hide": 0,
- "includeAll": false,
- "label": "Datasource",
- "multi": false,
- "name": "datasource",
- "options": [],
- "query": "grafana-postgresql-datasource",
- "queryValue": "",
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "type": "datasource"
- }
- ]
- },
- "time": {
- "from": "now-7d",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Doku - LLM Monitoring",
- "uid": "doku-llm-monitoring",
- "version": 1,
- "weekStart": ""
- }
- ```
-</Accordion>
-
diff --git a/docs/0.0.3/connections/intro.mdx b/docs/0.0.3/connections/intro.mdx
deleted file mode 100644
index ef6fa1fc..00000000
--- a/docs/0.0.3/connections/intro.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Introduction'
-description: 'Connect to your existing Observablity Platform'
----
-
-Doku streamlines the observability experience by delivering processed LLM data right to the observability platform you are already familiar with. We recognize how crucial it is for developers to aggregate all application-related data, encompassing LLM usage metrics, into a single source of truth.
-
-This integration allows you to visualize and assess your entire application landscape in one integrated Observability platform, thereby refining your monitoring approaches and sharpening your decision-making.
-
-Below is a list of observability platforms that work seamlessly with Doku, allowing for integrated and expanded insights.
-
-<CardGroup cols={2}>
- <Card title="Grafana OSS" href="/0.0.3/connections/grafanaoss" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
- </Card>
- <Card title="Grafana Cloud" href="/0.0.3/connections/grafanacloud" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
- </Card>
- <Card title="DataDog" href="/0.0.3/connections/datadog" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Datadog</title><path d="M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"/></svg>}>
- </Card>
- <Card title="New Relic" href="/0.0.3/connections/new-relic" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>New Relic</title><path d="M8.0015 14.3091v7.384L12.0008 24V12.0008L1.6078 5.9996v4.6167ZM12.0008 0 2.8232 5.2976 6.8209 7.606l5.1799-2.9893 6.3936 3.6913v7.384l-5.1783 2.9908v4.6167l9.176-5.2991V5.9996Z"/></svg>}>
- </Card>
-</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/connections/new-relic.mdx b/docs/0.0.3/connections/new-relic.mdx
deleted file mode 100644
index 391c8b9c..00000000
--- a/docs/0.0.3/connections/new-relic.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-title: 'New Relic'
-description: 'Connect Doku to New Relic'
----
-
-Doku can automatically send LLM usage data from Doku to New Relic using the [Report Metrics HTTP API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/report-metrics-metric-api/) and [Send Logs API](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api/)
-
-Add the following to your doku configuration file(`doku.yml`).
-
-```yaml doku.yml
-observabilityPlatform:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- newRelic:
- metricsUrl: <your-new-relic-metrics-url> # URL to the New Relic Metric API
- logsUrl: <your-new-relic-logs-url> # URL to the New Relic Log API
- key: <your-new-relic-api-key> # Ingest API Key of the New Relic Account
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/anthropic/anthropic-completions.mdx b/docs/0.0.3/dokumetry/node/examples/anthropic/anthropic-completions.mdx
deleted file mode 100644
index 6fbff10e..00000000
--- a/docs/0.0.3/dokumetry/node/examples/anthropic/anthropic-completions.mdx
+++ /dev/null
@@ -1,29 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor Anthropic Completions API Usage'
----
-
-## Completions
-
-```javascript
-import Anthropic from '@anthropic-ai/sdk';
-import DokuMetry from 'dokumetry';
-
-const anthropic = new Anthropic({
- apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]
-});
-
-// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await anthropic.completions.create({
- model: 'claude-2',
- max_tokens_to_sample: 300,
- prompt: `${Anthropic.HUMAN_PROMPT} Hello, Claude{Anthropic.AI_PROMPT}`,
- });
- console.log(completion.completion);
-}
-main().catch(console.error);
-```
-
diff --git a/docs/0.0.3/dokumetry/node/examples/cohere/chat.mdx b/docs/0.0.3/dokumetry/node/examples/cohere/chat.mdx
deleted file mode 100644
index fdc6a559..00000000
--- a/docs/0.0.3/dokumetry/node/examples/cohere/chat.mdx
+++ /dev/null
@@ -1,60 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor Cohere Chat API usage'
----
-
-## Chat
-<CodeGroup>
-
-```javascript No Streaming
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const response = await cohere.chat({
- message: 'Say this is a test',
- model: 'command',
- });
-
- console.log(response)
-})();
-```
-
-```javascript Streaming
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const chatStream = await cohere.chatStream({
- chatHistory: [
- { role: "USER", message: "Who discovered gravity?" },
- { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }
- ],
- message: "What year was he born?",
- // perform web search before answering the question. You can also use your own custom connector.
- connectors: [{ id: "web-search" }],
- });
-
- for await (const message of chatStream) {
- if (message.eventType === "text-generation") {
- console.log(message);
- }
- }
-})();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/cohere/embed.mdx b/docs/0.0.3/dokumetry/node/examples/cohere/embed.mdx
deleted file mode 100644
index e11ba206..00000000
--- a/docs/0.0.3/dokumetry/node/examples/cohere/embed.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: 'Embed'
-description: 'Monitor Cohere Embed API usage'
----
-
-## Embed
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const embed = await cohere.embed({
- texts: ["hello", "goodbye"],
- model: "embed-english-v3.0",
- inputType: "classification",
- });
- console.log(embed);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/cohere/generate.mdx b/docs/0.0.3/dokumetry/node/examples/cohere/generate.mdx
deleted file mode 100644
index b48cdd1c..00000000
--- a/docs/0.0.3/dokumetry/node/examples/cohere/generate.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 'Generate'
-description: 'Monitor Cohere Generate API usage'
----
-
-## Generate
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const generate = await cohere.generate({
- prompt: "Please explain to me how LLMs work",
- });
-
- console.log(generate);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/cohere/summarize.mdx b/docs/0.0.3/dokumetry/node/examples/cohere/summarize.mdx
deleted file mode 100644
index 32cfd261..00000000
--- a/docs/0.0.3/dokumetry/node/examples/cohere/summarize.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'Summarize'
-description: 'Monitor Cohere Summarize API usage'
----
-
-## Summarize
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const summarize = await cohere.summarize({
- text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
- + "It may be made from milk or cream and is flavoured with a sweetener, "
- + "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
- + "or with fruit such as strawberries or peaches. "
- + "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
- + "Food coloring is sometimes added, in addition to stabilizers. "
- + "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
- + "and to prevent detectable ice crystals from forming. The result is a smooth, "
- + "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
- + "It becomes more malleable as its temperature increases.\n\n"
- + "The meaning of the name \"ice cream\" varies from one country to another. "
- + "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
- + "and most governments regulate the commercial use of the various terms according to the "
- + "relative quantities of the main ingredients, notably the amount of cream. "
- + "Products that do not meet the criteria to be called ice cream are sometimes labelled "
- + "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
- + "one word is used fo\r all variants. Analogues made from dairy alternatives, "
- + "such as goat's or sheep's milk, or milk substitutes "
- + "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
- + "lactose intolerant, allergic to dairy protein or vegan.",
- });
-
- console.log(summarize);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/openai/audio.mdx b/docs/0.0.3/dokumetry/node/examples/openai/audio.mdx
deleted file mode 100644
index cd5c1107..00000000
--- a/docs/0.0.3/dokumetry/node/examples/openai/audio.mdx
+++ /dev/null
@@ -1,32 +0,0 @@
----
-title: 'Audio'
-description: 'Monitor OpenAI Audio API usage'
----
-
-## Create Speech
-
-```javascript
-import fs from "fs";
-import path from "path";
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-const speechFile = path.resolve("./speech.mp3");
-
-async function main() {
- const mp3 = await openai.audio.speech.create({
- model: "tts-1",
- voice: "alloy",
- input: "Today is a wonderful day to build something people love!",
- });
- console.log(speechFile);
- const buffer = Buffer.from(await mp3.arrayBuffer());
- await fs.promises.writeFile(speechFile, buffer);
-}
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/openai/chat.mdx b/docs/0.0.3/dokumetry/node/examples/openai/chat.mdx
deleted file mode 100644
index 4400245f..00000000
--- a/docs/0.0.3/dokumetry/node/examples/openai/chat.mdx
+++ /dev/null
@@ -1,157 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor OpenAI Chat Completions API usage'
----
-
-## Chat Completions
-
-<CodeGroup>
-
-```javascript Default
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- messages: [{ role: "system", content: "You are a helpful assistant." }],
- model: "gpt-3.5-turbo",
- });
-
- console.log(completion.choices[0]);
-}
-
-main();
-```
-
-```javascript Image Input
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const response = await openai.chat.completions.create({
- model: "gpt-4-vision-preview",
- messages: [
- {
- role: "user",
- content: [
- { type: "text", text: "What’s in this image?" },
- {
- type: "image_url",
- image_url:
- "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
- },
- ],
- },
- ],
- });
- console.log(response.choices[0]);
-}
-main();
-```
-
-```javascript Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- model: "gpt-3.5-turbo",
- messages: [
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- stream: true,
- });
-
- for await (const chunk of completion) {
- console.log(chunk.choices[0].delta.content);
- }
-}
-
-main();
-```
-
-```javascript Functions
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];
- const tools = [
- {
- "type": "function",
- "function": {
- "name": "get_current_weather",
- "description": "Get the current weather in a given location",
- "parameters": {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and state, e.g. San Francisco, CA",
- },
- "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
- },
- "required": ["location"],
- },
- }
- }
- ];
-
- const response = await openai.chat.completions.create({
- model: "gpt-3.5-turbo",
- messages: messages,
- tools: tools,
- tool_choice: "auto",
- });
-
- console.log(response);
-}
-
-main();
-```
-
-```javascript LogProbs
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- messages: [{ role: "user", content: "Hello!" }],
- model: "gpt-3.5-turbo",
- logprobs: true,
- top_logprobs: 2,
- });
-
- console.log(completion.choices[0]);
-}
-
-main();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/openai/chatCompletions.mdx b/docs/0.0.3/dokumetry/node/examples/openai/chatCompletions.mdx
deleted file mode 100644
index 3d7ea2d3..00000000
--- a/docs/0.0.3/dokumetry/node/examples/openai/chatCompletions.mdx
+++ /dev/null
@@ -1,53 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor OpenAI Completions API Usage'
----
-
-## Completions
-<CodeGroup>
-```javascript No Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.completions.create({
- model: "gpt-3.5-turbo-instruct",
- prompt: "Say this is a test.",
- max_tokens: 7,
- temperature: 0,
- });
-
- console.log(completion);
-}
-main();
-```
-
-```javascript Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const stream = await openai.completions.create({
- model: "gpt-3.5-turbo-instruct",
- prompt: "Say this is a test.",
- stream: true,
- });
-
- for await (const chunk of stream) {
- console.log(chunk.choices[0].text)
- }
-}
-main();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/openai/embeddings.mdx b/docs/0.0.3/dokumetry/node/examples/openai/embeddings.mdx
deleted file mode 100644
index 7ecf6b51..00000000
--- a/docs/0.0.3/dokumetry/node/examples/openai/embeddings.mdx
+++ /dev/null
@@ -1,28 +0,0 @@
----
-title: 'Embeddings'
-description: 'Monitor OpenAI Embeddings API usage'
----
-
-## Create Embeddings
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const embedding = await openai.embeddings.create({
- model: "text-embedding-ada-002",
- input: "The quick brown fox jumped over the lazy dog",
- encoding_format: "float",
- });
-
- console.log(embedding);
-}
-
-main();
-```
diff --git a/docs/0.0.3/dokumetry/node/examples/openai/fine-tuning.mdx b/docs/0.0.3/dokumetry/node/examples/openai/fine-tuning.mdx
deleted file mode 100644
index 513a8575..00000000
--- a/docs/0.0.3/dokumetry/node/examples/openai/fine-tuning.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 'Fine Tuning'
-description: 'Monitor OpenAI Fine Tuning API usage'
----
-
-## Create Fine Tuning Job
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const fineTune = await openai.fineTuning.jobs.create({
- training_file: "file-abc123"
- });
-
- console.log(fineTune);
-}
-
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/examples/openai/image.mdx b/docs/0.0.3/dokumetry/node/examples/openai/image.mdx
deleted file mode 100644
index 06b196ab..00000000
--- a/docs/0.0.3/dokumetry/node/examples/openai/image.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: 'Image'
-description: 'Monitor OpenAI Image API usage'
----
-
-## Create Image
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });
-
- console.log(image.data);
-}
-main();
-```
-
-## Create Image Variation
-```javascript
-import fs from "fs";
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const image = await openai.images.createVariation({
- image: fs.createReadStream("otter.png"),
- });
-
- console.log(image.data);
-}
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/node/introduction.mdx b/docs/0.0.3/dokumetry/node/introduction.mdx
deleted file mode 100644
index 8b285e34..00000000
--- a/docs/0.0.3/dokumetry/node/introduction.mdx
+++ /dev/null
@@ -1,125 +0,0 @@
----
-title: 'Introduction'
-description: 'Monitor your NodeJS LLM Application with DokuMetry'
----
-
-DokuMetry Node SDK is the official library from Doku to send LLM usage data from your NodeJS application to Doku.
-
-## Installation
-``` shell shell
-npm install dokumetry
-```
-
-## Usage
-
-### OpenAI
-
-```javascript openai.js
-import OpenAI from 'openai';
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI({
- apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]
-});
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const chatCompletion = await openai.chat.completions.create({
- messages: [{ role: 'user', content: 'What are the key to effective observability?' }],
- model: 'gpt-3.5-turbo',
- });
-}
-
-main();
-```
-
-The following OpenAI Endpoints are supported for monitoring with DokuMetry
-
-- [Chat completions](/0.0.3/dokumetry/node/examples/openai/chat)
-- [Image Create](/0.0.3/dokumetry/node/examples/openai/image#create-image) and [Image Variations](/0.0.3/dokumetry/node/examples/openai/image#create-image-variation)
-- [Audio Speech Create](/0.0.3/dokumetry/node/examples/openai/audio)
-- [Embeddings](/0.0.3/dokumetry/node/examples/openai/embeddings)
-- [Fine Tunings](/0.0.3/dokumetry/node/examples/openai/fine-tuning)
-- [Completions](/0.0.3/dokumetry/node/examples/openai/chatCompletions)
-
-### Cohere
-
-```javascript cohere.js
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- apiKey: "YOUR_API_KEY",
-});
-
-// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-(async () => {
- const prediction = await cohere.generate({
- prompt: "hello",
- maxTokens: 10,
- });
-
- console.log("Received prediction", prediction);
-})();
-```
-
-The following Cohere Endpoints are supported for monitoring with DokuMetry
-
-- [Chat](/0.0.3/dokumetry/node/examples/cohere/chat)
-- [Generate](/0.0.3/dokumetry/node/examples/cohere/generate)
-- [Summarize](/0.0.3/dokumetry/node/examples/cohere/summarize)
-- [Embed](/0.0.3/dokumetry/node/examples/cohere/embed)
-
-### Anthropic
-
-```javascript anthropic.js
-import Anthropic from '@anthropic-ai/sdk';
-import DokuMetry from 'dokumetry';
-
-const anthropic = new Anthropic({
- apiKey: 'my api key', // defaults to process.env["ANTHROPIC_API_KEY"]
-});
-
-// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await anthropic.completions.create({
- model: 'claude-2',
- max_tokens_to_sample: 300,
- prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,
- });
-}
-
-main();
-```
-
-The following Anthropic Endpoints are supported for monitoring with DokuMetry
-
-- [Completions](/0.0.3/dokumetry/node/examples/anthropic/anthropic-completions)
-
-## Parameters
-
-| Parameter | Description | Required |
-|-------------------|-----------------------------------------------------------|---------------|
-| llm | Language Learning Model (LLM) Object to track | Yes |
-| dokuUrl | URL of your Doku Instance | Yes |
-| apiKey | Your Doku API key | Yes |
-| environment | Custom environment tag to include in your metrics | Optional |
-| applicationName | Custom application name tag for your metrics | Optional |
-| skipResp | Skip response from the Doku Ingester for faster execution | Optional |
-
-## Advanced Usage
-When using DokuMetry in Production environments, It is recommened to set `skipResp: True` for faster porcessing.
-
-To filter your LLM Usage according application or the environment, set the `application` and `environment` parameters with the actual values.
-
-
-## Requirements
-NodeJS >= 18.0 is supported.
-
-If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/anthropic/anthropic-completions.mdx b/docs/0.0.3/dokumetry/python/examples/anthropic/anthropic-completions.mdx
deleted file mode 100644
index b2ea104b..00000000
--- a/docs/0.0.3/dokumetry/python/examples/anthropic/anthropic-completions.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor Anthropic Completions API Usage'
----
-
-## Completions
-
-```javascript
-from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
-import dokumetry
-
-anthropic = Anthropic(
- # defaults to os.environ.get("ANTHROPIC_API_KEY")
- api_key="my_api_key",
-)
-
-# Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = anthropic.completions.create(
- model="claude-2",
- max_tokens_to_sample=300,
- prompt=f"{HUMAN_PROMPT} Hello, Claude{AI_PROMPT}",
-)
-print(completion.completion)
-```
-
diff --git a/docs/0.0.3/dokumetry/python/examples/cohere/chat.mdx b/docs/0.0.3/dokumetry/python/examples/cohere/chat.mdx
deleted file mode 100644
index d8f8fb92..00000000
--- a/docs/0.0.3/dokumetry/python/examples/cohere/chat.mdx
+++ /dev/null
@@ -1,52 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor Cohere Chat API usage'
----
-
-## Chat
-<CodeGroup>
-
-```python No Streaming
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.chat(
- chat_history=[
- {"role": "USER", "message": "Who discovered gravity?"},
- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
- ],
- message="What year was he born?",
- # perform web search before answering the question. You can also use your own custom connector.
- connectors=[{"id": "web-search"}]
-)
-print(response)
-```
-
-```python Streaming
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.chat(
- chat_history=[
- {"role": "USER", "message": "Who discovered gravity?"},
- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
- ],
- message="What year was he born?",
- stream=True,
- # perform web search before answering the question. You can also use your own custom connector.
- connectors=[{"id": "web-search"}]
-)
-print(response)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/cohere/co-summarize.mdx b/docs/0.0.3/dokumetry/python/examples/cohere/co-summarize.mdx
deleted file mode 100644
index c9bfcc05..00000000
--- a/docs/0.0.3/dokumetry/python/examples/cohere/co-summarize.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: 'Summarize'
-description: 'Monitor Cohere Summarize API usage'
----
-
-## Summarize
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-text=(
- "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
- "It may be made from milk or cream and is flavoured with a sweetener, "
- "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
- "or with fruit such as strawberries or peaches. "
- "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
- "Food coloring is sometimes added, in addition to stabilizers. "
- "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
- "and to prevent detectable ice crystals from forming. The result is a smooth, "
- "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
- "It becomes more malleable as its temperature increases.\n\n"
- "The meaning of the name \"ice cream\" varies from one country to another. "
- "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
- "and most governments regulate the commercial use of the various terms according to the "
- "relative quantities of the main ingredients, notably the amount of cream. "
- "Products that do not meet the criteria to be called ice cream are sometimes labelled "
- "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
- "one word is used fo\r all variants. Analogues made from dairy alternatives, "
- "such as goat's or sheep's milk, or milk substitutes "
- "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
- "lactose intolerant, allergic to dairy protein or vegan."
-)
-
-response = co.summarize(
- text=text,
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/cohere/embed.mdx b/docs/0.0.3/dokumetry/python/examples/cohere/embed.mdx
deleted file mode 100644
index 05900ae2..00000000
--- a/docs/0.0.3/dokumetry/python/examples/cohere/embed.mdx
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: 'Embed'
-description: 'Monitor Cohere Embed API usage'
----
-
-## Embed
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.embed(
- texts=['hello', 'goodbye'],
- model='embed-english-v3.0',
- input_type='classification'
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/cohere/generate.mdx b/docs/0.0.3/dokumetry/python/examples/cohere/generate.mdx
deleted file mode 100644
index b137a0c9..00000000
--- a/docs/0.0.3/dokumetry/python/examples/cohere/generate.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Generate'
-description: 'Monitor Cohere Generate API usage'
----
-
-## Generate
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.generate(
- prompt='Please explain to me how LLMs work',
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/openai/audio.mdx b/docs/0.0.3/dokumetry/python/examples/openai/audio.mdx
deleted file mode 100644
index c927bb36..00000000
--- a/docs/0.0.3/dokumetry/python/examples/openai/audio.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: 'Audio'
-description: 'Monitor OpenAI Audio API usage'
----
-
-## Create Speech
-
-```python
-from pathlib import Path
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-speech_file_path = Path(__file__).parent / "speech.mp3"
-response = client.audio.speech.create(
- model="tts-1",
- voice="alloy",
- input="The quick brown fox jumped over the lazy dog."
-)
-response.stream_to_file(speech_file_path)
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/openai/chat.mdx b/docs/0.0.3/dokumetry/python/examples/openai/chat.mdx
deleted file mode 100644
index 5c97d068..00000000
--- a/docs/0.0.3/dokumetry/python/examples/openai/chat.mdx
+++ /dev/null
@@ -1,143 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor OpenAI Chat Completions API usage'
----
-
-## Chat Completions
-
-<CodeGroup>
-
-```python Default
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ]
-)
-
-print(completion.choices[0].message)
-```
-
-```python Image Input
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = client.chat.completions.create(
- model="gpt-4-vision-preview",
- messages=[
- {
- "role": "user",
- "content": [
- {"type": "text", "text": "What’s in this image?"},
- {
- "type": "image_url",
- "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
- },
- ],
- }
- ],
- max_tokens=300,
-)
-
-print(response.choices[0])
-```
-
-```python Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- stream=True
-)
-
-for chunk in completion:
- print(chunk.choices[0].delta)
-```
-
-```python Functions
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-tools = [
- {
- "type": "function",
- "function": {
- "name": "get_current_weather",
- "description": "Get the current weather in a given location",
- "parameters": {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and state, e.g. San Francisco, CA",
- },
- "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
- },
- "required": ["location"],
- },
- }
- }
-]
-messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=messages,
- tools=tools,
- tool_choice="auto"
-)
-
-print(completion)
-```
-
-```python LogProbs
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "user", "content": "Hello!"}
- ],
- logprobs=True,
- top_logprobs=2
-)
-
-print(completion.choices[0].message)
-print(completion.choices[0].logprobs)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/openai/completions.mdx b/docs/0.0.3/dokumetry/python/examples/openai/completions.mdx
deleted file mode 100644
index ab3beb87..00000000
--- a/docs/0.0.3/dokumetry/python/examples/openai/completions.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor OpenAI Completions API Usage'
----
-
-## Completions
-<CodeGroup>
-```python No Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.completions.create(
- model="gpt-3.5-turbo-instruct",
- prompt="Say this is a test",
- max_tokens=7,
- temperature=0
-)
-```
-
-```python Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-for chunk in client.completions.create(
- model="gpt-3.5-turbo-instruct",
- prompt="Say this is a test",
- max_tokens=7,
- temperature=0,
- stream=True
-):
-
-print(chunk.choices[0].text)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/openai/embeddings.mdx b/docs/0.0.3/dokumetry/python/examples/openai/embeddings.mdx
deleted file mode 100644
index 6c22743a..00000000
--- a/docs/0.0.3/dokumetry/python/examples/openai/embeddings.mdx
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: 'Embeddings'
-description: 'Monitor OpenAI Embeddings API usage'
----
-
-## Create Embeddings
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.embeddings.create(
- model="text-embedding-ada-002",
- input="The food was delicious and the waiter...",
- encoding_format="float"
-)
-```
diff --git a/docs/0.0.3/dokumetry/python/examples/openai/fine-tuning.mdx b/docs/0.0.3/dokumetry/python/examples/openai/fine-tuning.mdx
deleted file mode 100644
index 4de9f9c7..00000000
--- a/docs/0.0.3/dokumetry/python/examples/openai/fine-tuning.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Fine Tuning'
-description: 'Monitor OpenAI Fine Tuning API usage'
----
-
-## Create Fine Tuning Job
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.fine_tuning.jobs.create(
- training_file="file-abc123",
- model="gpt-3.5-turbo"
-)
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/examples/openai/image.mdx b/docs/0.0.3/dokumetry/python/examples/openai/image.mdx
deleted file mode 100644
index 87df73ea..00000000
--- a/docs/0.0.3/dokumetry/python/examples/openai/image.mdx
+++ /dev/null
@@ -1,40 +0,0 @@
----
-title: 'Image'
-description: 'Monitor OpenAI Image API usage'
----
-
-## Create Image
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.images.generate(
- model="dall-e-3",
- prompt="A cute baby sea otter",
- n=1,
- size="1024x1024"
-)
-```
-
-## Create Image Variation
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = client.images.create_variation(
- image=open("image_edit_original.png", "rb"),
- n=2,
- size="1024x1024"
-)
-```
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/python/introduction.mdx b/docs/0.0.3/dokumetry/python/introduction.mdx
deleted file mode 100644
index fd7b2cfa..00000000
--- a/docs/0.0.3/dokumetry/python/introduction.mdx
+++ /dev/null
@@ -1,119 +0,0 @@
----
-title: 'Introduction'
-description: 'Monitor your Python LLM Application with DokuMetry'
----
-
-DokuMetry Python SDK is the official library from Doku to send LLM usage data from your Python application to Doku.
-
-## Installation
-``` shell shell
-pip install dokumetry
-```
-
-## Usage
-
-### OpenAI
-
-``` python openai.py
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI(
- api_key="YOUR_OPENAI_KEY"
-)
-
-# Pass the above `client` object along with your Doku URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-chat_completion = client.chat.completions.create(
- messages=[
- {
- "role": "user",
- "content": "What is LLM Observability",
- }
- ],
- model="gpt-3.5-turbo",
-)
-```
-
-The following OpenAI Endpoints are supported for monitoring with DokuMetry
-
-- [Chat completions](/0.0.3/dokumetry/python/examples/openai/chat)
-- [Image Create](/0.0.3/dokumetry/python/examples/openai/image#create-image) and [Image Variations](/0.0.3/dokumetry/python/examples/openai/image#create-image-variation)
-- [Audio Speech Create](/0.0.3/dokumetry/python/examples/openai/audio)
-- [Embeddings](/0.0.3/dokumetry/python/examples/openai/embeddings)
-- [Fine Tunings](/0.0.3/dokumetry/python/examples/openai/fine-tuning)
-- [Completions](/0.0.3/dokumetry/python/examples/openai/completions)
-
-### Cohere
-
-```python cohere.py
-import cohere
-import dokumetry
-
-# initialize the Cohere Client with an API Key
-co = cohere.Client('YOUR_API_KEY')
-
-# Pass the above `co` object along with your Doku URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-# generate a prediction for a prompt
-prediction = co.chat(message='What is LLM Observability?', model='command')
-
-# print the predicted text
-print(f'Chatbot: {prediction.text}')
-```
-
-The following Cohere Endpoints are supported for monitoring with DokuMetry
-
-- [Chat](/0.0.3/dokumetry/python/examples/cohere/chat)
-- [Generate](/0.0.3/dokumetry/python/examples/cohere/generate)
-- [Summarize](/0.0.3/dokumetry/python/examples/cohere/co-summarize)
-- [Embed](/0.0.3/dokumetry/python/examples/cohere/embed)
-
-### Anthropic
-
-```python anthropic.py
-from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
-import dokumetry
-
-anthropic = Anthropic(
- # defaults to os.environ.get("ANTHROPIC_API_KEY")
- api_key="my api key",
-)
-
-# Pass the above `anthropic` object along with your Doku URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = anthropic.completions.create(
- model="claude-2",
- max_tokens_to_sample=300,
- prompt=f"{HUMAN_PROMPT} What is LLM Observability?{AI_PROMPT}",
-)
-print(completion.completion)
-```
-
-The following Anthropic Endpoints are supported for monitoring with DokuMetry
-
-- [Completions](/0.0.3/dokumetry/python/examples/anthropic/anthropic-completions.mdx)
-
-## Parameters
-
-| Parameter | Description | Required |
-|-------------------|-----------------------------------------------------------|---------------|
-| llm | Language Learning Model (LLM) Object to track | Yes |
-| doku_url | URL of your Doku Instance | Yes |
-| api_key | Your Doku API key | Yes |
-| environment | Custom environment tag to include in your metrics | Optional |
-| application_name | Custom application name tag for your metrics | Optional |
-| skip_resp | Skip response from the Doku Ingester for faster execution | Optional |
-
-## Advanced Usage
-When using DokuMetry in Production environments, It is recommened to set `skip_resp = true` for faster porcessing.
-
-To filter your LLM Usage according application or the environment, set the `application` and `environment` paramaters with the actual values.
-
-## Requirements
-Python >= 3.7 is supported.
-
-If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).
\ No newline at end of file
diff --git a/docs/0.0.3/installation.mdx b/docs/0.0.3/installation.mdx
deleted file mode 100644
index 4dc36459..00000000
--- a/docs/0.0.3/installation.mdx
+++ /dev/null
@@ -1,273 +0,0 @@
----
-title: 'Installing Doku'
-description: 'Deploy Doku in your preferred environment'
-icon: 'circle-down'
----
-
-Doku flexibly adapts to your preferred environment. Select a deployment method that best fits your setup:
-
-<CardGroup cols={2}>
- <Card
- title="Kubernetes"
- icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>Kubernetes</title>
- <path fill="#FFA500" d="M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"/></svg>}
- href="/0.0.3/installation#kubernetes"
- >
- Deploy Doku in a Kubernetes Cluster using Helm
- </Card>
- <Card
- title="Docker"
- icon="docker"
- href="/0.0.3/installation#docker"
- >
- Deploy Doku using docker compose
- </Card>
- <Card
- title="Linux"
- icon="linux"
- href="/0.0.3/installation#linux"
- >
- Deploy Doku in a Linux Host
- </Card>
- <Card
- title="Windows"
- icon="windows"
- href="/0.0.3/installation#windows"
- >
- Deploy Doku in a Windows Host
- </Card>
-</CardGroup>
-
-## Kubernetes
-
-Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://github.com/dokulabs/helm/tree/main/charts/doku) for a reliable and scalable solution.
-<Steps>
- <Step title="Helm Repo Setup">
- ```shell shell
- helm repo add dokulabs https://dokulabs.github.io/helm/
- helm repo update
- ```
- </Step>
- <Step title="Installing the Helm Chart">
- ```shell shell
- helm install doku dokulabs/doku --version 0.0.9
- ```
- </Step>
-</Steps>
-<Info>As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [values.yaml](https://github.com/dokulabs/helm/blob/main/charts/doku/values.yaml) file. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.</Info>
-
-## Docker
-Quickly spin up Doku using Docker for a fast and straightforward setup.
-
-<Steps>
- <Step title="Install TimescaleDB">
- <Steps>
- <Step title="Pull TimescaleDB Image">
- ```shell
- docker pull timescale/timescaledb-ha:pg14-ts2.14
- ```
- </Step>
- <Step title="Run TimescaleDB Image">
- ```shell
- docker run -d --name timescaledb -p 127.0.0.1:5432:5432 \
- -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg14-ts2.14
- ```
- </Step>
- </Steps>
- </Step>
- <Step title="Install Doku">
- <Steps>
- <Step title="Pull Doku Image">
- ```shell
- docker pull ghcr.io/dokulabs/doku-ingester:0.0.3
- ```
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.3/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Run the Doku Image">
- ```shell
- docker run -d --name doku -p 127.0.0.3:9044:9044 -v /doku.yml:/doku.yml dokulabs/ingester:0.0.3 --config /doku.yml
- ```
- </Step>
- </Steps>
- </Step>
-</Steps>
-
-## Linux
-<Steps>
- <Step title="Install TimescaleDB">
- Follow the Instructions [here](https://docs.timescale.com/self-hosted/latest/install/installation-linux/#installing-self-hosted-timescaledb-on-debian-based-systems) to install TimescaleDB in your Linux host.
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.3/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Install Doku in a linux Host">
- <Tabs>
- <Tab title="Linux">
- <CodeGroup>
- ```shell amd64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.3/ingester-linux-amd64
- chmod +x ingester-linux-amd64
- ./ingester-linux-amd64 --config doku.yml
- ```
-
- ```shell arm64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.3/ingester-linux-arm64
- chmod +x ingester-linux-arm64
- ./ingester-linux-arm64 --config doku.yml
- ```
-
- ```shell arm
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.3/ingester-linux-arm
- chmod +x ingester-linux-arm
- ./ingester-linux-arm --config doku.yml
- ```
-
- ```shell ppc64le
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.3/ingester-linux-ppc64le
- chmod +x ingester-linux-ppc64le
- ./ingester-linux-ppc64le --config doku.yml
- ```
- </CodeGroup>
- </Tab>
- <Tab title="Darwin">
- <CodeGroup>
- ```shell amd64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.3/ingester-darwin-amd64
- chmod +x ingester-darwin-amd64
- ./ingester-darwin-amd64 --config doku.yml
- ```
-
- ```shell arm64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.3/ingester-darwin-arm64
- chmod +x ingester-darwin-arm64
- ./ingester-darwin-arm64 --config doku.yml
- ```
- </CodeGroup>
- </Tab>
- </Tabs>
- </Step>
-</Steps>
-
-## Windows
-<Steps>
- <Step title="Install TimescaleDB">
- <Steps>
- Download and install the Visual C++ Redistributable for Visual Studio from [www.microsoft.com](https://www.microsoft.com/en-us/download/details.aspx?id=48145).
-
- Download and install PostgreSQL from [www.postgresql.org](https://www.postgresql.org/download/windows/). You might need to add the `pg_config` file location to your path. In the Windows Search tool, search for `system environment variables`. The path should be `C:\Program Files\PostgreSQL\<version>\bin`.
-
- Download the TimescaleDB installation `.zip` file from [Windows releases](https://docs.timescale.com/self-hosted/latest/install/installation-windows/#windows-releases).
-
- Locate the downloaded file on your local file system, and extract the files.
-
- In the extracted TimescaleDB directory, right-click the `setup.exe` file and select `Run as Administrator` to start the installer.
- </Steps>
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- observabilityPlatform:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `observabilityPlatform` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.3/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Install Doku in a Windows Host">
- <CodeGroup>
- ```shell amd64
- invoke-WebRequest -Uri "https://github.com/dokulabs/doku/releases/download/0.0.3/ingester-windows-amd64" -OutFile "ingester.exe"
- .\ingester.exe --config doku.yml
- ```
-
- ```shell 386
- invoke-WebRequest -Uri "https://github.com/dokulabs/doku/releases/download/0.0.3/ingester-windows-386" -OutFile "ingester.exe"
- .\ingester.exe --config doku.yml
- ```
- </CodeGroup>
- </Step>
-</Steps>
-
diff --git a/docs/0.0.3/introduction.mdx b/docs/0.0.3/introduction.mdx
deleted file mode 100644
index 5700c986..00000000
--- a/docs/0.0.3/introduction.mdx
+++ /dev/null
@@ -1,111 +0,0 @@
----
-title: What is Doku?
-description: 'Monitor and evalute your LLM Applications'
----
-
-Doku is an open-source observability tool engineered for Large Language Models (LLMs). Designed for ease of integration into existing LLM applications, Doku offers unparalleled insights into usage, performance, and overhead—allowing you to analyze, optimize, and scale your AI applications and LLM usage effectively.
-
-Whether you're working with OpenAI, Cohere, or Anthropic, It tracks all your LLM requests transparently and conveys the insights needed to make data-driven decisions. From monitoring usage and understanding latencies to managing costs and collaborating effortlessly, Doku grants you the lens to view your models in high definition.
-
-## How it works
-
-<Frame>
- <img src="https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif" />
-</Frame>
-### Application Integration with Two Lines of Code
-Start by incorporating the DokuMetry SDK into your application. With SDKs tailored for both Python and NodeJS, Doku fits into your tech stack with minimal changes. Just a **two lines** of code is all it takes to begin:
-
-For Python and NodeJS projects, just import the DokuMetry SDK and initialize it as follows:
- <CodeGroup>
- ```python python
- import dokumetry
- dokumetry.init(llm=openai, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
- ```
-
- ```javascript NodeJS
- import DokuMetry from 'dokumetry';
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
- ```
- </CodeGroup>
-Find detailed instructions at the [DokuMetry SDK Documentation](/0.0.3/dokumetry/introduction).
-
-### The Doku Ingester: Your Data Processing Workhorse
-
-Upon SDK setup, data from your LLM operations is automatically collected. The DokuMetry SDKs transmit this usage data over HTTP in the background to the [Doku Ingester](https://github.com/dokulabs/doku/tree/main/src/ingester#readme).
-
-The ingester is the core engine where the magic happens:
-- **Data Collection**: Effortlessly captures live data from your LLM interactions without complicating your existing codebase.
-- **Cost Analysis**: Enriches your data with cost considerations, providing a financial perspective to your analytics.
-- **Secure Storage**: All processed information is securely stored in TimescaleDB, providing you with a scalable, time-series database that can handle large volumes of observability data.
-
-You have the choice to set up a fresh TimescaleDB instance or connect Doku to your existing one. Whichever path you choose, your data resides within your control, reinforcing your data security and operational compliance.
-
-## Features
-Leveraging Doku, you can get:
-
-- **In-depth LLM Monitoring**: Track every request to LLM platforms like OpenAI with precision, ensuring comprehensive visibility over your model's interactions.
-- **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.
-- **Connect to Observability Platforms**: Export LLM Observablity data and insights from Doku to popular observability platforms such as Grafana Cloud or Datadog.
-- **Team-centric Workflow**: Enhance team collaboration with seamless data sharing capabilities, creating an integrated environment for observability-driven teamwork.
-
-## Supported LLM Platforms
-<CardGroup cols={3}>
- <Card
- title="OpenAI"
- icon={
- <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>OpenAI</title>
- <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Cohere"
- icon={
- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">
- <g>
- <g>
- <g>
- <path d="M24.3,44.7c2,0,6-0.1,11.6-2.4c6.5-2.7,19.3-7.5,28.6-12.5c6.5-3.5,9.3-8.1,9.3-14.3C73.8,7,66.9,0,58.3,0
- h-36C10,0,0,10,0,22.3S9.4,44.7,24.3,44.7z">
- </path>
- <path d="M30.4,60c0-6,3.6-11.5,9.2-13.8l11.3-4.7C62.4,36.8,75,45.2,75,57.6C75,67.2,67.2,75,57.6,75l-12.3,0
- C37.1,75,30.4,68.3,30.4,60z">
- </path>
- <path d="M12.9,47.6L12.9,47.6C5.8,47.6,0,53.4,0,60.5v1.7C0,69.2,5.8,75,12.9,75h0c7.1,0,12.9-5.8,12.9-12.9v-1.7
- C25.7,53.4,20,47.6,12.9,47.6z">
- </path>
- </g>
- </g>
- </g>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Anthropic"
- icon={
- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">
- <path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path>
- <path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
-</CardGroup>
-
-## Getting Started
-Select from the following guides to learn more about how to use Doku:
-
-<CardGroup cols={2}>
-<Card title="Quickstart" href="/0.0.3/quickstart" icon='bolt'>
-Get Started with monitoring your LLM Applications in 3 simple steps
-</Card>
-<Card title="Connections" href="/0.0.3/connections/intro" icon='connectdevelop'>
-Connect to your existing Observablity Platform
-</Card>
-</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/quickstart.mdx b/docs/0.0.3/quickstart.mdx
deleted file mode 100644
index 66a85fed..00000000
--- a/docs/0.0.3/quickstart.mdx
+++ /dev/null
@@ -1,150 +0,0 @@
----
-title: 'Quickstart'
-description: 'Quickly start **monitoring** your **LLM Applications** in just **two lines** of code'
-icon: 'bolt'
----
-
-This guide will walk you through setting up your monitoring system with minimal effort. In just a few steps, you'll be able to track and analyze the performance and usage of your Large Language Model (LLM) applications.
-
-## Prerequistes
-- Ensure you have access to a **Kubernetes Cluster**. You can quickly spin up a Kubernetes Cluster using [Kind](https://github.com/kubernetes-sigs/kind?tab=readme-ov-file#installation-and-usage)
-
-## Get Started
-
-<Steps>
- <Step title="Install Doku in a Kubernetes Cluster">
- <Steps>
- <Step title="Helm Repo Setup">
- ```shell shell
- helm repo add dokulabs https://dokulabs.github.io/helm/
- helm repo update
- ```
- </Step>
- <Step title="Installing the Helm Chart">
- ```shell shell
- helm install doku dokulabs/doku --version 0.0.9
- ```
- </Step>
- </Steps>
- </Step>
- <Step title="Generate an API Key">
- With Doku running, the next step is to [generate an API key](/0.0.3/api-reference/endpoint/api-keys/create) for secure communication between your applications and Doku.
-
- To generate your first API key, you can use the following command:
-
- ```shell shell
- curl --request POST \
- --url https://<your-doku-url>/api/keys \
- --header 'Authorization: ""' \
- --header 'Content-Type: application/json' \
- --data '{
- "name": "Admin"
- }'
- ```
-
- Make sure to store the returned API key securely, as it's necessary for authorizing future API calls with Doku.
-
- <Info>
- During your initial request to generate an API key, you can leave the Authorization header empty (i.e., `""`). For subsequent requests, you will need to supply the generated API key.
- </Info>
-
- </Step>
- <Step title="Instrument your code">
- Choose the appropriate SDK for your application's programming language and follow the steps to integrate monitoring with just a couple of lines of code.
- <Tabs>
- <Tab title="Python">
- <Steps>
- <Step title="Install the dokumetry Python SDK using pip">
- ```shell
- pip install dokumetry
- ```
- </Step>
- <Step title="Add the following two lines to your application code:">
- Add the snippet below to your Python application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.
-
- ```python
- import dokumetry
-
- dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
- ```
-
- Example Usage for monitoring `OpenAI` Usage:
-
- ```python
- from openai import OpenAI
- import dokumetry
-
- client = OpenAI(
- api_key="YOUR_OPENAI_KEY"
- )
-
- # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
- dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
- chat_completion = client.chat.completions.create(
- messages=[
- {
- "role": "user",
- "content": "What is LLM Observability",
- }
- ],
- model="gpt-3.5-turbo",
- )
- ```
-
- Refer to the `dokumetry` [Python SDK repository](https://github.com/dokulabs/dokumetry-python) or the [DokuMetry Docs](/0.0.3/dokumetry/python/introduction) for more advanced configurations and use cases.
- </Step>
- </Steps>
- </Tab>
- <Tab title="NodeJS">
- <Steps>
- <Step title="Install the dokumetry NodeJS SDK using npm">
- ```shell
- npm install dokumetry
- ```
- </Step>
- <Step title="Add the following two lines to your application code">
- Add the snippet below to your NodeJS application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.
- ```javascript
- import DokuMetry from 'dokumetry';
-
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
- ```
-
- Example Usage for monitoring `OpenAI` Usage:
-
- ```javascript
- import OpenAI from 'openai';
- import DokuMetry from 'dokumetry';
-
- const openai = new OpenAI({
- apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]
- });
-
- // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- async function main() {
- const chatCompletion = await openai.chat.completions.create({
- messages: [{ role: 'user', content: 'What are the key to effective observability?' }],
- model: 'gpt-3.5-turbo',
- });
- }
-
- main();
- ```
-
- Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dokumetry-node) or the [DokuMetry Docs](/0.0.3/dokumetry/node/introduction) for more advanced configurations and use cases.
- </Step>
- </Steps>
- </Tab>
- </Tabs>
- </Step>
-</Steps>
-
-## (Optional) Export Data
-<Card title="Connections" href="/0.0.3/connections/intro" icon='connectdevelop'>
-Connect to your existing Observablity Platform
-</Card>
-
-You're all set! Following these steps should have you on your way to effectively monitoring your LLM applications. If you have any questions or need support, reach out to our [community](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA).
\ No newline at end of file
diff --git a/docs/0.0.4/api-reference/endpoint/api-keys/create.mdx b/docs/0.0.4/api-reference/endpoint/api-keys/create.mdx
deleted file mode 100644
index cce6cecf..00000000
--- a/docs/0.0.4/api-reference/endpoint/api-keys/create.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'Create API Key'
-openapi: 'POST /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.4/api-reference/endpoint/api-keys/delete.mdx b/docs/0.0.4/api-reference/endpoint/api-keys/delete.mdx
deleted file mode 100644
index fbb9e963..00000000
--- a/docs/0.0.4/api-reference/endpoint/api-keys/delete.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'Delete API Key'
-openapi: 'DELETE /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.4/api-reference/endpoint/api-keys/get.mdx b/docs/0.0.4/api-reference/endpoint/api-keys/get.mdx
deleted file mode 100644
index 3ecec318..00000000
--- a/docs/0.0.4/api-reference/endpoint/api-keys/get.mdx
+++ /dev/null
@@ -1,4 +0,0 @@
----
-title: 'GET API Key'
-openapi: 'GET /api/keys'
----
\ No newline at end of file
diff --git a/docs/0.0.4/api-reference/introduction.mdx b/docs/0.0.4/api-reference/introduction.mdx
deleted file mode 100644
index 7834f304..00000000
--- a/docs/0.0.4/api-reference/introduction.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: 'Introduction'
-description: 'OpenAPI specification for API Endpoints in Doku'
----
-
-<Card
- title="API Keys Endpoints"
- icon="key"
- href="/0.0.4/api-reference/endpoint/api-keys/create"
->
- View the documentation for API Keys
-</Card>
-
-## Authentication
-
-All API endpoints are authenticated using Authetication Header.
-
-```json
-Authorization: <api-key>
-```
-
-<Info>
-For your initial API call, Authorization header can be set to "".
-Store the provided API key securely; it will be required to pass the generated and a valid API Key in Authorization header for subsequent API calls.
-</Info>
\ No newline at end of file
diff --git a/docs/0.0.4/api-reference/openiapi.yml b/docs/0.0.4/api-reference/openiapi.yml
deleted file mode 100644
index f1c7dc5b..00000000
--- a/docs/0.0.4/api-reference/openiapi.yml
+++ /dev/null
@@ -1,100 +0,0 @@
-openapi: 3.0.0
-info:
- title: API Keys Service
- description: This service manages API keys through GET, POST, and DELETE operations.
- version: "0.0.2"
-
-servers:
- - url: https://127.0.0.1:9044/
-
-paths:
- /api/keys:
- get:
- summary: Get a list of API keys
- operationId: getApiKeys
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '200':
- description: A list of API keys
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
- post:
- summary: Create a new API key
- operationId: createApiKey
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '201':
- description: API key created
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
- delete:
- summary: Delete an API key
- operationId: deleteApiKey
- tags:
- - API Key
- security:
- - ApiKeyAuth: []
- requestBody:
- required: true
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/APIKeyRequest'
- responses:
- '200':
- description: API key deleted
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/jsonResponse'
-
-components:
- schemas:
- APIKeyRequest:
- type: object
- required:
- - name
- properties:
- name:
- type: string
-
- jsonResponse:
- type: object
- required:
- - status
- - message
- properties:
- status:
- type: integer
- message:
- type: string
-
- securitySchemes:
- ApiKeyAuth:
- type: apiKey
- in: header
- name: Authorization
\ No newline at end of file
diff --git a/docs/0.0.4/configuration.mdx b/docs/0.0.4/configuration.mdx
deleted file mode 100644
index a21edab2..00000000
--- a/docs/0.0.4/configuration.mdx
+++ /dev/null
@@ -1,262 +0,0 @@
----
-title: 'Configuration'
-description: 'Configuring Options for Doku'
-icon: 'sliders'
----
-
-This document outlines the various options available for configuring Doku.
-For ease of use and clarity, we recommend naming the configuration file `doku.yml`
-
-
-## Properties
-
-<ResponseField name="ingesterPort" type="String">
- The `ingesterPort` specifies the network port that the Ingestion Server will listen to for incoming data. You can set this to any available port on your system.
-
-**Example**:
-```yaml
-ingesterPort: 9044
-```
-</ResponseField>
-
-<ResponseField name="retentionPeriod" type="String">
- The `retentionPeriod` field indicates how long the LLM Monitoring data will be stored before it is deleted. For example, you can specify a retention period of "6 months" to keep the data for six months before it is automatically removed.
-
-**Example**:
-```yaml
-retentionPeriod: "6 months"
-```
-</ResponseField>
-
-### Pricing Information Source
-
-<ResponseField name="pricingInfo" type="Object">
- Doku supports using either a local file or a URL to retrieve LLM Pricing data. Comment out the option you do not wish to use.
-</ResponseField>
-
-<Info>
-We strongly recommend using the `url` method with the value set as `https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json`.
-
-This ensures that you automatically retrieve the latest pricing information upon each startup, as the developers at Doku consistently refresh the pricing file with current data from OpenAI, Cohere and Anthropic.
-</Info>
-
-<ResponseField name="local_file" type="Object">
- Local File containing the Pricing Information JSON
- <Expandable title="properties">
- <ResponseField name="path" type="String">
- Specify the local file system path to a JSON file containing the LLM Pricing data.
- </ResponseField>
- </Expandable>
-
- **Example**:
- ```yaml
- pricingInfo:
- localFile:
- path: "/assets/pricing.json"
- ```
-</ResponseField>
-
-<ResponseField name="url" type="String">
- Provide the URL where the pricing data JSON file can be downloaded. Ensure the given URL is accessible.
-
- **Example**:
- ```yaml
- pricingInfo:
- url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json"
- ```
-</ResponseField>
-
-
-### Database Configuration
-
-<ResponseField name="dbConfig" type="Object">
- Configure the database connection details to connect Doku with TimescaleDB (or another Postgres compatible DB).
- <Expandable title="properties">
- <ResponseField name="name" type="String">
- Database name.
- </ResponseField>
- <ResponseField name="username" type="String">
- The username for the database.
- </ResponseField>
- <ResponseField name="password" type="String">
- The password for the database.
- </ResponseField>
- <ResponseField name="host" type="String">
- Host address for the database.
- </ResponseField>
- <ResponseField name="port" type="String">
- Network port for the database connection.
- </ResponseField>
- <ResponseField name="sslMode" type="String">
- The SSL mode for the database connection (e.g., "require" if SSL is needed).
- </ResponseField>
- <ResponseField name="maxOpenConns" type="String">
- Maximum number of concurrent open database connections.
- </ResponseField>
- <ResponseField name="maxIdleConns" type="String">
- Maximum number of idle database connections.
- </ResponseField>
- <ResponseField name="dataTable" type="String">
- Name of the table to store LLM Data.
- </ResponseField>
- <ResponseField name="apiKeyTable" type="String">
- Name of the table to store API Keys.
- </ResponseField>
- </Expandable>
-
- **Example**:
- ```yaml
- dbConfig:
- name: "mydatabase"
- username: "myusername"
- password: "mypassword"
- host: "mydbhost.example.com"
- port: 5432
- sslMode: "require"
- maxOpenConns: 15
- maxIdleConns: 10
- dataTable: "llm_data"
- apiKeyTable: "api_keys"
- ```
-</ResponseField>
-
-
-### Connections Configuration
-
-<ResponseField name="connections" type="Object">
- Choose the external platform you wish to use for exporting observability data from Doku and set `enabled` to `true`. Fill in the required fields for the chosen platform. Only one platform can be selected at a time.
-
- The following sections show example configurations for different platforms - Grafana Cloud, New Relic, and DataDog. You will need to uncomment the applicable section and provide necessary credentials such as URLs, User IDs, and API Keys corresponding to your account on the observability platform.
- <Expandable title="properties">
- <ResponseField name="enabled" type="boolean">
- Boolean parameter to configure external Observability Platform
- </ResponseField>
- <ResponseField name="grafanaCloud" type="Object">
- Configuration for connecting Doku with Grafana Cloud.
- <Expandable title="properties">
- <ResponseField name="promUrl" type="String">
- URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance.
- </ResponseField>
- <ResponseField name="promUsername" type="String">
- Prometheus User ID of the Grafana Cloud Prometheus Instance.
- </ResponseField>
- <ResponseField name="lokiUrl" type="String">
- URL of the Loki Push URL of the Grafana Cloud Loki Instance.
- </ResponseField>
- <ResponseField name="lokiUsername" type="String">
- Loki Username of the Grafana Cloud Loki Instance.
- </ResponseField>
- <ResponseField name="accessToken" type="String">
- Access Token of the Grafana Cloud Instance.
- </ResponseField>
- **Example**:
- ```yaml
- connections:
- enabled: true
- grafanaCloud:
- promUrl: "https://your-grafana-prometheus-url"
- promUsername: "your-prom-user-id"
- lokiUrl: "https://your-grafana-loki-url"
- lokiUsername: "your-loki-user-id"
- accessToken: "your-grafana-cloud-access-token"
- ```
- </Expandable>
- </ResponseField>
- <ResponseField name="datadog" type="Object">
- Configuration for connecting Doku with DataDog.
- <Expandable title="properties">
- <ResponseField name="metricsUrl" type="String">
- URL to the DataDog Metrics API.
- </ResponseField>
- <ResponseField name="logsUrl" type="String">
- URL to the DataDog Logs API.
- </ResponseField>
- <ResponseField name="apiKey" type="String">
- API Key of the DataDog Account.
- </ResponseField>
- **Example**:
- ```yaml
- connections:
- enabled: true
- datadog:
- metricsUrl: "https://api.datadoghq.com/api/v1/series"
- logsUrl: "https://http.logs.datadoghq.com/api/v2/logs"
- apiKey: "datadog-api-key"
- ```
- </Expandable>
- </ResponseField>
- <ResponseField name="newRelic" type="Object">
- Configuration for connecting Doku with New Relic.
- <Expandable title="properties">
- <ResponseField name="metricsUrl" type="String">
- URL to the New Relic Metric API.
- </ResponseField>
- <ResponseField name="logsUrl" type="String">
- URL to the New Relic Log API.
- </ResponseField>
- <ResponseField name="apiKey" type="String">
- Ingest API Key of the New Relic Account.
- </ResponseField>
- **Example**:
- ```yaml
- connections:
- enabled: true
- newRelic:
- metricsUrl: "https://metric-api.newrelic.com/metric/v1"
- logsUrl: "https://log-api.newrelic.com/log/v1"
- apiKey: "newrelic-api-key"
- ```
- </Expandable>
- </ResponseField>
- </Expandable>
-</ResponseField>
-
-Ensure that the file is correctly formatted in YAML and all necessary fields are populated based on your deployment needs. Save the file and restart the Doku service to apply the new configuration.
-
-## Example Configuration File
-
-```yaml doku.yml
-ingesterPort: 9044 # Port to run the Ingestion Server on, Example: 9044
-
-retentionPeriod: "6 months" # Retention Period for the LLM Data, Example: "24 hours", "7 days", "6 months"
-
-# Comment out either 'localFile' or 'url' to use only one at a time.
-pricingInfo:
- # localFile:
- # path: "/assets/pricing.json" # Path to local JSON file with LLM Pricing data
- url: "https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json" # URL to download Pricing data file
-
-# Configuration for the Doku Backend Database (TimescaleDB)
-dbConfig:
- name: "DBNAME" # Name of the database, Example: "postgres"
- username: "USERNAME" # Username to connect to the database, Example: "admin"
- password: "PASSWORD" # Password to connect to the database, Example: "DOKU"
- host: "HOSTURL" # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
-# Configure Platform to export LLM Observability Data from Doku
-# Only one platform can be enabled at a time, To enable a platform, set enabled to true and fill in the required fields for that platform.
-connections:
- enabled: false # Enable or Disable the Observability Platform, Example: true
- # grafanaCloud:
- # promUrl: "influx-line-proxy-url" # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance
- # promUsername: "prometheus-userid" # Prometheus User ID of the Grafana Cloud Prometheus Instance
- # lokiUrl: "loki-push-url" # URL to the Loki Push URL of the Grafana Cloud Loki Instance
- # lokiUsername: "loki-username" # Loki Username of the Grafana Cloud Loki Instance
- # accessToken: "grafana-cloud-access-token" # Access Token of the Grafana Cloud Instance
-
- # newRelic:
- # metricsUrl: "https://metric-api.newrelic.com/metric/v1" # URL to the New Relic Metric API
- # logsUrl: "https://log-api.newrelic.com/log/v1" # URL to the New Relic Log API
- # key: "newrelic-api-key" # Ingest API Key of the New Relic Account
-
- # datadog:
- # metricsUrl: "https://api.datadoghq.com/api/v1/series" # URL to the DataDog Metrics API
- # logsUrl: "https://http.logs.datadoghq.com/api/v2/logs" # URL to the DataDog Logs API
- # apiKey: "datadog-api-key" # API Key of the DataDog Account
-```
\ No newline at end of file
diff --git a/docs/0.0.4/connections/grafanaoss.mdx b/docs/0.0.4/connections/grafanaoss.mdx
deleted file mode 100644
index ce236a73..00000000
--- a/docs/0.0.4/connections/grafanaoss.mdx
+++ /dev/null
@@ -1,1846 +0,0 @@
----
-title: 'Grafana OSS'
-description: 'Connect Doku to Grafana OSS'
----
-
-<Frame>
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-1.jpg?raw=true" />
- <img src="https://github.com/dokulabs/doku/blob/main/docs/images/grafana-dashboard-3.jpg?raw=true" />
-</Frame>
-
-You can add the Doku's backend storage database (`TimescaleDB`) as a datasource in Grafana.
-
-## Steps
-
-1. Navigate to your Grafana Instance.
-1. Login with your credentials.
-1. Click on the **Connection** on the left sidebar to open the **Data Sources**.
-1. Click the **Add data source** button.
-1. In the search box, type "PostgreSQL" as `TimescaleDB` is an extension of PostgreSQL
-1.In the settings form, fill in the details to connect to your TimescaleDB/PostgreSQL database:
- - **Name**: Enter the name for the datasource as `Doku`.
- - **Host**: Provide the host address and port of your PostgreSQL server (e.g., `127.0.0.1`).
- - **Database**: Enter the name of the database. Default database used by Doku is `postgres`.
- - **TLS/SSL Setiing**: Enter the securtity to use for connection. Default used by Doku is `require`.
- - **User**: The username for the database. Default user used by Doku is `admin`.
- - **Password**: The password for the database. Default password used by Doku is `Doku`.
-1. Optionally customize the **Max open connections**, **Max idle connections**, and **Connection Max Lifetime**.
-1. Click the **Save & Test** button at the bottom of the page.
-
-Grafana will attempt to connect to the database using the provided settings. If everything is configured correctly, you will see a message indicating the data source is working.
-
-## Grafana Resources
-
-<Accordion title="Dashboard">
- ```json
- {
- "annotations": {
- "list": [
- {
- "builtIn": 1,
- "datasource": {
- "type": "grafana",
- "uid": "-- Grafana --"
- },
- "enable": true,
- "hide": true,
- "iconColor": "rgba(0, 211, 255, 1)",
- "name": "Annotations & Alerts",
- "type": "dashboard"
- }
- ]
- },
- "editable": true,
- "fiscalYearStartMonth": 0,
- "graphTooltip": 0,
- "id": 8,
- "links": [
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Documentation",
- "tooltip": "",
- "type": "link",
- "url": "https://grafana.com/docs/grafana/latest/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Doku Community",
- "tooltip": "",
- "type": "link",
- "url": "https://dokulabs.slack.com/"
- },
- {
- "icon": "info",
- "tags": [],
- "targetBlank": true,
- "title": "Dokulabs GitHub",
- "tooltip": "",
- "type": "link",
- "url": "https://github.com/dokulabs/"
- }
- ],
- "liveNow": false,
- "panels": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 0,
- "y": 0
- },
- "id": 23,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 2,
- "x": 11,
- "y": 0
- },
- "id": 2,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "![Doku Logo](https://github.com/dokulabs/.github/blob/main/profile/assets/favicon.png?raw=true)",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "gridPos": {
- "h": 4,
- "w": 11,
- "x": 13,
- "y": 0
- },
- "id": 22,
- "options": {
- "code": {
- "language": "plaintext",
- "showLineNumbers": false,
- "showMiniMap": false
- },
- "content": "---\n---\n---\n---\n---\n---",
- "mode": "markdown"
- },
- "pluginVersion": "10.2.3",
- "transparent": true,
- "type": "text"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the total number of requests sent to Large Language Models (LLM) Platforms in the selected time interval.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "yellow",
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 4
- },
- "id": 3,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT count(*) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "COUNT",
- "parameters": [
- {
- "name": "environment",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Requests",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average time taken to process each request by the Large Language Models (LLM), offering a snapshot of system performance and efficiency.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "s"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 6,
- "y": 4
- },
- "id": 4,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(requestduration) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "requestduration",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Request Duration",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Total tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 1000
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 10,
- "y": 4
- },
- "id": 5,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(totaltokens) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Tokens per Request",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average cost incurred per request to the LLM, helping monitor and optimize budget allocation for LLM usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "thresholds"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 4,
- "x": 14,
- "y": 4
- },
- "id": 6,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(usagecost) FROM DOKU_LLM_DATA \nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Cost / Request",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the total cost on LLM requests over the selected period.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-BlPu"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 18,
- "y": 4
- },
- "id": 10,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT SUM(usagecost) FROM DOKU_LLM_DATA\nWHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "SUM",
- "parameters": [
- {
- "name": "usagecost",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Cost",
- "transparent": true,
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the count of API requests made to LLMs over the selected time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic-by-name"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 100,
- "gradientMode": "opacity",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineStyle": {
- "dash": [
- 10,
- 10
- ],
- "fill": "dash"
- },
- "lineWidth": 2,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "always",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green",
- "value": null
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 5,
- "w": 24,
- "x": 0,
- "y": 7
- },
- "id": 17,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT\n DATE_TRUNC('day', \"time\") AS \"time\",\n COUNT(endpoint) AS total_requests\nFROM \n DOKU_LLM_DATA\nWHERE\n $__timeFilter(\"time\")\nGROUP BY \n DATE_TRUNC('day', \"time\")\nORDER BY \n \"time\";",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Total Requests / Day",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel illustrates the distribution of LLM requests across different usage categories: Chat Generations, Embeddings, Image Generations, Audio Generations, and Fine Tuning. It visualizes the relative volume of requests, helping to identify which types of operations are most frequently performed and providing insights into usage patterns by category.\n\n",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": []
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 0,
- "y": 12
- },
- "id": 12,
- "options": {
- "displayLabels": [
- "name",
- "percent"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [],
- "fields": "/^requests$/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \n category,\n CAST(COUNT(*) AS INTEGER) AS Requests,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage\n FROM \n (\n SELECT \n CASE\n WHEN endpoint LIKE 'openai.chat%' THEN 'Chat'\n WHEN endpoint LIKE 'openai.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'anthropic.completions%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.summarize%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.generate%' THEN 'Chat'\n WHEN endpoint LIKE 'cohere.chat%' THEN 'Chat'\n WHEN endpoint LIKE '%embed%' THEN 'Embeddings'\n WHEN endpoint LIKE 'openai.images%' THEN 'Image'\n WHEN endpoint LIKE 'openai.audio%' THEN 'Audio'\n WHEN endpoint LIKE 'openai.fine_tuning%' THEN 'Fine Tuning'\n END AS category,\n endpoint\n FROM DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n ) AS subquery\n GROUP BY category",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage by Category",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Displays the cost breakdown by provider (OpenAI, Cohere, Anthropic) for LLM requests, offering insights into financial deployment across different services.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 6,
- "y": 12
- },
- "id": 16,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false,
- "values": []
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [],
- "fields": "/.*/",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "asc"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT\n CASE\n WHEN endpoint LIKE 'openai.%' THEN 'OpenAI'\n WHEN endpoint LIKE 'cohere.%' THEN 'Cohere'\n WHEN endpoint LIKE 'anthropic.%' THEN 'Anthropic'\n END AS provider,\n SUM(usageCost) AS total_cost\nFROM\n DOKU_LLM_DATA\nWHERE $__timeFilter(time)\nGROUP BY\n provider\nORDER BY\n total_cost DESC;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Provider",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel presents a pie chart detailing the distribution of expenses for LLM requests by various applications. It shows how budget allocations are consumed by different applications, enabling a deeper understanding of cost drivers and facilitating cost optimization efforts.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 12,
- "y": 12
- },
- "id": 18,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "uniqueValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": " SELECT\n applicationName,\n sum(usageCost) AS \"usageCost\"\n FROM\n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY\n applicationName\n ORDER BY\n \"usageCost\" DESC",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Application",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Visualizes the allocation of LLM request expenses across different environments, such as development, staging, and production. This breakdown helps in tracking and managing costs with respect to operational environments.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- }
- },
- "mappings": [],
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 9,
- "w": 6,
- "x": 18,
- "y": 12
- },
- "id": 19,
- "options": {
- "displayLabels": [
- "name",
- "value"
- ],
- "legend": {
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": false
- },
- "pieType": "pie",
- "reduceOptions": {
- "calcs": [
- "uniqueValues"
- ],
- "fields": "",
- "values": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": " SELECT\n environment,\n sum(usageCost) AS \"usageCost\"\n FROM\n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY\n environment\n ORDER BY\n \"usageCost\" DESC",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- }
- }
- ],
- "title": "Usage cost by Environment",
- "transparent": true,
- "type": "piechart"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Prompt tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 21
- },
- "id": 9,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(prompttokens) FROM DOKU_LLM_DATA WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Prompt Tokens / Request",
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Provides a time-series analysis of token consumption for LLM requests, highlighting trends in usage intensity and complexity over time.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "series",
- "axisGridShow": true,
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 10,
- "gradientMode": "hue",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": 86400000,
- "lineInterpolation": "linear",
- "lineStyle": {
- "fill": "solid"
- },
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "never",
- "spanNulls": true,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "fieldMinMax": false,
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 18,
- "x": 6,
- "y": 21
- },
- "id": 11,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT prompttokens AS \"Prompt Tokens\", \"time\" AS \"time\", completiontokens AS \"Completion Tokens\", totaltokens AS \"Total Tokens\" FROM DOKU_LLM_DATA",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "alias": "\"Prompt Tokens\"",
- "parameters": [
- {
- "name": "prompttokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"time\"",
- "parameters": [
- {
- "name": "\"time\"",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Completion Tokens\"",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "alias": "\"Total Tokens\"",
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Token usage",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "This panel shows the average count of Completion tokens used per LLM request",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 5
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 3,
- "w": 6,
- "x": 0,
- "y": 24
- },
- "id": 7,
- "options": {
- "colorMode": "background",
- "graphMode": "area",
- "justifyMode": "auto",
- "orientation": "auto",
- "reduceOptions": {
- "calcs": [
- "lastNotNull"
- ],
- "fields": "",
- "values": false
- },
- "textMode": "auto",
- "wideLayout": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT AVG(completiontokens) FROM DOKU_LLM_DATA WHERE \n $__timeFilter(\"time\")",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "name": "AVG",
- "parameters": [
- {
- "name": "completiontokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Avg Completion Tokens / Request",
- "type": "stat"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Displays the frequency of model usage over time, identifying the most utilised models and showcasing usage trends across different periods",
- "fieldConfig": {
- "defaults": {
- "color": {
- "fixedColor": "purple",
- "mode": "continuous-YlBl"
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "none"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 0,
- "y": 27
- },
- "id": 13,
- "options": {
- "displayMode": "lcd",
- "maxVizHeight": 167,
- "minVizHeight": 10,
- "minVizWidth": 75,
- "namePlacement": "top",
- "orientation": "horizontal",
- "reduceOptions": {
- "calcs": [
- "sum"
- ],
- "fields": "/^total_count$/",
- "values": true
- },
- "showUnfilled": true,
- "sizing": "manual",
- "valueMode": "text"
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \n model,\n total_count,\n percentage_usage\nFROM \n (\n SELECT \n model,\n COUNT(*) AS total_count,\n ROUND(100.0 * COUNT(*) / SUM(COUNT(*)) OVER(), 2) AS percentage_usage\n FROM \n DOKU_LLM_DATA\n WHERE $__timeFilter(time)\n GROUP BY \n model\n ORDER BY \n percentage_usage DESC\n ) sub\nLIMIT 5;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Top models by usage",
- "type": "bargauge"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Breaks down token usage across different LLM models, offering insights into which models are driving the highest token consumption.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic"
- },
- "custom": {
- "axisBorderShow": false,
- "axisCenteredZero": false,
- "axisColorMode": "text",
- "axisLabel": "",
- "axisPlacement": "auto",
- "barAlignment": 0,
- "drawStyle": "line",
- "fillOpacity": 0,
- "gradientMode": "none",
- "hideFrom": {
- "legend": false,
- "tooltip": false,
- "viz": false
- },
- "insertNulls": false,
- "lineInterpolation": "linear",
- "lineWidth": 1,
- "pointSize": 5,
- "scaleDistribution": {
- "type": "linear"
- },
- "showPoints": "auto",
- "spanNulls": false,
- "stacking": {
- "group": "A",
- "mode": "none"
- },
- "thresholdsStyle": {
- "mode": "off"
- }
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- }
- },
- "overrides": []
- },
- "gridPos": {
- "h": 6,
- "w": 12,
- "x": 12,
- "y": 27
- },
- "id": 14,
- "options": {
- "legend": {
- "calcs": [],
- "displayMode": "list",
- "placement": "bottom",
- "showLegend": true
- },
- "tooltip": {
- "mode": "single",
- "sort": "none"
- }
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "time_series",
- "rawQuery": true,
- "rawSql": "SELECT \n DATE_TRUNC('day', \"time\") AS \"time\",\n model,\n COUNT(*) AS \"Model:\"\nFROM \n DOKU_LLM_DATA\nWHERE \n $__timeFilter(\"time\")\nGROUP BY \n 1, model\nORDER BY \n \"time\" ASC, model;",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "model",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "Model usage by day",
- "type": "timeseries"
- },
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "description": "Table showing prompts and responses along with their associated costs and token usage.",
- "fieldConfig": {
- "defaults": {
- "color": {
- "mode": "palette-classic-by-name"
- },
- "custom": {
- "align": "center",
- "cellOptions": {
- "mode": "gradient",
- "type": "color-background"
- },
- "filterable": true,
- "inspect": true
- },
- "mappings": [],
- "thresholds": {
- "mode": "absolute",
- "steps": [
- {
- "color": "green"
- },
- {
- "color": "red",
- "value": 80
- }
- ]
- },
- "unit": "currencyUSD"
- },
- "overrides": []
- },
- "gridPos": {
- "h": 8,
- "w": 24,
- "x": 0,
- "y": 33
- },
- "id": 15,
- "options": {
- "cellHeight": "sm",
- "footer": {
- "countRows": false,
- "fields": "",
- "reducer": [
- "sum"
- ],
- "show": false
- },
- "showHeader": true
- },
- "pluginVersion": "10.2.3",
- "targets": [
- {
- "datasource": {
- "type": "grafana-postgresql-datasource",
- "uid": "${datasource}"
- },
- "editorMode": "code",
- "format": "table",
- "rawQuery": true,
- "rawSql": "SELECT \"time\", applicationName, model, prompt, response, usageCost FROM DOKU_LLM_DATA WHERE $__timeFilter(time)",
- "refId": "A",
- "sql": {
- "columns": [
- {
- "parameters": [
- {
- "name": "endpoint",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "prompt",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "response",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- },
- {
- "parameters": [
- {
- "name": "totaltokens",
- "type": "functionParameter"
- }
- ],
- "type": "function"
- }
- ],
- "groupBy": [
- {
- "property": {
- "type": "string"
- },
- "type": "groupBy"
- }
- ],
- "limit": 50
- },
- "table": "doku"
- }
- ],
- "title": "User Activity",
- "transparent": true,
- "type": "table"
- }
- ],
- "refresh": "",
- "schemaVersion": 39,
- "tags": [
- "Doku",
- "OpenAI",
- "Cohere",
- "Anthropic"
- ],
- "templating": {
- "list": [
- {
- "current": {
- "selected": true,
- "text": "grafana-postgresql-datasource",
- "value": "dbd38750-cf8a-4f35-a031-af943c441f1d"
- },
- "hide": 0,
- "includeAll": false,
- "label": "Datasource",
- "multi": false,
- "name": "datasource",
- "options": [],
- "query": "grafana-postgresql-datasource",
- "queryValue": "",
- "refresh": 1,
- "regex": "",
- "skipUrlSync": false,
- "type": "datasource"
- }
- ]
- },
- "time": {
- "from": "now-7d",
- "to": "now"
- },
- "timepicker": {},
- "timezone": "",
- "title": "Doku - LLM Monitoring",
- "uid": "doku-llm-monitoring",
- "version": 1,
- "weekStart": ""
- }
- ```
-</Accordion>
-
diff --git a/docs/0.0.4/connections/intro.mdx b/docs/0.0.4/connections/intro.mdx
deleted file mode 100644
index 45246bec..00000000
--- a/docs/0.0.4/connections/intro.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Introduction'
-description: 'Connect to your existing Observablity Platform'
----
-
-Doku streamlines the observability experience by delivering processed LLM data right to the observability platform you are already familiar with. We recognize how crucial it is for developers to aggregate all application-related data, encompassing LLM usage metrics, into a single source of truth.
-
-This integration allows you to visualize and assess your entire application landscape in one integrated Observability platform, thereby refining your monitoring approaches and sharpening your decision-making.
-
-Below is a list of observability platforms that work seamlessly with Doku, allowing for integrated and expanded insights.
-
-<CardGroup cols={2}>
- <Card title="Grafana OSS" href="/0.0.4/connections/grafanaoss" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
- </Card>
- <Card title="Grafana Cloud" href="/0.0.4/connections/grafanacloud" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
- </Card>
- <Card title="DataDog" href="/0.0.4/connections/datadog" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Datadog</title><path d="M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"/></svg>}>
- </Card>
- <Card title="New Relic" href="/0.0.4/connections/new-relic" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>New Relic</title><path d="M8.0015 14.3091v7.384L12.0008 24V12.0008L1.6078 5.9996v4.6167ZM12.0008 0 2.8232 5.2976 6.8209 7.606l5.1799-2.9893 6.3936 3.6913v7.384l-5.1783 2.9908v4.6167l9.176-5.2991V5.9996Z"/></svg>}>
- </Card>
-</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/introduction.mdx b/docs/0.0.4/dokumetry/introduction.mdx
deleted file mode 100644
index 27ac65e1..00000000
--- a/docs/0.0.4/dokumetry/introduction.mdx
+++ /dev/null
@@ -1,74 +0,0 @@
----
-title: 'Overview'
-description: 'Seamlessly send LLM usage data to Doku'
----
-
-[DokuMetry SDK](https://www.npmjs.com/package/dokumetry) (`dokumetry`) empowers you to effortlessly track and monitor language learning model (LLM) usage data and metrics from your Python/NodeJS code. It seamlessly integrates with major LLM Platforms:
-
-
-DokuMetry SDKs can currently track and monitor API usage for the below platforms
-<CardGroup cols={3}>
- <Card
- title="OpenAI"
- icon={
- <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>OpenAI</title>
- <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Cohere"
- icon={
- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">
- <g>
- <g>
- <g>
- <path d="M24.3,44.7c2,0,6-0.1,11.6-2.4c6.5-2.7,19.3-7.5,28.6-12.5c6.5-3.5,9.3-8.1,9.3-14.3C73.8,7,66.9,0,58.3,0
- h-36C10,0,0,10,0,22.3S9.4,44.7,24.3,44.7z">
- </path>
- <path d="M30.4,60c0-6,3.6-11.5,9.2-13.8l11.3-4.7C62.4,36.8,75,45.2,75,57.6C75,67.2,67.2,75,57.6,75l-12.3,0
- C37.1,75,30.4,68.3,30.4,60z">
- </path>
- <path d="M12.9,47.6L12.9,47.6C5.8,47.6,0,53.4,0,60.5v1.7C0,69.2,5.8,75,12.9,75h0c7.1,0,12.9-5.8,12.9-12.9v-1.7
- C25.7,53.4,20,47.6,12.9,47.6z">
- </path>
- </g>
- </g>
- </g>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Anthropic"
- icon={
- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">
- <path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path>
- <path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
-</CardGroup>
-
-All LLM observability data collected by DokuMetry is sent directly to the Doku Platform for streamlined tracking.
-
-## Features
-
-- **Effortless Setup:** Integrate full-featured LLM usage monitoring into your application with just two lines of code.
-- **Efficient Performance:** Designed for near-zero latency impact, allowing your applications to run smoothly without compromise.
-- **Secure and Reliable**: DokuMetry SDKs prioritize the safety and integrity of your data. All data transmission to Doku is conducted over secure HTTP, ensuring that your observability data is protected during transit.
-
-## Supported Languages
-
-<CardGroup cols={2}>
-<Card title="Python" href="/0.0.4/dokumetry/python" icon="python">
-</Card>
-<Card title="NodeJS" href="/0.0.4/dokumetry/node" icon="node-js">
-</Card>
-</CardGroup>
diff --git a/docs/0.0.4/dokumetry/node/examples/anthropic/anthropic-completions.mdx b/docs/0.0.4/dokumetry/node/examples/anthropic/anthropic-completions.mdx
deleted file mode 100644
index 6fbff10e..00000000
--- a/docs/0.0.4/dokumetry/node/examples/anthropic/anthropic-completions.mdx
+++ /dev/null
@@ -1,29 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor Anthropic Completions API Usage'
----
-
-## Completions
-
-```javascript
-import Anthropic from '@anthropic-ai/sdk';
-import DokuMetry from 'dokumetry';
-
-const anthropic = new Anthropic({
- apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]
-});
-
-// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await anthropic.completions.create({
- model: 'claude-2',
- max_tokens_to_sample: 300,
- prompt: `${Anthropic.HUMAN_PROMPT} Hello, Claude{Anthropic.AI_PROMPT}`,
- });
- console.log(completion.completion);
-}
-main().catch(console.error);
-```
-
diff --git a/docs/0.0.4/dokumetry/node/examples/cohere/chat.mdx b/docs/0.0.4/dokumetry/node/examples/cohere/chat.mdx
deleted file mode 100644
index fdc6a559..00000000
--- a/docs/0.0.4/dokumetry/node/examples/cohere/chat.mdx
+++ /dev/null
@@ -1,60 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor Cohere Chat API usage'
----
-
-## Chat
-<CodeGroup>
-
-```javascript No Streaming
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const response = await cohere.chat({
- message: 'Say this is a test',
- model: 'command',
- });
-
- console.log(response)
-})();
-```
-
-```javascript Streaming
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const chatStream = await cohere.chatStream({
- chatHistory: [
- { role: "USER", message: "Who discovered gravity?" },
- { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }
- ],
- message: "What year was he born?",
- // perform web search before answering the question. You can also use your own custom connector.
- connectors: [{ id: "web-search" }],
- });
-
- for await (const message of chatStream) {
- if (message.eventType === "text-generation") {
- console.log(message);
- }
- }
-})();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/examples/cohere/embed.mdx b/docs/0.0.4/dokumetry/node/examples/cohere/embed.mdx
deleted file mode 100644
index e11ba206..00000000
--- a/docs/0.0.4/dokumetry/node/examples/cohere/embed.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: 'Embed'
-description: 'Monitor Cohere Embed API usage'
----
-
-## Embed
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const embed = await cohere.embed({
- texts: ["hello", "goodbye"],
- model: "embed-english-v3.0",
- inputType: "classification",
- });
- console.log(embed);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/examples/cohere/generate.mdx b/docs/0.0.4/dokumetry/node/examples/cohere/generate.mdx
deleted file mode 100644
index b48cdd1c..00000000
--- a/docs/0.0.4/dokumetry/node/examples/cohere/generate.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 'Generate'
-description: 'Monitor Cohere Generate API usage'
----
-
-## Generate
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const generate = await cohere.generate({
- prompt: "Please explain to me how LLMs work",
- });
-
- console.log(generate);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/examples/cohere/summarize.mdx b/docs/0.0.4/dokumetry/node/examples/cohere/summarize.mdx
deleted file mode 100644
index 32cfd261..00000000
--- a/docs/0.0.4/dokumetry/node/examples/cohere/summarize.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'Summarize'
-description: 'Monitor Cohere Summarize API usage'
----
-
-## Summarize
-
-```javascript
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- token: "<<apiKey>>",
-});
-
-(async () => {
- // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
- DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- const summarize = await cohere.summarize({
- text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
- + "It may be made from milk or cream and is flavoured with a sweetener, "
- + "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
- + "or with fruit such as strawberries or peaches. "
- + "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
- + "Food coloring is sometimes added, in addition to stabilizers. "
- + "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
- + "and to prevent detectable ice crystals from forming. The result is a smooth, "
- + "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
- + "It becomes more malleable as its temperature increases.\n\n"
- + "The meaning of the name \"ice cream\" varies from one country to another. "
- + "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
- + "and most governments regulate the commercial use of the various terms according to the "
- + "relative quantities of the main ingredients, notably the amount of cream. "
- + "Products that do not meet the criteria to be called ice cream are sometimes labelled "
- + "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
- + "one word is used fo\r all variants. Analogues made from dairy alternatives, "
- + "such as goat's or sheep's milk, or milk substitutes "
- + "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
- + "lactose intolerant, allergic to dairy protein or vegan.",
- });
-
- console.log(summarize);
-})();
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/examples/openai/audio.mdx b/docs/0.0.4/dokumetry/node/examples/openai/audio.mdx
deleted file mode 100644
index cd5c1107..00000000
--- a/docs/0.0.4/dokumetry/node/examples/openai/audio.mdx
+++ /dev/null
@@ -1,32 +0,0 @@
----
-title: 'Audio'
-description: 'Monitor OpenAI Audio API usage'
----
-
-## Create Speech
-
-```javascript
-import fs from "fs";
-import path from "path";
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-const speechFile = path.resolve("./speech.mp3");
-
-async function main() {
- const mp3 = await openai.audio.speech.create({
- model: "tts-1",
- voice: "alloy",
- input: "Today is a wonderful day to build something people love!",
- });
- console.log(speechFile);
- const buffer = Buffer.from(await mp3.arrayBuffer());
- await fs.promises.writeFile(speechFile, buffer);
-}
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/examples/openai/chat.mdx b/docs/0.0.4/dokumetry/node/examples/openai/chat.mdx
deleted file mode 100644
index 4400245f..00000000
--- a/docs/0.0.4/dokumetry/node/examples/openai/chat.mdx
+++ /dev/null
@@ -1,157 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor OpenAI Chat Completions API usage'
----
-
-## Chat Completions
-
-<CodeGroup>
-
-```javascript Default
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- messages: [{ role: "system", content: "You are a helpful assistant." }],
- model: "gpt-3.5-turbo",
- });
-
- console.log(completion.choices[0]);
-}
-
-main();
-```
-
-```javascript Image Input
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const response = await openai.chat.completions.create({
- model: "gpt-4-vision-preview",
- messages: [
- {
- role: "user",
- content: [
- { type: "text", text: "What’s in this image?" },
- {
- type: "image_url",
- image_url:
- "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
- },
- ],
- },
- ],
- });
- console.log(response.choices[0]);
-}
-main();
-```
-
-```javascript Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- model: "gpt-3.5-turbo",
- messages: [
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- stream: true,
- });
-
- for await (const chunk of completion) {
- console.log(chunk.choices[0].delta.content);
- }
-}
-
-main();
-```
-
-```javascript Functions
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];
- const tools = [
- {
- "type": "function",
- "function": {
- "name": "get_current_weather",
- "description": "Get the current weather in a given location",
- "parameters": {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and state, e.g. San Francisco, CA",
- },
- "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
- },
- "required": ["location"],
- },
- }
- }
- ];
-
- const response = await openai.chat.completions.create({
- model: "gpt-3.5-turbo",
- messages: messages,
- tools: tools,
- tool_choice: "auto",
- });
-
- console.log(response);
-}
-
-main();
-```
-
-```javascript LogProbs
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.chat.completions.create({
- messages: [{ role: "user", content: "Hello!" }],
- model: "gpt-3.5-turbo",
- logprobs: true,
- top_logprobs: 2,
- });
-
- console.log(completion.choices[0]);
-}
-
-main();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/examples/openai/chatCompletions.mdx b/docs/0.0.4/dokumetry/node/examples/openai/chatCompletions.mdx
deleted file mode 100644
index 3d7ea2d3..00000000
--- a/docs/0.0.4/dokumetry/node/examples/openai/chatCompletions.mdx
+++ /dev/null
@@ -1,53 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor OpenAI Completions API Usage'
----
-
-## Completions
-<CodeGroup>
-```javascript No Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await openai.completions.create({
- model: "gpt-3.5-turbo-instruct",
- prompt: "Say this is a test.",
- max_tokens: 7,
- temperature: 0,
- });
-
- console.log(completion);
-}
-main();
-```
-
-```javascript Streaming
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const stream = await openai.completions.create({
- model: "gpt-3.5-turbo-instruct",
- prompt: "Say this is a test.",
- stream: true,
- });
-
- for await (const chunk of stream) {
- console.log(chunk.choices[0].text)
- }
-}
-main();
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/examples/openai/embeddings.mdx b/docs/0.0.4/dokumetry/node/examples/openai/embeddings.mdx
deleted file mode 100644
index 7ecf6b51..00000000
--- a/docs/0.0.4/dokumetry/node/examples/openai/embeddings.mdx
+++ /dev/null
@@ -1,28 +0,0 @@
----
-title: 'Embeddings'
-description: 'Monitor OpenAI Embeddings API usage'
----
-
-## Create Embeddings
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const embedding = await openai.embeddings.create({
- model: "text-embedding-ada-002",
- input: "The quick brown fox jumped over the lazy dog",
- encoding_format: "float",
- });
-
- console.log(embedding);
-}
-
-main();
-```
diff --git a/docs/0.0.4/dokumetry/node/examples/openai/fine-tuning.mdx b/docs/0.0.4/dokumetry/node/examples/openai/fine-tuning.mdx
deleted file mode 100644
index 513a8575..00000000
--- a/docs/0.0.4/dokumetry/node/examples/openai/fine-tuning.mdx
+++ /dev/null
@@ -1,26 +0,0 @@
----
-title: 'Fine Tuning'
-description: 'Monitor OpenAI Fine Tuning API usage'
----
-
-## Create Fine Tuning Job
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const fineTune = await openai.fineTuning.jobs.create({
- training_file: "file-abc123"
- });
-
- console.log(fineTune);
-}
-
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/examples/openai/image.mdx b/docs/0.0.4/dokumetry/node/examples/openai/image.mdx
deleted file mode 100644
index 06b196ab..00000000
--- a/docs/0.0.4/dokumetry/node/examples/openai/image.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: 'Image'
-description: 'Monitor OpenAI Image API usage'
----
-
-## Create Image
-
-```javascript
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });
-
- console.log(image.data);
-}
-main();
-```
-
-## Create Image Variation
-```javascript
-import fs from "fs";
-import OpenAI from "openai";
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI();
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const image = await openai.images.createVariation({
- image: fs.createReadStream("otter.png"),
- });
-
- console.log(image.data);
-}
-main();
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/node/introduction.mdx b/docs/0.0.4/dokumetry/node/introduction.mdx
deleted file mode 100644
index 3fd9c0c2..00000000
--- a/docs/0.0.4/dokumetry/node/introduction.mdx
+++ /dev/null
@@ -1,125 +0,0 @@
----
-title: 'Introduction'
-description: 'Monitor your NodeJS LLM Application with DokuMetry'
----
-
-DokuMetry Node SDK is the official library from Doku to send LLM usage data from your NodeJS application to Doku.
-
-## Installation
-``` shell shell
-npm install dokumetry
-```
-
-## Usage
-
-### OpenAI
-
-```javascript openai.js
-import OpenAI from 'openai';
-import DokuMetry from 'dokumetry';
-
-const openai = new OpenAI({
- apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]
-});
-
-// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const chatCompletion = await openai.chat.completions.create({
- messages: [{ role: 'user', content: 'What are the key to effective observability?' }],
- model: 'gpt-3.5-turbo',
- });
-}
-
-main();
-```
-
-The following OpenAI Endpoints are supported for monitoring with DokuMetry
-
-- [Chat completions](/0.0.4/dokumetry/node/examples/openai/chat)
-- [Image Create](/0.0.4/dokumetry/node/examples/openai/image#create-image) and [Image Variations](/0.0.4/dokumetry/node/examples/openai/image#create-image-variation)
-- [Audio Speech Create](/0.0.4/dokumetry/node/examples/openai/audio)
-- [Embeddings](/0.0.4/dokumetry/node/examples/openai/embeddings)
-- [Fine Tunings](/0.0.4/dokumetry/node/examples/openai/fine-tuning)
-- [Completions](/0.0.4/dokumetry/node/examples/openai/chatCompletions)
-
-### Cohere
-
-```javascript cohere.js
-import { CohereClient } from "cohere-ai";
-import DokuMetry from 'dokumetry';
-
-const cohere = new CohereClient({
- apiKey: "YOUR_API_KEY",
-});
-
-// Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-(async () => {
- const prediction = await cohere.generate({
- prompt: "hello",
- maxTokens: 10,
- });
-
- console.log("Received prediction", prediction);
-})();
-```
-
-The following Cohere Endpoints are supported for monitoring with DokuMetry
-
-- [Chat](/0.0.4/dokumetry/node/examples/cohere/chat)
-- [Generate](/0.0.4/dokumetry/node/examples/cohere/generate)
-- [Summarize](/0.0.4/dokumetry/node/examples/cohere/summarize)
-- [Embed](/0.0.4/dokumetry/node/examples/cohere/embed)
-
-### Anthropic
-
-```javascript anthropic.js
-import Anthropic from '@anthropic-ai/sdk';
-import DokuMetry from 'dokumetry';
-
-const anthropic = new Anthropic({
- apiKey: 'my api key', // defaults to process.env["ANTHROPIC_API_KEY"]
-});
-
-// Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
-async function main() {
- const completion = await anthropic.completions.create({
- model: 'claude-2',
- max_tokens_to_sample: 300,
- prompt: `${Anthropic.HUMAN_PROMPT} how does a court case get to the Supreme Court?${Anthropic.AI_PROMPT}`,
- });
-}
-
-main();
-```
-
-The following Anthropic Endpoints are supported for monitoring with DokuMetry
-
-- [Completions](/0.0.4/dokumetry/node/examples/anthropic/anthropic-completions)
-
-## Parameters
-
-| Parameter | Description | Required |
-|-------------------|-----------------------------------------------------------|---------------|
-| llm | Language Learning Model (LLM) Object to track | Yes |
-| dokuUrl | URL of your Doku Instance | Yes |
-| apiKey | Your Doku API key | Yes |
-| environment | Custom environment tag to include in your metrics | Optional |
-| applicationName | Custom application name tag for your metrics | Optional |
-| skipResp | Skip response from the Doku Ingester for faster execution | Optional |
-
-## Advanced Usage
-When using DokuMetry in Production environments, It is recommened to set `skipResp: True` for faster porcessing.
-
-To filter your LLM Usage according application or the environment, set the `application` and `environment` parameters with the actual values.
-
-
-## Requirements
-NodeJS >= 18.0 is supported.
-
-If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/anthropic/anthropic-completions.mdx b/docs/0.0.4/dokumetry/python/examples/anthropic/anthropic-completions.mdx
deleted file mode 100644
index b2ea104b..00000000
--- a/docs/0.0.4/dokumetry/python/examples/anthropic/anthropic-completions.mdx
+++ /dev/null
@@ -1,27 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor Anthropic Completions API Usage'
----
-
-## Completions
-
-```javascript
-from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
-import dokumetry
-
-anthropic = Anthropic(
- # defaults to os.environ.get("ANTHROPIC_API_KEY")
- api_key="my_api_key",
-)
-
-# Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = anthropic.completions.create(
- model="claude-2",
- max_tokens_to_sample=300,
- prompt=f"{HUMAN_PROMPT} Hello, Claude{AI_PROMPT}",
-)
-print(completion.completion)
-```
-
diff --git a/docs/0.0.4/dokumetry/python/examples/cohere/chat.mdx b/docs/0.0.4/dokumetry/python/examples/cohere/chat.mdx
deleted file mode 100644
index d8f8fb92..00000000
--- a/docs/0.0.4/dokumetry/python/examples/cohere/chat.mdx
+++ /dev/null
@@ -1,52 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor Cohere Chat API usage'
----
-
-## Chat
-<CodeGroup>
-
-```python No Streaming
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.chat(
- chat_history=[
- {"role": "USER", "message": "Who discovered gravity?"},
- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
- ],
- message="What year was he born?",
- # perform web search before answering the question. You can also use your own custom connector.
- connectors=[{"id": "web-search"}]
-)
-print(response)
-```
-
-```python Streaming
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.chat(
- chat_history=[
- {"role": "USER", "message": "Who discovered gravity?"},
- {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
- ],
- message="What year was he born?",
- stream=True,
- # perform web search before answering the question. You can also use your own custom connector.
- connectors=[{"id": "web-search"}]
-)
-print(response)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/cohere/co-summarize.mdx b/docs/0.0.4/dokumetry/python/examples/cohere/co-summarize.mdx
deleted file mode 100644
index c9bfcc05..00000000
--- a/docs/0.0.4/dokumetry/python/examples/cohere/co-summarize.mdx
+++ /dev/null
@@ -1,44 +0,0 @@
----
-title: 'Summarize'
-description: 'Monitor Cohere Summarize API usage'
----
-
-## Summarize
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-text=(
- "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
- "It may be made from milk or cream and is flavoured with a sweetener, "
- "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
- "or with fruit such as strawberries or peaches. "
- "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
- "Food coloring is sometimes added, in addition to stabilizers. "
- "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
- "and to prevent detectable ice crystals from forming. The result is a smooth, "
- "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
- "It becomes more malleable as its temperature increases.\n\n"
- "The meaning of the name \"ice cream\" varies from one country to another. "
- "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
- "and most governments regulate the commercial use of the various terms according to the "
- "relative quantities of the main ingredients, notably the amount of cream. "
- "Products that do not meet the criteria to be called ice cream are sometimes labelled "
- "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
- "one word is used fo\r all variants. Analogues made from dairy alternatives, "
- "such as goat's or sheep's milk, or milk substitutes "
- "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
- "lactose intolerant, allergic to dairy protein or vegan."
-)
-
-response = co.summarize(
- text=text,
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/cohere/embed.mdx b/docs/0.0.4/dokumetry/python/examples/cohere/embed.mdx
deleted file mode 100644
index 05900ae2..00000000
--- a/docs/0.0.4/dokumetry/python/examples/cohere/embed.mdx
+++ /dev/null
@@ -1,23 +0,0 @@
----
-title: 'Embed'
-description: 'Monitor Cohere Embed API usage'
----
-
-## Embed
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.embed(
- texts=['hello', 'goodbye'],
- model='embed-english-v3.0',
- input_type='classification'
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/cohere/generate.mdx b/docs/0.0.4/dokumetry/python/examples/cohere/generate.mdx
deleted file mode 100644
index b137a0c9..00000000
--- a/docs/0.0.4/dokumetry/python/examples/cohere/generate.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Generate'
-description: 'Monitor Cohere Generate API usage'
----
-
-## Generate
-
-```python
-import cohere
-import dokumetry
-
-co = cohere.Client('<<apiKey>>')
-
-# Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = co.generate(
- prompt='Please explain to me how LLMs work',
-)
-print(response)
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/openai/audio.mdx b/docs/0.0.4/dokumetry/python/examples/openai/audio.mdx
deleted file mode 100644
index c927bb36..00000000
--- a/docs/0.0.4/dokumetry/python/examples/openai/audio.mdx
+++ /dev/null
@@ -1,25 +0,0 @@
----
-title: 'Audio'
-description: 'Monitor OpenAI Audio API usage'
----
-
-## Create Speech
-
-```python
-from pathlib import Path
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-speech_file_path = Path(__file__).parent / "speech.mp3"
-response = client.audio.speech.create(
- model="tts-1",
- voice="alloy",
- input="The quick brown fox jumped over the lazy dog."
-)
-response.stream_to_file(speech_file_path)
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/openai/chat.mdx b/docs/0.0.4/dokumetry/python/examples/openai/chat.mdx
deleted file mode 100644
index 5c97d068..00000000
--- a/docs/0.0.4/dokumetry/python/examples/openai/chat.mdx
+++ /dev/null
@@ -1,143 +0,0 @@
----
-title: 'Chat'
-description: 'Monitor OpenAI Chat Completions API usage'
----
-
-## Chat Completions
-
-<CodeGroup>
-
-```python Default
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ]
-)
-
-print(completion.choices[0].message)
-```
-
-```python Image Input
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = client.chat.completions.create(
- model="gpt-4-vision-preview",
- messages=[
- {
- "role": "user",
- "content": [
- {"type": "text", "text": "What’s in this image?"},
- {
- "type": "image_url",
- "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
- },
- ],
- }
- ],
- max_tokens=300,
-)
-
-print(response.choices[0])
-```
-
-```python Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "system", "content": "You are a helpful assistant."},
- {"role": "user", "content": "Hello!"}
- ],
- stream=True
-)
-
-for chunk in completion:
- print(chunk.choices[0].delta)
-```
-
-```python Functions
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-tools = [
- {
- "type": "function",
- "function": {
- "name": "get_current_weather",
- "description": "Get the current weather in a given location",
- "parameters": {
- "type": "object",
- "properties": {
- "location": {
- "type": "string",
- "description": "The city and state, e.g. San Francisco, CA",
- },
- "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
- },
- "required": ["location"],
- },
- }
- }
-]
-messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=messages,
- tools=tools,
- tool_choice="auto"
-)
-
-print(completion)
-```
-
-```python LogProbs
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = client.chat.completions.create(
- model="gpt-3.5-turbo",
- messages=[
- {"role": "user", "content": "Hello!"}
- ],
- logprobs=True,
- top_logprobs=2
-)
-
-print(completion.choices[0].message)
-print(completion.choices[0].logprobs)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/openai/completions.mdx b/docs/0.0.4/dokumetry/python/examples/openai/completions.mdx
deleted file mode 100644
index ab3beb87..00000000
--- a/docs/0.0.4/dokumetry/python/examples/openai/completions.mdx
+++ /dev/null
@@ -1,45 +0,0 @@
----
-title: 'Completions'
-description: 'Monitor OpenAI Completions API Usage'
----
-
-## Completions
-<CodeGroup>
-```python No Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.completions.create(
- model="gpt-3.5-turbo-instruct",
- prompt="Say this is a test",
- max_tokens=7,
- temperature=0
-)
-```
-
-```python Streaming
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-for chunk in client.completions.create(
- model="gpt-3.5-turbo-instruct",
- prompt="Say this is a test",
- max_tokens=7,
- temperature=0,
- stream=True
-):
-
-print(chunk.choices[0].text)
-```
-
-</CodeGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/openai/embeddings.mdx b/docs/0.0.4/dokumetry/python/examples/openai/embeddings.mdx
deleted file mode 100644
index 6c22743a..00000000
--- a/docs/0.0.4/dokumetry/python/examples/openai/embeddings.mdx
+++ /dev/null
@@ -1,22 +0,0 @@
----
-title: 'Embeddings'
-description: 'Monitor OpenAI Embeddings API usage'
----
-
-## Create Embeddings
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.embeddings.create(
- model="text-embedding-ada-002",
- input="The food was delicious and the waiter...",
- encoding_format="float"
-)
-```
diff --git a/docs/0.0.4/dokumetry/python/examples/openai/fine-tuning.mdx b/docs/0.0.4/dokumetry/python/examples/openai/fine-tuning.mdx
deleted file mode 100644
index 4de9f9c7..00000000
--- a/docs/0.0.4/dokumetry/python/examples/openai/fine-tuning.mdx
+++ /dev/null
@@ -1,21 +0,0 @@
----
-title: 'Fine Tuning'
-description: 'Monitor OpenAI Fine Tuning API usage'
----
-
-## Create Fine Tuning Job
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.fine_tuning.jobs.create(
- training_file="file-abc123",
- model="gpt-3.5-turbo"
-)
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/examples/openai/image.mdx b/docs/0.0.4/dokumetry/python/examples/openai/image.mdx
deleted file mode 100644
index 87df73ea..00000000
--- a/docs/0.0.4/dokumetry/python/examples/openai/image.mdx
+++ /dev/null
@@ -1,40 +0,0 @@
----
-title: 'Image'
-description: 'Monitor OpenAI Image API usage'
----
-
-## Create Image
-
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-client.images.generate(
- model="dall-e-3",
- prompt="A cute baby sea otter",
- n=1,
- size="1024x1024"
-)
-```
-
-## Create Image Variation
-```python
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI()
-
-# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-response = client.images.create_variation(
- image=open("image_edit_original.png", "rb"),
- n=2,
- size="1024x1024"
-)
-```
\ No newline at end of file
diff --git a/docs/0.0.4/dokumetry/python/introduction.mdx b/docs/0.0.4/dokumetry/python/introduction.mdx
deleted file mode 100644
index 7d6c93e3..00000000
--- a/docs/0.0.4/dokumetry/python/introduction.mdx
+++ /dev/null
@@ -1,119 +0,0 @@
----
-title: 'Introduction'
-description: 'Monitor your Python LLM Application with DokuMetry'
----
-
-DokuMetry Python SDK is the official library from Doku to send LLM usage data from your Python application to Doku.
-
-## Installation
-``` shell shell
-pip install dokumetry
-```
-
-## Usage
-
-### OpenAI
-
-``` python openai.py
-from openai import OpenAI
-import dokumetry
-
-client = OpenAI(
- api_key="YOUR_OPENAI_KEY"
-)
-
-# Pass the above `client` object along with your Doku URL and API key and this will make sure that all OpenAI calls are automatically tracked.
-dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-chat_completion = client.chat.completions.create(
- messages=[
- {
- "role": "user",
- "content": "What is LLM Observability",
- }
- ],
- model="gpt-3.5-turbo",
-)
-```
-
-The following OpenAI Endpoints are supported for monitoring with DokuMetry
-
-- [Chat completions](/0.0.4/dokumetry/python/examples/openai/chat)
-- [Image Create](/0.0.4/dokumetry/python/examples/openai/image#create-image) and [Image Variations](/0.0.4/dokumetry/python/examples/openai/image#create-image-variation)
-- [Audio Speech Create](/0.0.4/dokumetry/python/examples/openai/audio)
-- [Embeddings](/0.0.4/dokumetry/python/examples/openai/embeddings)
-- [Fine Tunings](/0.0.4/dokumetry/python/examples/openai/fine-tuning)
-- [Completions](/0.0.4/dokumetry/python/examples/openai/completions)
-
-### Cohere
-
-```python cohere.py
-import cohere
-import dokumetry
-
-# initialize the Cohere Client with an API Key
-co = cohere.Client('YOUR_API_KEY')
-
-# Pass the above `co` object along with your Doku URL and API key and this will make sure that all Cohere calls are automatically tracked.
-dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-# generate a prediction for a prompt
-prediction = co.chat(message='What is LLM Observability?', model='command')
-
-# print the predicted text
-print(f'Chatbot: {prediction.text}')
-```
-
-The following Cohere Endpoints are supported for monitoring with DokuMetry
-
-- [Chat](/0.0.4/dokumetry/python/examples/cohere/chat)
-- [Generate](/0.0.4/dokumetry/python/examples/cohere/generate)
-- [Summarize](/0.0.4/dokumetry/python/examples/cohere/co-summarize)
-- [Embed](/0.0.4/dokumetry/python/examples/cohere/embed)
-
-### Anthropic
-
-```python anthropic.py
-from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
-import dokumetry
-
-anthropic = Anthropic(
- # defaults to os.environ.get("ANTHROPIC_API_KEY")
- api_key="my api key",
-)
-
-# Pass the above `anthropic` object along with your Doku URL and API key and this will make sure that all Anthropic calls are automatically tracked.
-dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
-completion = anthropic.completions.create(
- model="claude-2",
- max_tokens_to_sample=300,
- prompt=f"{HUMAN_PROMPT} What is LLM Observability?{AI_PROMPT}",
-)
-print(completion.completion)
-```
-
-The following Anthropic Endpoints are supported for monitoring with DokuMetry
-
-- [Completions](/0.0.4/dokumetry/python/examples/anthropic/anthropic-completions.mdx)
-
-## Parameters
-
-| Parameter | Description | Required |
-|-------------------|-----------------------------------------------------------|---------------|
-| llm | Language Learning Model (LLM) Object to track | Yes |
-| doku_url | URL of your Doku Instance | Yes |
-| api_key | Your Doku API key | Yes |
-| environment | Custom environment tag to include in your metrics | Optional |
-| application_name | Custom application name tag for your metrics | Optional |
-| skip_resp | Skip response from the Doku Ingester for faster execution | Optional |
-
-## Advanced Usage
-When using DokuMetry in Production environments, It is recommened to set `skip_resp = true` for faster porcessing.
-
-To filter your LLM Usage according application or the environment, set the `application` and `environment` paramaters with the actual values.
-
-## Requirements
-Python >= 3.7 is supported.
-
-If you are interested in other runtime environments, please open or upvote an issue on [GitHub](https://github.com/dokulabs/doku/issues).
\ No newline at end of file
diff --git a/docs/0.0.4/installation.mdx b/docs/0.0.4/installation.mdx
deleted file mode 100644
index 8d0b0094..00000000
--- a/docs/0.0.4/installation.mdx
+++ /dev/null
@@ -1,273 +0,0 @@
----
-title: 'Installing Doku'
-description: 'Deploy Doku in your preferred environment'
-icon: 'circle-down'
----
-
-Doku flexibly adapts to your preferred environment. Select a deployment method that best fits your setup:
-
-<CardGroup cols={2}>
- <Card
- title="Kubernetes"
- icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>Kubernetes</title>
- <path fill="#FFA500" d="M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"/></svg>}
- href="/0.0.4/installation#kubernetes"
- >
- Deploy Doku in a Kubernetes Cluster using Helm
- </Card>
- <Card
- title="Docker"
- icon="docker"
- href="/0.0.4/installation#docker"
- >
- Deploy Doku using docker compose
- </Card>
- <Card
- title="Linux"
- icon="linux"
- href="/0.0.4/installation#linux"
- >
- Deploy Doku in a Linux Host
- </Card>
- <Card
- title="Windows"
- icon="windows"
- href="/0.0.4/installation#windows"
- >
- Deploy Doku in a Windows Host
- </Card>
-</CardGroup>
-
-## Kubernetes
-
-Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://github.com/dokulabs/helm/tree/main/charts/doku) for a reliable and scalable solution.
-<Steps>
- <Step title="Helm Repo Setup">
- ```shell shell
- helm repo add dokulabs https://dokulabs.github.io/helm/
- helm repo update
- ```
- </Step>
- <Step title="Installing the Helm Chart">
- ```shell shell
- helm install doku dokulabs/doku
- ```
- </Step>
-</Steps>
-<Info>As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `connections` configuration within the [values.yaml](https://github.com/dokulabs/helm/blob/main/charts/doku/values.yaml) file. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.</Info>
-
-## Docker
-Quickly spin up Doku using Docker for a fast and straightforward setup.
-
-<Steps>
- <Step title="Install TimescaleDB">
- <Steps>
- <Step title="Pull TimescaleDB Image">
- ```shell
- docker pull timescale/timescaledb-ha:pg14-ts2.14
- ```
- </Step>
- <Step title="Run TimescaleDB Image">
- ```shell
- docker run -d --name timescaledb -p 127.0.0.1:5432:5432 \
- -e POSTGRES_PASSWORD=password timescale/timescaledb-ha:pg14-ts2.14
- ```
- </Step>
- </Steps>
- </Step>
- <Step title="Install Doku">
- <Steps>
- <Step title="Pull Doku Image">
- ```shell
- docker pull ghcr.io/dokulabs/doku-ingester:0.0.4
- ```
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- connections:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `connections` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.4/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Run the Doku Image">
- ```shell
- docker run -d --name doku -p 127.0.0.4:9044:9044 -v /doku.yml:/doku.yml dokulabs/ingester:0.0.4 --config /doku.yml
- ```
- </Step>
- </Steps>
- </Step>
-</Steps>
-
-## Linux
-<Steps>
- <Step title="Install TimescaleDB">
- Follow the Instructions [here](https://docs.timescale.com/self-hosted/latest/install/installation-linux/#installing-self-hosted-timescaledb-on-debian-based-systems) to install TimescaleDB in your Linux host.
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- connections:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `connections` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.4/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Install Doku in a linux Host">
- <Tabs>
- <Tab title="Linux">
- <CodeGroup>
- ```shell amd64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.4/ingester-linux-amd64
- chmod +x ingester-linux-amd64
- ./ingester-linux-amd64 --config doku.yml
- ```
-
- ```shell arm64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.4/ingester-linux-arm64
- chmod +x ingester-linux-arm64
- ./ingester-linux-arm64 --config doku.yml
- ```
-
- ```shell arm
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.4/ingester-linux-arm
- chmod +x ingester-linux-arm
- ./ingester-linux-arm --config doku.yml
- ```
-
- ```shell ppc64le
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.4/ingester-linux-ppc64le
- chmod +x ingester-linux-ppc64le
- ./ingester-linux-ppc64le --config doku.yml
- ```
- </CodeGroup>
- </Tab>
- <Tab title="Darwin">
- <CodeGroup>
- ```shell amd64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.4/ingester-darwin-amd64
- chmod +x ingester-darwin-amd64
- ./ingester-darwin-amd64 --config doku.yml
- ```
-
- ```shell arm64
- curl -O -L https://github.com/dokulabs/doku/releases/download/0.0.4/ingester-darwin-arm64
- chmod +x ingester-darwin-arm64
- ./ingester-darwin-arm64 --config doku.yml
- ```
- </CodeGroup>
- </Tab>
- </Tabs>
- </Step>
-</Steps>
-
-## Windows
-<Steps>
- <Step title="Install TimescaleDB">
- <Steps>
- Download and install the Visual C++ Redistributable for Visual Studio from [www.microsoft.com](https://www.microsoft.com/en-us/download/details.aspx?id=48145).
-
- Download and install PostgreSQL from [www.postgresql.org](https://www.postgresql.org/download/windows/). You might need to add the `pg_config` file location to your path. In the Windows Search tool, search for `system environment variables`. The path should be `C:\Program Files\PostgreSQL\<version>\bin`.
-
- Download the TimescaleDB installation `.zip` file from [Windows releases](https://docs.timescale.com/self-hosted/latest/install/installation-windows/#windows-releases).
-
- Locate the downloaded file on your local file system, and extract the files.
-
- In the extracted TimescaleDB directory, right-click the `setup.exe` file and select `Run as Administrator` to start the installer.
- </Steps>
- </Step>
- <Step title="Create a Doku Configuration file">
- Create a file named `doku.yml` in the current directory. This YAML configuration file will contain all the necessary details for Doku to connect to your TimescaleDB instance and other services. Here is an example configuration:
-
- ```yaml doku.yml
- ingesterPort: 9044
-
- pricingInfo:
- url: https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json # URL to download Pricing data file
-
- # Configuration for the Doku Backend Database (TimescaleDB)
- dbConfig:
- name: DBNAME # Name of the database, Example: "postgres"
- username: USERNAME # Username to connect to the database, Example: "admin"
- password: PASSWORD # Password to connect to the database, Example: "DOKU"
- host: HOSTURL # Hostname of the database, Example: "174.21.1.2"
- port: DBPORT # Port of the database, Example: 5432
- sslMode: SSLMODE # SSL Mode of the database, Example: "require"
- maxOpenConns: MAXOPENCONNS # Maximum number of open connections to the database, Example: 15
- maxIdleConns: MAXOPENCONNS # Maximum number of idle connections to the database, Example: 15
- dataTable: DATATABLE # Name of the table to store LLM Data, Example: "DOKU"
- apiKeyTable: APIKEYTABLE # Name of the table to store API Keys, Example: "APIKEYS"
-
- connections:
- enabled: false
- ```
- Be sure to replace the placeholder values with your actual database details and desired settings.
- <Info>
- As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `connections` configuration within the [Doku Configuration file (`doku.yml`)](/0.0.4/configuration#connections-configuration) file.
-
- Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.
- </Info>
- </Step>
- <Step title="Install Doku in a Windows Host">
- <CodeGroup>
- ```shell amd64
- invoke-WebRequest -Uri "https://github.com/dokulabs/doku/releases/download/0.0.4/ingester-windows-amd64" -OutFile "ingester.exe"
- .\ingester.exe --config doku.yml
- ```
-
- ```shell 386
- invoke-WebRequest -Uri "https://github.com/dokulabs/doku/releases/download/0.0.4/ingester-windows-386" -OutFile "ingester.exe"
- .\ingester.exe --config doku.yml
- ```
- </CodeGroup>
- </Step>
-</Steps>
-
diff --git a/docs/0.0.4/introduction.mdx b/docs/0.0.4/introduction.mdx
deleted file mode 100644
index df89422e..00000000
--- a/docs/0.0.4/introduction.mdx
+++ /dev/null
@@ -1,111 +0,0 @@
----
-title: What is Doku?
-description: 'Monitor and evalute your LLM Applications'
----
-
-Doku is an open-source observability tool engineered for Large Language Models (LLMs). Designed for ease of integration into existing LLM applications, Doku offers unparalleled insights into usage, performance, and overhead—allowing you to analyze, optimize, and scale your AI applications and LLM usage effectively.
-
-Whether you're working with OpenAI, Cohere, or Anthropic, It tracks all your LLM requests transparently and conveys the insights needed to make data-driven decisions. From monitoring usage and understanding latencies to managing costs and collaborating effortlessly, Doku grants you the lens to view your models in high definition.
-
-## How it works
-
-<Frame>
- <img src="https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif" />
-</Frame>
-### Application Integration with Two Lines of Code
-Start by incorporating the DokuMetry SDK into your application. With SDKs tailored for both Python and NodeJS, Doku fits into your tech stack with minimal changes. Just a **two lines** of code is all it takes to begin:
-
-For Python and NodeJS projects, just import the DokuMetry SDK and initialize it as follows:
- <CodeGroup>
- ```python python
- import dokumetry
- dokumetry.init(llm=openai, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
- ```
-
- ```javascript NodeJS
- import DokuMetry from 'dokumetry';
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
- ```
- </CodeGroup>
-Find detailed instructions at the [DokuMetry SDK Documentation](/0.0.4/dokumetry/introduction).
-
-### The Doku Ingester: Your Data Processing Workhorse
-
-Upon SDK setup, data from your LLM operations is automatically collected. The DokuMetry SDKs transmit this usage data over HTTP in the background to the [Doku Ingester](https://github.com/dokulabs/doku/tree/main/src/ingester#readme).
-
-The ingester is the core engine where the magic happens:
-- **Data Collection**: Effortlessly captures live data from your LLM interactions without complicating your existing codebase.
-- **Cost Analysis**: Enriches your data with cost considerations, providing a financial perspective to your analytics.
-- **Secure Storage**: All processed information is securely stored in TimescaleDB, providing you with a scalable, time-series database that can handle large volumes of observability data.
-
-You have the choice to set up a fresh TimescaleDB instance or connect Doku to your existing one. Whichever path you choose, your data resides within your control, reinforcing your data security and operational compliance.
-
-## Features
-Leveraging Doku, you can get:
-
-- **In-depth LLM Monitoring**: Track every request to LLM platforms like OpenAI with precision, ensuring comprehensive visibility over your model's interactions.
-- **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.
-- **Connect to Observability Platforms**: Export LLM Observablity data and insights from Doku to popular observability platforms such as Grafana Cloud or Datadog.
-- **Team-centric Workflow**: Enhance team collaboration with seamless data sharing capabilities, creating an integrated environment for observability-driven teamwork.
-
-## Supported LLM Platforms
-<CardGroup cols={3}>
- <Card
- title="OpenAI"
- icon={
- <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <title>OpenAI</title>
- <path d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z" />
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Cohere"
- icon={
- <svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">
- <g>
- <g>
- <g>
- <path d="M24.3,44.7c2,0,6-0.1,11.6-2.4c6.5-2.7,19.3-7.5,28.6-12.5c6.5-3.5,9.3-8.1,9.3-14.3C73.8,7,66.9,0,58.3,0
- h-36C10,0,0,10,0,22.3S9.4,44.7,24.3,44.7z">
- </path>
- <path d="M30.4,60c0-6,3.6-11.5,9.2-13.8l11.3-4.7C62.4,36.8,75,45.2,75,57.6C75,67.2,67.2,75,57.6,75l-12.3,0
- C37.1,75,30.4,68.3,30.4,60z">
- </path>
- <path d="M12.9,47.6L12.9,47.6C5.8,47.6,0,53.4,0,60.5v1.7C0,69.2,5.8,75,12.9,75h0c7.1,0,12.9-5.8,12.9-12.9v-1.7
- C25.7,53.4,20,47.6,12.9,47.6z">
- </path>
- </g>
- </g>
- </g>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
- <Card
- title="Anthropic"
- icon={
- <svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">
- <path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path>
- <path d="M66.1828124,106.221191 C66.1828124,106.221191 90.1624677,44.4471185 90.1624677,44.4471185 C90.1624677,44.4471185 114.142128,106.221191 114.142128,106.221191 C114.142128,106.221191 66.1828124,106.221191 66.1828124,106.221191 C66.1828124,106.221191 66.1828124,106.221191 66.1828124,106.221191 Z M70.0705318,0 C70.0705318,0 0,175.780074 0,175.780074 C0,175.780074 39.179211,175.780074 39.179211,175.780074 C39.179211,175.780074 53.5097704,138.86606 53.5097704,138.86606 C53.5097704,138.86606 126.817544,138.86606 126.817544,138.86606 C126.817544,138.86606 141.145724,175.780074 141.145724,175.780074 C141.145724,175.780074 180.324935,175.780074 180.324935,175.780074 C180.324935,175.780074 110.254409,0 110.254409,0 C110.254409,0 70.0705318,0 70.0705318,0 C70.0705318,0 70.0705318,0 70.0705318,0 Z"></path>
- </svg>
- }
- iconType="duotone"
- >
- </Card>
-</CardGroup>
-
-## Getting Started
-Select from the following guides to learn more about how to use Doku:
-
-<CardGroup cols={2}>
-<Card title="Quickstart" href="/0.0.4/quickstart" icon='bolt'>
-Get Started with monitoring your LLM Applications in 3 simple steps
-</Card>
-<Card title="Connections" href="/0.0.4/connections/intro" icon='connectdevelop'>
-Connect to your existing Observablity Platform
-</Card>
-</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/quickstart.mdx b/docs/0.0.4/quickstart.mdx
deleted file mode 100644
index ab8a290a..00000000
--- a/docs/0.0.4/quickstart.mdx
+++ /dev/null
@@ -1,150 +0,0 @@
----
-title: 'Quickstart'
-description: 'Quickly start **monitoring** your **LLM Applications** in just **two lines** of code'
-icon: 'bolt'
----
-
-This guide will walk you through setting up your monitoring system with minimal effort. In just a few steps, you'll be able to track and analyze the performance and usage of your Large Language Model (LLM) applications.
-
-## Prerequistes
-- Ensure you have access to a **Kubernetes Cluster**. You can quickly spin up a Kubernetes Cluster using [Kind](https://github.com/kubernetes-sigs/kind?tab=readme-ov-file#installation-and-usage)
-
-## Get Started
-
-<Steps>
- <Step title="Install Doku in a Kubernetes Cluster">
- <Steps>
- <Step title="Helm Repo Setup">
- ```shell shell
- helm repo add dokulabs https://dokulabs.github.io/helm/
- helm repo update
- ```
- </Step>
- <Step title="Installing the Helm Chart">
- ```shell shell
- helm install doku dokulabs/doku
- ```
- </Step>
- </Steps>
- </Step>
- <Step title="Generate an API Key">
- With Doku running, the next step is to [generate an API key](/0.0.4/api-reference/endpoint/api-keys/create) for secure communication between your applications and Doku.
-
- To generate your first API key, you can use the following command:
-
- ```shell shell
- curl --request POST \
- --url https://<your-doku-url>/api/keys \
- --header 'Authorization: ""' \
- --header 'Content-Type: application/json' \
- --data '{
- "name": "Admin"
- }'
- ```
-
- Make sure to store the returned API key securely, as it's necessary for authorizing future API calls with Doku.
-
- <Info>
- During your initial request to generate an API key, you can leave the Authorization header empty (i.e., `""`). For subsequent requests, you will need to supply the generated API key.
- </Info>
-
- </Step>
- <Step title="Instrument your code">
- Choose the appropriate SDK for your application's programming language and follow the steps to integrate monitoring with just a couple of lines of code.
- <Tabs>
- <Tab title="Python">
- <Steps>
- <Step title="Install the dokumetry Python SDK using pip">
- ```shell
- pip install dokumetry
- ```
- </Step>
- <Step title="Add the following two lines to your application code:">
- Add the snippet below to your Python application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.
-
- ```python
- import dokumetry
-
- dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
- ```
-
- Example Usage for monitoring `OpenAI` Usage:
-
- ```python
- from openai import OpenAI
- import dokumetry
-
- client = OpenAI(
- api_key="YOUR_OPENAI_KEY"
- )
-
- # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
- dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
-
- chat_completion = client.chat.completions.create(
- messages=[
- {
- "role": "user",
- "content": "What is LLM Observability",
- }
- ],
- model="gpt-3.5-turbo",
- )
- ```
-
- Refer to the `dokumetry` [Python SDK repository](https://github.com/dokulabs/dokumetry-python) or the [DokuMetry Docs](/0.0.4/dokumetry/python/introduction) for more advanced configurations and use cases.
- </Step>
- </Steps>
- </Tab>
- <Tab title="NodeJS">
- <Steps>
- <Step title="Install the dokumetry NodeJS SDK using npm">
- ```shell
- npm install dokumetry
- ```
- </Step>
- <Step title="Add the following two lines to your application code">
- Add the snippet below to your NodeJS application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.
- ```javascript
- import DokuMetry from 'dokumetry';
-
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
- ```
-
- Example Usage for monitoring `OpenAI` Usage:
-
- ```javascript
- import OpenAI from 'openai';
- import DokuMetry from 'dokumetry';
-
- const openai = new OpenAI({
- apiKey: 'My API Key', // defaults to process.env["OPENAI_API_KEY"]
- });
-
- // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
-
- async function main() {
- const chatCompletion = await openai.chat.completions.create({
- messages: [{ role: 'user', content: 'What are the key to effective observability?' }],
- model: 'gpt-3.5-turbo',
- });
- }
-
- main();
- ```
-
- Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dokumetry-node) or the [DokuMetry Docs](/0.0.4/dokumetry/node/introduction) for more advanced configurations and use cases.
- </Step>
- </Steps>
- </Tab>
- </Tabs>
- </Step>
-</Steps>
-
-## (Optional) Export Data
-<Card title="Connections" href="/0.0.4/connections/intro" icon='connectdevelop'>
-Connect to your existing Observablity Platform
-</Card>
-
-You're all set! Following these steps should have you on your way to effectively monitoring your LLM applications. If you have any questions or need support, reach out to our [community](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA).
\ No newline at end of file
diff --git a/docs/0.0.5/configuration.mdx b/docs/0.0.5/configuration.mdx
index bfc84e97..2f9124d9 100644
--- a/docs/0.0.5/configuration.mdx
+++ b/docs/0.0.5/configuration.mdx
@@ -133,7 +133,7 @@ DOKU_DB_SSLMODE="require
---
<CardGroup cols={2}>
-<Card title="Integrations" href="/0.0.5/integration/introduction" icon='circle-nodes'>
+<Card title="Integrations" href="0.0.5/integrations/introduction" icon='circle-nodes'>
Integrate your LLM Provider with Doku
</Card>
<Card title="Connections" href="/0.0.5/connections/intro" icon='link'>
diff --git a/docs/0.0.5/connections/intro.mdx b/docs/0.0.5/connections/intro.mdx
index 20f03bf6..517038d2 100644
--- a/docs/0.0.5/connections/intro.mdx
+++ b/docs/0.0.5/connections/intro.mdx
@@ -27,7 +27,7 @@ Below is a list of observability platforms that work seamlessly with Doku, allow
---
<CardGroup cols={2}>
-<Card title="Integrations" href="/0.0.5/integration/introduction" icon='circle-nodes'>
+<Card title="Integrations" href="/0.0.5/integrations/introduction" icon='circle-nodes'>
Integrate your LLM Provider with Doku
</Card>
<Card title="API Refernce" href="/0.0.5/api-reference/introduction" icon='code'>
diff --git a/docs/0.0.5/installation.mdx b/docs/0.0.5/installation.mdx
index 80cedb32..178d93fb 100644
--- a/docs/0.0.5/installation.mdx
+++ b/docs/0.0.5/installation.mdx
@@ -93,7 +93,7 @@ Quickly spin up Doku using Docker Compose for a fast and straightforward setup.
---
<CardGroup cols={2}>
-<Card title="Integrations" href="/0.0.5/integration/introduction" icon='circle-nodes'>
+<Card title="Integrations" href="/0.0.5/integrations/introduction" icon='circle-nodes'>
Integrate your LLM Provider with Doku
</Card>
<Card title="Connections" href="/0.0.5/connections/intro" icon='link'>
diff --git a/docs/0.0.5/introduction.mdx b/docs/0.0.5/introduction.mdx
index 5bb50570..08c09326 100644
--- a/docs/0.0.5/introduction.mdx
+++ b/docs/0.0.5/introduction.mdx
@@ -108,7 +108,7 @@ Select from the following guides to learn more about how to use Doku:
<Card title="Quickstart" href="/0.0.5/quickstart" icon='bolt'>
Get Started with monitoring your LLM Applications in 2 simple steps
</Card>
-<Card title="Integrations" href="/0.0.5/integration/introduction" icon='circle-nodes'>
+<Card title="Integrations" href="/0.0.5/integrations/introduction" icon='circle-nodes'>
Integrate your LLM Provider with Doku
</Card>
<Card title="Installation" href="/0.0.5/installation" icon='circle-down'>
diff --git a/docs/0.0.5/quickstart.mdx b/docs/0.0.5/quickstart.mdx
index 2469d30c..5d590ebf 100644
--- a/docs/0.0.5/quickstart.mdx
+++ b/docs/0.0.5/quickstart.mdx
@@ -147,7 +147,7 @@ You're all set! Following these steps should have you on your way to effectively
---
<CardGroup cols={2}>
-<Card title="Integrations" href="/0.0.5/integration/introduction" icon='circle-nodes'>
+<Card title="Integrations" href="/0.0.5/integrations/introduction" icon='circle-nodes'>
Integrate your LLM Provider with Doku
</Card>
<Card title="Connections" href="/0.0.5/connections/intro" icon='link'>
diff --git a/docs/0.0.1/api-reference/endpoint/api-keys/create.mdx b/docs/0.0.6/api-reference/endpoint/api-keys/create.mdx
similarity index 100%
rename from docs/0.0.1/api-reference/endpoint/api-keys/create.mdx
rename to docs/0.0.6/api-reference/endpoint/api-keys/create.mdx
diff --git a/docs/0.0.1/api-reference/endpoint/api-keys/delete.mdx b/docs/0.0.6/api-reference/endpoint/api-keys/delete.mdx
similarity index 100%
rename from docs/0.0.1/api-reference/endpoint/api-keys/delete.mdx
rename to docs/0.0.6/api-reference/endpoint/api-keys/delete.mdx
diff --git a/docs/0.0.1/api-reference/endpoint/api-keys/get.mdx b/docs/0.0.6/api-reference/endpoint/api-keys/get.mdx
similarity index 100%
rename from docs/0.0.1/api-reference/endpoint/api-keys/get.mdx
rename to docs/0.0.6/api-reference/endpoint/api-keys/get.mdx
diff --git a/docs/0.0.6/api-reference/endpoint/connections/create.mdx b/docs/0.0.6/api-reference/endpoint/connections/create.mdx
new file mode 100644
index 00000000..bf65b9de
--- /dev/null
+++ b/docs/0.0.6/api-reference/endpoint/connections/create.mdx
@@ -0,0 +1,4 @@
+---
+title: 'Create Connection'
+openapi: 'POST /api/connections'
+---
\ No newline at end of file
diff --git a/docs/0.0.6/api-reference/endpoint/connections/delete.mdx b/docs/0.0.6/api-reference/endpoint/connections/delete.mdx
new file mode 100644
index 00000000..db7b942d
--- /dev/null
+++ b/docs/0.0.6/api-reference/endpoint/connections/delete.mdx
@@ -0,0 +1,4 @@
+---
+title: 'Delete Connection'
+openapi: 'DELETE /api/connections'
+---
\ No newline at end of file
diff --git a/docs/0.0.2/api-reference/introduction.mdx b/docs/0.0.6/api-reference/introduction.mdx
similarity index 50%
rename from docs/0.0.2/api-reference/introduction.mdx
rename to docs/0.0.6/api-reference/introduction.mdx
index f37f9a3b..787f9d04 100644
--- a/docs/0.0.2/api-reference/introduction.mdx
+++ b/docs/0.0.6/api-reference/introduction.mdx
@@ -2,14 +2,20 @@
title: 'Introduction'
description: 'OpenAPI specification for API Endpoints in Doku'
---
-
-<Card
- title="API Keys Endpoints"
- icon="key"
- href="/0.0.2/api-reference/endpoint/api-keys/create"
->
- View the documentation for API Keys
-</Card>
+<CardGroup cols={2}>
+ <Card
+ title="API Keys"
+ icon="key"
+ href="/0.0.6/api-reference/endpoint/api-keys/create"
+ >
+ </Card>
+ <Card
+ title="Connections API"
+ icon="link"
+ href="/0.0.6/api-reference/endpoint/Connections/create"
+ >
+ </Card>
+</CardGroup>
## Authentication
@@ -20,6 +26,7 @@ Authorization: <api-key>
```
<Info>
-For your initial API call, Authorization header can be set to "".
+For your initial API call to `/api/keys` endpoint, Authorization header can be set to "".
+
Store the provided API key securely; it will be required to pass the generated and a valid API Key in Authorization header for subsequent API calls.
</Info>
\ No newline at end of file
diff --git a/docs/0.0.6/api-reference/openiapi.yml b/docs/0.0.6/api-reference/openiapi.yml
new file mode 100644
index 00000000..3247711f
--- /dev/null
+++ b/docs/0.0.6/api-reference/openiapi.yml
@@ -0,0 +1,173 @@
+openapi: 3.0.0
+info:
+ title: API Keys Service
+ description: This service manages API keys through GET, POST, and DELETE operations.
+ version: "0.0.2"
+
+servers:
+ - url: https://127.0.0.1:9044/
+
+paths:
+ /api/connections:
+ post:
+ summary: Create a new connection
+ operationId: createConnection
+ tags:
+ - Connection
+ security:
+ - ApiKeyAuth: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ConnectionRequest'
+ responses:
+ '201':
+ description: Connection created
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/json201Response'
+ delete:
+ summary: Delete a connection
+ operationId: deleteConnection
+ tags:
+ - Connection
+ security:
+ - ApiKeyAuth: []
+ responses:
+ '200':
+ description: Connection deleted
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/json201Response'
+ /api/keys:
+ get:
+ summary: Get a list of API keys
+ operationId: getApiKeys
+ tags:
+ - API Key
+ security:
+ - ApiKeyAuth: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIKeyRequest'
+ responses:
+ '200':
+ description: A list of API keys
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/json201Response'
+ post:
+ summary: Create a new API key
+ operationId: createApiKey
+ tags:
+ - API Key
+ security:
+ - ApiKeyAuth: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIKeyRequest'
+ responses:
+ '201':
+ description: API key created
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/json201Response'
+ delete:
+ summary: Delete an API key
+ operationId: deleteApiKey
+ tags:
+ - API Key
+ security:
+ - ApiKeyAuth: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/APIKeyRequest'
+ responses:
+ '200':
+ description: API key deleted
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/json201Response'
+
+components:
+ schemas:
+ APIKeyRequest:
+ type: object
+ required:
+ - name
+ properties:
+ name:
+ type: string
+ description: Name of the API key to be created or deleted. Example - `BIGDADDY`
+ ConnectionRequest:
+ type: object
+ required:
+ - Platform
+ - MetricsUrl
+ - LogsUrl
+ - MetricsUsername
+ - LogsUsername
+ - ApiKey
+ properties:
+ Platform:
+ type: string
+ description: Name of the Observability Platform. Can be one of the following - `grafana`, `newrelic`, `datadog`, `dynatrace` and `signoz`
+ MetricsUrl:
+ type: string
+ description: URL of the metrics endpoint of the Observability Platform. Example - `https://api.datadoghq.com/api/v1/query`
+ LogsUrl:
+ type: string
+ description: URL of the logs endpoint of the Observability Platform. Example - `https://api.datadoghq.com/api/v1/query`
+ MetricsUsername:
+ type: string
+ description: Username for the metrics endpoint of the Observability Platform. Only required when Platform is passed as `grafana`.
+ LogsUsername:
+ type: string
+ description: Username for the logs endpoint of the Observability Platform. Only required when Platform is passed as `grafana`.
+ ApiKey:
+ type: string
+ description: API Key for the Observability Platform. Example - `glc*******`
+
+ json201Response:
+ type: object
+ required:
+ - status
+ - message
+ properties:
+ status:
+ type: integer
+ message:
+ type: string
+
+ json401Response:
+ type: object
+ required:
+ - status
+ - message
+ properties:
+ status:
+ type: integer
+ message:
+ type: string
+
+ securitySchemes:
+ ApiKeyAuth:
+ type: apiKey
+ in: header
+ name: Authorization
\ No newline at end of file
diff --git a/docs/0.0.6/configuration.mdx b/docs/0.0.6/configuration.mdx
new file mode 100644
index 00000000..c262ffe5
--- /dev/null
+++ b/docs/0.0.6/configuration.mdx
@@ -0,0 +1,132 @@
+---
+title: 'Configuration'
+description: 'Configuring Options for Doku'
+icon: 'sliders'
+---
+
+This guide covers all the available environment variables to fine-tune Doku according to your needs.
+
+## Environment Varibales
+
+<ResponseField name="DOKU_DB_HOST" required>
+ Specifies the host address of the ClickHouse server for Doku to connect to.
+
+ **Example**:
+ ```yaml
+ export DOKU_DB_HOST=127.0.0.1
+ ```
+</ResponseField>
+
+<ResponseField name="DOKU_DB_PORT" required>
+ Defines the port on which ClickHouse listens.
+
+ **Example**:
+ ```yaml
+ export DOKU_DB_PORT=9000
+ ```
+</ResponseField>
+
+<ResponseField name="DOKU_DB_NAME" required>
+ Name of the database in Clickhouse to be used by Doku
+
+ **Example**:
+ ```yaml
+ export DOKU_DB_NAME=default
+ ```
+</ResponseField>
+
+<ResponseField name="DOKU_DB_USER" required>
+ Sets the username for authenticating with ClickHouse.
+
+ **Example**:
+ ```yaml
+ export DOKU_DB_USER=default
+ ```
+</ResponseField>
+
+<ResponseField name="DOKU_DB_PASSWORD" required>
+ Sets the password for authenticating with ClickHouse.
+
+ **Example**:
+ ```yaml
+ export DOKU_DB_PASSWORD=DOKU
+ ```
+</ResponseField>
+
+<ResponseField name="DOKU_PRICING_JSON_URL">
+ URL of the json file containing the LLM Pricing data.
+
+**Default Value**:
+```shell
+https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json
+```
+
+**Example**:
+```yaml
+export DOKU_PRICING_JSON_URL=https://raw.githubusercontent.com/dokulabs/ingester/main/assets/pricing.json
+ ```
+</ResponseField>
+
+<ResponseField name="DOKU_DB_MAX_IDLE_CONNS">
+ Maximum number of concurrent idle database connections.
+
+**Default Value**:
+```shell
+10
+```
+
+**Example**:
+```shell
+export DOKU_DB_MAX_IDLE_CONNS=10
+```
+</ResponseField>
+
+<ResponseField name="DOKU_DB_MAX_OPEN_CONNS">
+ Maximum number of concurrent open database connections.
+
+**Default Value**:
+```shell
+20
+```
+
+**Example**:
+```shell
+export DOKU_DB_MAX_OPEN_CONNS=20
+```
+</ResponseField>
+
+<ResponseField name="DOKU_DB_RETENTION_PERIOD">
+ The `DOKU_DB_RETENTION_PERIOD` specifies the TTL for data in Clickhouse.
+
+**Default Value**:
+```shell
+6 MONTH
+```
+
+**Example**:
+```shell
+export DOKU_DB_RETENTION_PERIOD="6 MONTH"
+```
+</ResponseField>
+
+
+## Sample Environment File (.env)
+
+```.env.example .env
+DOKU_DB_HOST="127.0.0.1"
+DOKU_DB_PORT="9000"
+DOKU_DB_NAME="default"
+DOKU_DB_USER="default"
+DOKU_DB_PASSWORD="DOKU"
+```
+
+---
+
+<CardGroup cols={2}>
+<Card title="Integrations" href="/0.0.6/integrations/introduction" icon='circle-nodes'>
+Integrate your LLM Provider with Doku
+</Card>
+<Card title="Connections" href="/0.0.6/connections/intro" icon='link'>
+Connect to your existing Observablity Platform
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/connections/datadog.mdx b/docs/0.0.6/connections/datadog.mdx
similarity index 97%
rename from docs/0.0.4/connections/datadog.mdx
rename to docs/0.0.6/connections/datadog.mdx
index 961fc2e9..44d11791 100644
--- a/docs/0.0.4/connections/datadog.mdx
+++ b/docs/0.0.6/connections/datadog.mdx
@@ -10,15 +10,19 @@ description: 'Connect Doku to DataDog'
Doku can automatically send LLM usage data from Doku to DataDog using the [Submit Metrics API](https://docs.datadoghq.com/api/latest/metrics/#submit-metrics) and [Send Logs API](https://docs.datadoghq.com/api/latest/logs/#send-logs)
-Add the following to your doku configuration file(`doku.yml`).
+Make the following curl request to Doku to add a connection for DataDog. See more on the [Connections API](/0.0.6/api-reference/endpoint/connections/create)
-```yaml doku.yml
-connections:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- datadog:
- metricsUrl: <your-datadog-metrics-url> # URL to the DataDog Metrics API
- logsUrl: <your-datadog-logs-url> # URL to the DataDog Logs API
- apiKey: <your-datadog-api-key> # API Key of the DataDog Account
+```shell
+curl --request POST \
+ --url https://<YOUR_DOKU_URL>/api/connections \
+ --header 'Authorization: <DOKU_API_KEY>' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "Platform": "datadog",
+ "MetricsUrl": "<YOUR_DD_METRICS_URL>",
+ "LogsUrl": "<YOUR_DD_LOGS_URL>",
+ "ApiKey": "<YOUR_DD_API_KEY>"
+}'
```
## DataDog Resources
diff --git a/docs/0.0.6/connections/dynatrace.mdx b/docs/0.0.6/connections/dynatrace.mdx
new file mode 100644
index 00000000..1c04b557
--- /dev/null
+++ b/docs/0.0.6/connections/dynatrace.mdx
@@ -0,0 +1,1762 @@
+---
+title: 'Dynatrace'
+description: 'Connect Doku to Dynatrace'
+---
+
+<Frame>
+ <img src="https://github.com/dokulabs/doku/blob/main/docs/images/dynatrace-dashboard-1.jpg?raw=true" />
+ <img src="https://github.com/dokulabs/doku/blob/main/docs/images/dynatrace-dashboard-2.jpg?raw=true" />
+ <img src="https://github.com/dokulabs/doku/blob/main/docs/images/dynatrace-dsahboard-3.jpg?raw=true" />
+</Frame>
+
+Doku can automatically send LLM usage data from Doku to Dynatrace using the [Ingest Metrics API](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/metric-v2/post-ingest-metrics) and [Ingest Logs API](https://docs.dynatrace.com/docs/dynatrace-api/environment-api/log-monitoring-v2/post-ingest-logs)
+
+Make the following curl request to Doku to add a connection for Dynatrace. See more on the [Connections API](/0.0.6/api-reference/endpoint/connections/create)
+
+```shell
+curl --request POST \
+ --url https://<YOUR_DOKU_URL>/api/connections \
+ --header 'Authorization: <DOKU_API_KEY>' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "Platform": "dynatrace",
+ "MetricsUrl": "<YOUR_DYNATRACE_METRICS_URL>",
+ "LogsUrl": "<YOUR_DYNATRACE_LOGS_URL>",
+ "ApiKey": "<YOUR_DYNATRACE_API_KEY>"
+}'
+```
+
+## Dynatrace Resources
+
+<Accordion title="Dashboard">
+ ```json
+ {
+ "version": 13,
+ "variables": [],
+ "tiles": {
+ "1": {
+ "type": "data",
+ "title": "",
+ "query": "fetch logs\n| filter type == \"prompt\"\n| limit 20",
+ "queryConfig": {
+ "limit": 20,
+ "additionalFilters": {
+ "type": [
+ {
+ "criteria": "equals",
+ "expression": "prompt"
+ }
+ ]
+ },
+ "version": "4.0.1",
+ "datatype": "logs",
+ "log.source": [
+ {
+ "criteria": "contains",
+ "expression": ""
+ }
+ ],
+ "content": [
+ {
+ "criteria": "contains",
+ "expression": ""
+ }
+ ]
+ },
+ "subType": "dql-builder-logs",
+ "visualization": "table",
+ "visualizationSettings": {
+ "thresholds": [],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "relative",
+ "groupingThresholdValue": 0,
+ "valueType": "relative"
+ },
+ "categoryOverrides": {},
+ "categoricalBarChartSettings": {}
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "timestamp",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "default",
+ "enableSparklines": false,
+ "hiddenColumns": [
+ [
+ "event.type"
+ ],
+ [
+ "loglevel"
+ ],
+ [
+ "status"
+ ],
+ [
+ "dt.auth.origin"
+ ],
+ [
+ "custom.attribute"
+ ],
+ [
+ "type"
+ ],
+ [
+ "endpoint"
+ ],
+ [
+ "environment"
+ ],
+ [
+ "generation"
+ ],
+ [
+ "job"
+ ],
+ [
+ "platform"
+ ],
+ [
+ "source"
+ ],
+ [
+ "cost"
+ ],
+ [
+ "application"
+ ]
+ ],
+ "lineWrapIds": [
+ [
+ "timestamp"
+ ],
+ [
+ "content"
+ ],
+ [
+ "event.type"
+ ],
+ [
+ "loglevel"
+ ],
+ [
+ "status"
+ ],
+ [
+ "application"
+ ],
+ [
+ "cost"
+ ],
+ [
+ "dt.auth.origin"
+ ],
+ [
+ "endpoint"
+ ],
+ [
+ "environment"
+ ],
+ [
+ "generation"
+ ],
+ [
+ "job"
+ ],
+ [
+ "model"
+ ],
+ [
+ "platform"
+ ],
+ [
+ "source"
+ ],
+ [
+ "type"
+ ]
+ ],
+ "columnWidths": {
+ "[\"timestamp\"]": 105,
+ "[\"application\"]": 113,
+ "[\"cost\"]": 75,
+ "[\"content\"]": 383
+ },
+ "colorThresholdTarget": "background",
+ "sortBy": {
+ "columnId": "[\"timestamp\"]",
+ "direction": "descending"
+ }
+ }
+ }
+ },
+ "2": {
+ "type": "data",
+ "title": "",
+ "query": "fetch logs\n| filter type != \"prompt\"\n| limit 20",
+ "queryConfig": {
+ "limit": 20,
+ "additionalFilters": {
+ "type": [
+ {
+ "criteria": "not-equals",
+ "expression": "prompt"
+ }
+ ]
+ },
+ "version": "4.0.1",
+ "datatype": "logs",
+ "log.source": [
+ {
+ "criteria": "contains",
+ "expression": ""
+ }
+ ],
+ "content": [
+ {
+ "criteria": "contains",
+ "expression": ""
+ }
+ ]
+ },
+ "subType": "dql-builder-logs",
+ "visualization": "table",
+ "visualizationSettings": {
+ "thresholds": [],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "relative",
+ "groupingThresholdValue": 0,
+ "valueType": "relative"
+ },
+ "categoryOverrides": {},
+ "categoricalBarChartSettings": {}
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "timestamp",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "default",
+ "enableSparklines": false,
+ "hiddenColumns": [
+ [
+ "event.type"
+ ],
+ [
+ "loglevel"
+ ],
+ [
+ "status"
+ ],
+ [
+ "dt.auth.origin"
+ ],
+ [
+ "custom.attribute"
+ ],
+ [
+ "type"
+ ],
+ [
+ "endpoint"
+ ],
+ [
+ "environment"
+ ],
+ [
+ "generation"
+ ],
+ [
+ "job"
+ ],
+ [
+ "platform"
+ ],
+ [
+ "source"
+ ],
+ [
+ "cost"
+ ],
+ [
+ "application"
+ ]
+ ],
+ "lineWrapIds": [
+ [
+ "timestamp"
+ ],
+ [
+ "content"
+ ],
+ [
+ "event.type"
+ ],
+ [
+ "loglevel"
+ ],
+ [
+ "status"
+ ],
+ [
+ "application"
+ ],
+ [
+ "cost"
+ ],
+ [
+ "dt.auth.origin"
+ ],
+ [
+ "endpoint"
+ ],
+ [
+ "environment"
+ ],
+ [
+ "generation"
+ ],
+ [
+ "job"
+ ],
+ [
+ "model"
+ ],
+ [
+ "platform"
+ ],
+ [
+ "source"
+ ],
+ [
+ "type"
+ ]
+ ],
+ "columnWidths": {
+ "[\"timestamp\"]": 104,
+ "[\"application\"]": 113,
+ "[\"cost\"]": 75,
+ "[\"content\"]": 413
+ },
+ "colorThresholdTarget": "background",
+ "sortBy": {
+ "columnId": "[\"timestamp\"]",
+ "direction": "descending"
+ }
+ }
+ }
+ },
+ "7": {
+ "type": "data",
+ "title": "",
+ "query": "timeseries duration=avg(doku.llm.request.duration, rollup: count)\n| sort arrayAvg(duration) desc\n| limit 20\n| fieldsAdd duration.single_value=arraySum(duration)",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "singleValue",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540"
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f"
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a"
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "relative",
+ "groupingThresholdValue": 0,
+ "valueType": "relative"
+ },
+ "categoryOverrides": {},
+ "fieldMapping": {
+ "timestamp": "timeframe",
+ "leftAxisValues": [
+ "duration"
+ ],
+ "leftAxisDimensions": [
+ "duration.single_value"
+ ],
+ "fields": [],
+ "values": []
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "recordField": "duration.single_value",
+ "autoscale": true,
+ "sparklineSettings": {
+ "showTicks": true,
+ "variant": "area",
+ "record": "duration",
+ "visible": true,
+ "isVisible": true,
+ "color": {
+ "Default": "var(--dt-colors-charts-categorical-color-01-default, #134fc9)"
+ }
+ },
+ "trend": {
+ "visible": true,
+ "relative": true,
+ "isVisible": false
+ },
+ "label": "Total Requests",
+ "colorThresholdTarget": "value",
+ "alignment": "center"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ }
+ }
+ },
+ "14": {
+ "type": "data",
+ "title": "",
+ "query": "timeseries duration=avg(doku.llm.request.duration)\n| fieldsAdd duration.single_value=arrayAvg(duration)",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "singleValue",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540"
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f"
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a"
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "relative",
+ "groupingThresholdValue": 0,
+ "valueType": "relative"
+ },
+ "categoryOverrides": {},
+ "fieldMapping": {
+ "timestamp": "timeframe",
+ "leftAxisValues": [
+ "duration"
+ ],
+ "leftAxisDimensions": [
+ "duration.single_value"
+ ],
+ "fields": [],
+ "values": []
+ },
+ "categoricalBarChartSettings": {}
+ },
+ "singleValue": {
+ "showLabel": true,
+ "recordField": "duration.single_value",
+ "autoscale": true,
+ "sparklineSettings": {
+ "showTicks": false,
+ "variant": "area",
+ "record": "duration",
+ "visible": true
+ },
+ "trend": {
+ "visible": true,
+ "relative": true,
+ "isVisible": false
+ },
+ "label": "Avg Request Duration"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": [
+ {
+ "identifier": "duration.single_value",
+ "unitCategory": "time",
+ "baseUnit": "second",
+ "displayUnit": null,
+ "decimals": 3,
+ "suffix": "",
+ "delimiter": false,
+ "added": 1707910354866
+ }
+ ]
+ }
+ },
+ "15": {
+ "type": "data",
+ "title": "",
+ "query": "timeseries duration=avg(doku.llm.total.tokens)\n| fieldsAdd duration.single_value=arrayAvg(duration)",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "singleValue",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540"
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f"
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a"
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "relative",
+ "groupingThresholdValue": 0,
+ "valueType": "relative"
+ },
+ "categoryOverrides": {},
+ "fieldMapping": {
+ "timestamp": "timeframe",
+ "leftAxisValues": [
+ "duration"
+ ],
+ "leftAxisDimensions": [
+ "duration.single_value"
+ ],
+ "fields": [],
+ "values": []
+ },
+ "categoricalBarChartSettings": {}
+ },
+ "singleValue": {
+ "showLabel": true,
+ "recordField": "duration.single_value",
+ "autoscale": true,
+ "sparklineSettings": {
+ "showTicks": false,
+ "variant": "area",
+ "record": "duration",
+ "visible": true
+ },
+ "trend": {
+ "visible": true,
+ "relative": true,
+ "isVisible": false
+ },
+ "label": "Avg Tokens / Request"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ }
+ }
+ },
+ "17": {
+ "type": "data",
+ "title": "",
+ "query": "timeseries cost=sum(doku.llm.usage.cost)\n| sort arraySum(cost) desc\n| limit 20\n| fieldsAdd cost.single_value=arraySum(cost)",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "singleValue",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "relative",
+ "groupingThresholdValue": 0,
+ "valueType": "relative"
+ },
+ "categoryOverrides": {},
+ "fieldMapping": {
+ "timestamp": "timeframe",
+ "leftAxisValues": [
+ "cost"
+ ],
+ "leftAxisDimensions": [
+ "cost.single_value"
+ ],
+ "fields": [],
+ "values": []
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "recordField": "cost.single_value",
+ "autoscale": true,
+ "sparklineSettings": {
+ "showTicks": false,
+ "variant": "area",
+ "record": "cost",
+ "visible": true,
+ "isVisible": true
+ },
+ "trend": {
+ "visible": true,
+ "relative": true,
+ "isVisible": false,
+ "isRelative": true,
+ "isInverseTrend": false
+ },
+ "colorThresholdTarget": "value",
+ "alignment": "center",
+ "label": "Total Cost"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": [
+ {
+ "identifier": "cost.single_value",
+ "unitCategory": "currency",
+ "baseUnit": "usd",
+ "displayUnit": "usd",
+ "decimals": 3,
+ "suffix": "",
+ "delimiter": true,
+ "added": 1707910304797
+ }
+ ]
+ }
+ },
+ "19": {
+ "type": "data",
+ "title": "",
+ "query": "timeseries duration=avg(doku.llm.request.duration, rollup: count)\n| sort arrayAvg(duration) desc\n| limit 20",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "areaChart",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "legend": {
+ "hidden": true
+ },
+ "leftYAxisSettings": {
+ "min": "auto",
+ "max": "data-max",
+ "label": "Requests"
+ },
+ "categoricalBarChartSettings": {
+ "layout": "horizontal"
+ },
+ "fieldMapping": {
+ "timestamp": "timeframe",
+ "leftAxisValues": [
+ "duration"
+ ],
+ "leftAxisDimensions": [],
+ "fields": [],
+ "values": []
+ },
+ "seriesOverrides": []
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": []
+ }
+ },
+ "21": {
+ "type": "data",
+ "title": "Usage Cost by Category",
+ "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { generation, interval, timeframe }\n| sort cost desc\n| limit 20",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "pieChart",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "absolute",
+ "groupingThresholdValue": 0,
+ "valueType": "absolute",
+ "hideLabels": true,
+ "groupingName": null
+ },
+ "categoryOverrides": {},
+ "categoricalBarChartSettings": {
+ "categoryAxis": "generation",
+ "categoryAxisLabel": "generation",
+ "valueAxis": "cost",
+ "valueAxisLabel": "cost"
+ },
+ "legend": {
+ "position": "bottom",
+ "hidden": false
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "generation",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": [
+ {
+ "identifier": "cost",
+ "unitCategory": "currency",
+ "baseUnit": "usd",
+ "displayUnit": "usd",
+ "decimals": 4,
+ "suffix": "",
+ "delimiter": true,
+ "added": 1707908592897
+ }
+ ]
+ }
+ },
+ "22": {
+ "type": "data",
+ "title": "Usage Cost by Platform",
+ "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { platform, interval, timeframe }\n| sort cost desc\n| limit 20",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "pieChart",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "absolute",
+ "groupingThresholdValue": 0,
+ "valueType": "relative",
+ "hideLabels": false
+ },
+ "categoryOverrides": {},
+ "categoricalBarChartSettings": {
+ "categoryAxis": "platform",
+ "categoryAxisLabel": "platform",
+ "valueAxis": "cost",
+ "valueAxisLabel": "cost"
+ },
+ "legend": {
+ "position": "bottom",
+ "hidden": false
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "generation",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": [
+ {
+ "identifier": "interval",
+ "unitCategory": "time",
+ "baseUnit": "nanosecond",
+ "displayUnit": "usd",
+ "decimals": 4,
+ "suffix": "",
+ "delimiter": true,
+ "added": 1707908592897
+ }
+ ]
+ }
+ },
+ "23": {
+ "type": "data",
+ "title": "Usage Cost by Application",
+ "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { application, interval, timeframe }\n| sort cost desc\n| limit 20",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "pieChart",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "absolute",
+ "groupingThresholdValue": 0,
+ "valueType": "relative",
+ "hideLabels": false
+ },
+ "categoryOverrides": {},
+ "categoricalBarChartSettings": {
+ "categoryAxis": "application",
+ "categoryAxisLabel": "application",
+ "valueAxis": "cost",
+ "valueAxisLabel": "cost"
+ },
+ "legend": {
+ "position": "bottom",
+ "hidden": false
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "generation",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": [
+ {
+ "identifier": "cost",
+ "unitCategory": "currency",
+ "baseUnit": "usd",
+ "displayUnit": "usd",
+ "decimals": 4,
+ "suffix": "",
+ "delimiter": true,
+ "added": 1707908592897
+ }
+ ]
+ }
+ },
+ "24": {
+ "type": "data",
+ "title": "Usage Cost by Environment",
+ "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { environment, interval, timeframe }\n| sort cost desc\n| limit 20",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "pieChart",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "absolute",
+ "groupingThresholdValue": 0,
+ "valueType": "relative",
+ "hideLabels": false
+ },
+ "categoryOverrides": {},
+ "categoricalBarChartSettings": {
+ "categoryAxis": "environment",
+ "categoryAxisLabel": "environment",
+ "valueAxis": "cost",
+ "valueAxisLabel": "cost"
+ },
+ "legend": {
+ "position": "bottom",
+ "hidden": false
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "generation",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": [
+ {
+ "identifier": "cost",
+ "unitCategory": "currency",
+ "baseUnit": "usd",
+ "displayUnit": "usd",
+ "decimals": 4,
+ "suffix": "",
+ "delimiter": true,
+ "added": 1707908592897
+ }
+ ]
+ }
+ },
+ "25": {
+ "type": "data",
+ "title": "",
+ "query": "timeseries completionTokens=avg(doku.llm.completion.tokens)\n| sort arrayAvg(completionTokens)\n| append [timeseries promptTokens=avg(doku.llm.prompt.tokens)\n | sort arrayAvg(promptTokens)]",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "areaChart",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "legend": {
+ "hidden": false,
+ "position": "bottom"
+ },
+ "leftYAxisSettings": {
+ "label": ""
+ },
+ "categoricalBarChartSettings": {
+ "layout": "horizontal"
+ },
+ "fieldMapping": {
+ "timestamp": "timeframe",
+ "leftAxisValues": [
+ "completionTokens",
+ "promptTokens"
+ ],
+ "leftAxisDimensions": [],
+ "fields": [],
+ "values": []
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "error",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ }
+ }
+ },
+ "26": {
+ "type": "data",
+ "title": "",
+ "query": "timeseries duration=avg(doku.llm.prompt.tokens)\n| fieldsAdd duration.single_value=arrayAvg(duration)",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "singleValue",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540"
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f"
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a"
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "relative",
+ "groupingThresholdValue": 0,
+ "valueType": "relative"
+ },
+ "categoryOverrides": {},
+ "fieldMapping": {
+ "timestamp": "timeframe",
+ "leftAxisValues": [
+ "duration"
+ ],
+ "leftAxisDimensions": [
+ "duration.single_value"
+ ],
+ "fields": [],
+ "values": []
+ },
+ "categoricalBarChartSettings": {}
+ },
+ "singleValue": {
+ "showLabel": true,
+ "recordField": "duration.single_value",
+ "autoscale": true,
+ "sparklineSettings": {
+ "showTicks": false,
+ "variant": "area",
+ "record": "duration",
+ "visible": true
+ },
+ "trend": {
+ "visible": true,
+ "relative": true,
+ "isVisible": false
+ },
+ "label": "Avg Prompt Tokens / Request"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ }
+ }
+ },
+ "27": {
+ "type": "data",
+ "title": "",
+ "query": "timeseries duration=avg(doku.llm.completion.tokens)\n| fieldsAdd duration.single_value=arrayAvg(duration)",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "singleValue",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540"
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f"
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a"
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "relative",
+ "groupingThresholdValue": 0,
+ "valueType": "relative"
+ },
+ "categoryOverrides": {},
+ "fieldMapping": {
+ "timestamp": "timeframe",
+ "leftAxisValues": [
+ "duration"
+ ],
+ "leftAxisDimensions": [
+ "duration.single_value"
+ ],
+ "fields": [],
+ "values": []
+ },
+ "categoricalBarChartSettings": {}
+ },
+ "singleValue": {
+ "showLabel": true,
+ "recordField": "duration.single_value",
+ "autoscale": true,
+ "sparklineSettings": {
+ "showTicks": false,
+ "variant": "area",
+ "record": "duration",
+ "visible": true
+ },
+ "trend": {
+ "visible": true,
+ "relative": true,
+ "isVisible": false
+ },
+ "label": "Avg Completion Tokens / Request"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ }
+ }
+ },
+ "28": {
+ "type": "data",
+ "title": "Top Models by Cost",
+ "query": "timeseries cost=sum(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { model, interval, timeframe }\n| sort cost desc\n| limit 20",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "categoricalBarChart",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "absolute",
+ "groupingThresholdValue": 0,
+ "valueType": "relative",
+ "hideLabels": false
+ },
+ "categoryOverrides": {},
+ "categoricalBarChartSettings": {
+ "categoryAxis": "model",
+ "categoryAxisLabel": "model",
+ "valueAxis": [
+ "cost"
+ ],
+ "valueAxisLabel": "cost",
+ "layout": "horizontal",
+ "categoryAxisTickLayout": "horizontal",
+ "colorPaletteMode": "multi-color"
+ },
+ "legend": {
+ "hidden": true
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "generation",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": [
+ {
+ "identifier": "cost",
+ "unitCategory": "currency",
+ "baseUnit": "usd",
+ "displayUnit": null,
+ "decimals": 3,
+ "suffix": "",
+ "delimiter": false,
+ "added": 1707910273820
+ }
+ ]
+ }
+ },
+ "29": {
+ "type": "data",
+ "title": "Usage Cost by Platform",
+ "query": "timeseries cost=avg(doku.llm.usage.cost), by: { generation, endpoint, environment, finish_reason, application, model, source, job, platform }\n| fieldsAdd cost=arrayAvg(cost)\n| summarize { cost=avg(cost) } , by: { model, interval, timeframe }\n| sort cost desc\n| limit 20",
+ "davis": {
+ "enabled": false,
+ "davisVisualization": {
+ "isAvailable": true
+ }
+ },
+ "visualization": "areaChart",
+ "visualizationSettings": {
+ "thresholds": [
+ {
+ "id": "0",
+ "title": "",
+ "field": "",
+ "rules": [
+ {
+ "id": "0",
+ "label": "",
+ "comparator": "≥",
+ "color": "#7dc540",
+ "value": 0
+ },
+ {
+ "id": "1",
+ "label": "",
+ "comparator": "≥",
+ "color": "#f5d30f",
+ "value": 5
+ },
+ {
+ "id": "2",
+ "label": "",
+ "comparator": "≥",
+ "color": "#dc172a",
+ "value": 10
+ }
+ ],
+ "isEnabled": true
+ }
+ ],
+ "chartSettings": {
+ "gapPolicy": "connect",
+ "circleChartSettings": {
+ "groupingThresholdType": "absolute",
+ "groupingThresholdValue": 0,
+ "valueType": "relative",
+ "hideLabels": false
+ },
+ "categoryOverrides": {},
+ "categoricalBarChartSettings": {
+ "categoryAxis": "model",
+ "categoryAxisLabel": "model",
+ "valueAxis": "cost",
+ "valueAxisLabel": "cost",
+ "layout": "horizontal",
+ "categoryAxisTickLayout": "horizontal"
+ },
+ "legend": {
+ "hidden": true
+ },
+ "fieldMapping": {
+ "leftAxisValues": [
+ "cost"
+ ],
+ "rightAxisValues": [],
+ "leftAxisDimensions": [
+ "model"
+ ]
+ }
+ },
+ "singleValue": {
+ "showLabel": true,
+ "label": "",
+ "prefixIcon": "",
+ "recordField": "generation",
+ "autoscale": true,
+ "alignment": "center",
+ "colorThresholdTarget": "value"
+ },
+ "table": {
+ "rowDensity": "condensed",
+ "enableSparklines": false,
+ "hiddenColumns": [],
+ "lineWrapIds": [],
+ "columnWidths": {}
+ },
+ "unitsOverrides": [
+ {
+ "identifier": "cost",
+ "unitCategory": "currency",
+ "baseUnit": "usd",
+ "displayUnit": null,
+ "decimals": 3,
+ "suffix": "",
+ "delimiter": false,
+ "added": 1707910273820
+ }
+ ]
+ }
+ }
+ },
+ "layouts": {
+ "1": {
+ "x": 0,
+ "y": 24,
+ "w": 12,
+ "h": 8
+ },
+ "2": {
+ "x": 12,
+ "y": 24,
+ "w": 12,
+ "h": 8
+ },
+ "7": {
+ "x": 0,
+ "y": 0,
+ "w": 6,
+ "h": 3
+ },
+ "14": {
+ "x": 6,
+ "y": 0,
+ "w": 6,
+ "h": 3
+ },
+ "15": {
+ "x": 12,
+ "y": 0,
+ "w": 6,
+ "h": 3
+ },
+ "17": {
+ "x": 18,
+ "y": 0,
+ "w": 6,
+ "h": 3
+ },
+ "19": {
+ "x": 0,
+ "y": 3,
+ "w": 24,
+ "h": 5
+ },
+ "21": {
+ "x": 0,
+ "y": 8,
+ "w": 6,
+ "h": 5
+ },
+ "22": {
+ "x": 6,
+ "y": 8,
+ "w": 6,
+ "h": 5
+ },
+ "23": {
+ "x": 18,
+ "y": 8,
+ "w": 6,
+ "h": 5
+ },
+ "24": {
+ "x": 12,
+ "y": 8,
+ "w": 6,
+ "h": 5
+ },
+ "25": {
+ "x": 7,
+ "y": 13,
+ "w": 17,
+ "h": 6
+ },
+ "26": {
+ "x": 0,
+ "y": 13,
+ "w": 7,
+ "h": 3
+ },
+ "27": {
+ "x": 0,
+ "y": 16,
+ "w": 7,
+ "h": 3
+ },
+ "28": {
+ "x": 0,
+ "y": 19,
+ "w": 11,
+ "h": 5
+ },
+ "29": {
+ "x": 11,
+ "y": 19,
+ "w": 13,
+ "h": 5
+ }
+ }
+ }
+ ```
+</Accordion>
\ No newline at end of file
diff --git a/docs/0.0.4/connections/grafanacloud.mdx b/docs/0.0.6/connections/grafanacloud.mdx
similarity index 98%
rename from docs/0.0.4/connections/grafanacloud.mdx
rename to docs/0.0.6/connections/grafanacloud.mdx
index e3e621a9..3025d1f7 100644
--- a/docs/0.0.4/connections/grafanacloud.mdx
+++ b/docs/0.0.6/connections/grafanacloud.mdx
@@ -10,17 +10,21 @@ description: 'Connect Doku to Grafana Cloud'
Doku can automatically send LLM usage data from Doku to Grafana Cloud using the [Grafana Cloud Influx Telegraf](https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-influxdb/push-from-telegraf/) and [Loki Push HTTP API](https://grafana.com/docs/loki/latest/reference/api/#push-log-entries-to-loki)
-Add the following to your doku configuration file(`doku.yml`).
+Make the following curl request to Doku to add a connection for Grafana Cloud. See more on the [Connections API](/0.0.6/api-reference/endpoint/connections/create)
-```yaml doku.yml
-connections:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- grafanaCloud:
- promUrl: <your-grafana-cloud-influx-line-proxy-url> # URL to the Influx Line Proxy URL of the Grafana Cloud Prometheus Instance
- promUsername: <your-prometheus-userid> # Prometheus User ID of the Grafana Cloud Prometheus Instance
- lokiUrl: <your-loki-push-url> # URL to the Loki Push URL of the Grafana Cloud Loki Instance
- lokiUsername: <your-loki-username> # Loki Username of the Grafana Cloud Loki Instance
- accessToken: <your-grafana-cloud-access-token> # Access Token of the Grafana Cloud Instance
+```shell
+curl --request POST \
+ --url https://<YOUR_DOKU_URL>/api/connections \
+ --header 'Authorization: <DOKU_API_KEY>' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "Platform": "grafana",
+ "MetricsUrl": "<YOUR_GRAFANA_CLOUD_INFLUX_TELEGRAF_URL>",
+ "MetricsUsername": "<YOUR_GRAFANA_CLOUD_PROMETHEUS_USERNAME>",
+ "LogsUrl": "<YOUR_GRAFANA_CLOUD_LOGS_URL>",
+ "LogsUsername": "<YOUR_GRAFANA_CLOUD_LOGS_USERNAME>",
+ "ApiKey": "<YOUR_GRAFANA_CLOUD_API_KEY>"
+}'
```
## Grafana Resources
diff --git a/docs/0.0.1/connections/grafanaoss.mdx b/docs/0.0.6/connections/grafanaoss.mdx
similarity index 100%
rename from docs/0.0.1/connections/grafanaoss.mdx
rename to docs/0.0.6/connections/grafanaoss.mdx
diff --git a/docs/0.0.1/connections/intro.mdx b/docs/0.0.6/connections/intro.mdx
similarity index 74%
rename from docs/0.0.1/connections/intro.mdx
rename to docs/0.0.6/connections/intro.mdx
index a18aad8e..fbefe1ac 100644
--- a/docs/0.0.1/connections/intro.mdx
+++ b/docs/0.0.6/connections/intro.mdx
@@ -2,20 +2,32 @@
title: 'Introduction'
description: 'Connect to your existing Observablity Platform'
---
+Doku enhances observability by seamlessly exporting processed LLM data to your observability platform. This assists developers in bringing together all application-related data, including LLM usage metrics, on a unified platform, simplifying the visualization and assessment of the entire application ecosystem.
-Doku streamlines the observability experience by delivering processed LLM data right to the observability platform you are already familiar with. We recognize how crucial it is for developers to aggregate all application-related data, encompassing LLM usage metrics, into a single source of truth.
-
-This integration allows you to visualize and assess your entire application landscape in one integrated Observability platform, thereby refining your monitoring approaches and sharpening your decision-making.
-
-Below is a list of observability platforms that work seamlessly with Doku, allowing for integrated and expanded insights.
+Below is a list of observability platforms that work seamlessly with Doku:
<CardGroup cols={2}>
- <Card title="Grafana OSS" href="/0.0.1/connections/grafanaoss" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
+ <Card title="Grafana OSS" href="/0.0.6/connections/grafanaoss" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
+ </Card>
+ <Card title="Grafana Cloud" href="/0.0.6/connections/grafanacloud" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
+ </Card>
+ <Card title="DataDog" href="/0.0.6/connections/datadog" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Datadog</title><path d="M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"/></svg>}>
</Card>
- <Card title="Grafana Cloud" href="/0.0.1/connections/grafanacloud" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Grafana</title><path d="M23.02 10.59a8.578 8.578 0 0 0-.862-3.034 8.911 8.911 0 0 0-1.789-2.445c.337-1.342-.413-2.505-.413-2.505-1.292-.08-2.113.4-2.416.62-.052-.02-.102-.044-.154-.064-.22-.089-.446-.172-.677-.247-.231-.073-.47-.14-.711-.197a9.867 9.867 0 0 0-.875-.161C14.557.753 12.94 0 12.94 0c-1.804 1.145-2.147 2.744-2.147 2.744l-.018.093c-.098.029-.2.057-.298.088-.138.042-.275.094-.413.143-.138.055-.275.107-.41.166a8.869 8.869 0 0 0-1.557.87l-.063-.029c-2.497-.955-4.716.195-4.716.195-.203 2.658.996 4.33 1.235 4.636a11.608 11.608 0 0 0-.607 2.635C1.636 12.677.953 15.014.953 15.014c1.926 2.214 4.171 2.351 4.171 2.351.003-.002.006-.002.006-.005.285.509.615.994.986 1.446.156.19.32.371.488.548-.704 2.009.099 3.68.099 3.68 2.144.08 3.553-.937 3.849-1.173a9.784 9.784 0 0 0 3.164.501h.08l.055-.003.107-.002.103-.005.003.002c1.01 1.44 2.788 1.646 2.788 1.646 1.264-1.332 1.337-2.653 1.337-2.94v-.058c0-.02-.003-.039-.003-.06.265-.187.52-.387.758-.6a7.875 7.875 0 0 0 1.415-1.7c1.43.083 2.437-.885 2.437-.885-.236-1.49-1.085-2.216-1.264-2.354l-.018-.013-.016-.013a.217.217 0 0 1-.031-.02c.008-.092.016-.18.02-.27.011-.162.016-.323.016-.48v-.253l-.005-.098-.008-.135a1.891 1.891 0 0 0-.01-.13c-.003-.042-.008-.083-.013-.125l-.016-.124-.018-.122a6.215 6.215 0 0 0-2.032-3.73 6.015 6.015 0 0 0-3.222-1.46 6.292 6.292 0 0 0-.85-.048l-.107.002h-.063l-.044.003-.104.008a4.777 4.777 0 0 0-3.335 1.695c-.332.4-.592.84-.768 1.297a4.594 4.594 0 0 0-.312 1.817l.003.091c.005.055.007.11.013.164a3.615 3.615 0 0 0 .698 1.82 3.53 3.53 0 0 0 1.827 1.282c.33.098.66.14.971.137.039 0 .078 0 .114-.002l.063-.003c.02 0 .041-.003.062-.003.034-.002.065-.007.099-.01.007 0 .018-.003.028-.003l.031-.005.06-.008a1.18 1.18 0 0 0 .112-.02c.036-.008.072-.013.109-.024a2.634 2.634 0 0 0 .914-.415c.028-.02.056-.041.085-.065a.248.248 0 0 0 .039-.35.244.244 0 0 0-.309-.06l-.078.042c-.09.044-.184.083-.283.116a2.476 2.476 0 0 1-.475.096c-.028.003-.054.006-.083.006l-.083.002c-.026 0-.054 0-.08-.002l-.102-.006h-.012l-.024.006c-.016-.003-.031-.003-.044-.006-.031-.002-.06-.007-.091-.01a2.59 2.59 0 0 1-.724-.213 2.557 2.557 0 0 1-.667-.438 2.52 2.52 0 0 1-.805-1.475 2.306 2.306 0 0 1-.029-.444l.006-.122v-.023l.002-.031c.003-.021.003-.04.005-.06a3.163 3.163 0 0 1 1.352-2.29 3.12 3.12 0 0 1 .937-.43 2.946 2.946 0 0 1 .776-.101h.06l.07.002.045.003h.026l.07.005a4.041 4.041 0 0 1 1.635.49 3.94 3.94 0 0 1 1.602 1.662 3.77 3.77 0 0 1 .397 1.414l.005.076.003.075c.002.026.002.05.002.075 0 .024.003.052 0 .07v.065l-.002.073-.008.174a6.195 6.195 0 0 1-.08.639 5.1 5.1 0 0 1-.267.927 5.31 5.31 0 0 1-.624 1.13 5.052 5.052 0 0 1-3.237 2.014 4.82 4.82 0 0 1-.649.066l-.039.003h-.287a6.607 6.607 0 0 1-1.716-.265 6.776 6.776 0 0 1-3.4-2.274 6.75 6.75 0 0 1-.746-1.15 6.616 6.616 0 0 1-.714-2.596l-.005-.083-.002-.02v-.056l-.003-.073v-.096l-.003-.104v-.07l.003-.163c.008-.22.026-.45.054-.678a8.707 8.707 0 0 1 .28-1.355c.128-.444.286-.872.473-1.277a7.04 7.04 0 0 1 1.456-2.1 5.925 5.925 0 0 1 .953-.763c.169-.111.343-.213.524-.306.089-.05.182-.091.273-.135.047-.02.093-.042.138-.062a7.177 7.177 0 0 1 .714-.267l.145-.045c.049-.015.098-.026.148-.041.098-.029.197-.052.296-.076.049-.013.1-.02.15-.033l.15-.032.151-.028.076-.013.075-.01.153-.024c.057-.01.114-.013.171-.023l.169-.021c.036-.003.073-.008.106-.01l.073-.008.036-.003.042-.002c.057-.003.114-.008.171-.01l.086-.006h.023l.037-.003.145-.007a7.999 7.999 0 0 1 1.708.125 7.917 7.917 0 0 1 2.048.68 8.253 8.253 0 0 1 1.672 1.09l.09.077.089.078c.06.052.114.107.171.159.057.052.112.106.166.16.052.055.107.107.159.164a8.671 8.671 0 0 1 1.41 1.978c.012.026.028.052.04.078l.04.078.075.156c.023.051.05.1.07.153l.065.15a8.848 8.848 0 0 1 .45 1.34.19.19 0 0 0 .201.142.186.186 0 0 0 .172-.184c.01-.246.002-.532-.024-.856z"/></svg>}>
+ <Card title="New Relic" href="/0.0.6/connections/new-relic" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>New Relic</title><path d="M8.0015 14.3091v7.384L12.0008 24V12.0008L1.6078 5.9996v4.6167ZM12.0008 0 2.8232 5.2976 6.8209 7.606l5.1799-2.9893 6.3936 3.6913v7.384l-5.1783 2.9908v4.6167l9.176-5.2991V5.9996Z"/></svg>}>
</Card>
- <Card title="DataDog" href="/0.0.1/connections/datadog" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>Datadog</title><path d="M19.57 17.04l-1.997-1.316-1.665 2.782-1.937-.567-1.706 2.604.087.82 9.274-1.71-.538-5.794zm-8.649-2.498l1.488-.204c.241.108.409.15.697.223.45.117.97.23 1.741-.16.18-.088.553-.43.704-.625l6.096-1.106.622 7.527-10.444 1.882zm11.325-2.712l-.602.115L20.488 0 .789 2.285l2.427 19.693 2.306-.334c-.184-.263-.471-.581-.96-.989-.68-.564-.44-1.522-.039-2.127.53-1.022 3.26-2.322 3.106-3.956-.056-.594-.15-1.368-.702-1.898-.02.22.017.432.017.432s-.227-.289-.34-.683c-.112-.15-.2-.199-.319-.4-.085.233-.073.503-.073.503s-.186-.437-.216-.807c-.11.166-.137.48-.137.48s-.241-.69-.186-1.062c-.11-.323-.436-.965-.343-2.424.6.421 1.924.321 2.44-.439.171-.251.288-.939-.086-2.293-.24-.868-.835-2.16-1.066-2.651l-.028.02c.122.395.374 1.223.47 1.625.293 1.218.372 1.642.234 2.204-.116.488-.397.808-1.107 1.165-.71.358-1.653-.514-1.713-.562-.69-.55-1.224-1.447-1.284-1.883-.062-.477.275-.763.445-1.153-.243.07-.514.192-.514.192s.323-.334.722-.624c.165-.109.262-.178.436-.323a9.762 9.762 0 0 0-.456.003s.42-.227.855-.392c-.318-.014-.623-.003-.623-.003s.937-.419 1.678-.727c.509-.208 1.006-.147 1.286.257.367.53.752.817 1.569.996.501-.223.653-.337 1.284-.509.554-.61.99-.688.99-.688s-.216.198-.274.51c.314-.249.66-.455.66-.455s-.134.164-.259.426l.03.043c.366-.22.797-.394.797-.394s-.123.156-.268.358c.277-.002.838.012 1.056.037 1.285.028 1.552-1.374 2.045-1.55.618-.22.894-.353 1.947.68.903.888 1.609 2.477 1.259 2.833-.294.295-.874-.115-1.516-.916a3.466 3.466 0 0 1-.716-1.562 1.533 1.533 0 0 0-.497-.85s.23.51.23.96c0 .246.03 1.165.424 1.68-.039.076-.057.374-.1.43-.458-.554-1.443-.95-1.604-1.067.544.445 1.793 1.468 2.273 2.449.453.927.186 1.777.416 1.997.065.063.976 1.197 1.15 1.767.306.994.019 2.038-.381 2.685l-1.117.174c-.163-.045-.273-.068-.42-.153.08-.143.241-.5.243-.572l-.063-.111c-.348.492-.93.97-1.414 1.245-.633.359-1.363.304-1.838.156-1.348-.415-2.623-1.327-2.93-1.566 0 0-.01.191.048.234.34.383 1.119 1.077 1.872 1.56l-1.605.177.759 5.908c-.337.048-.39.071-.757.124-.325-1.147-.946-1.895-1.624-2.332-.599-.384-1.424-.47-2.214-.314l-.05.059a2.851 2.851 0 0 1 1.863.444c.654.413 1.181 1.481 1.375 2.124.248.822.42 1.7-.248 2.632-.476.662-1.864 1.028-2.986.237.3.481.705.876 1.25.95.809.11 1.577-.03 2.106-.574.452-.464.69-1.434.628-2.456l.714-.104.258 1.834 11.827-1.424zM15.05 6.848c-.034.075-.085.125-.007.37l.004.014.013.032.032.073c.14.287.295.558.552.696.067-.011.136-.019.207-.023.242-.01.395.028.492.08.009-.048.01-.119.005-.222-.018-.364.072-.982-.626-1.308-.264-.122-.634-.084-.757.068a.302.302 0 0 1 .058.013c.186.066.06.13.027.207m1.958 3.392c-.092-.05-.52-.03-.821.005-.574.068-1.193.267-1.328.372-.247.191-.135.523.047.66.511.382.96.638 1.432.575.29-.038.546-.497.728-.914.124-.288.124-.598-.058-.698m-5.077-2.942c.162-.154-.805-.355-1.556.156-.554.378-.571 1.187-.041 1.646.053.046.096.078.137.104a4.77 4.77 0 0 1 1.396-.412c.113-.125.243-.345.21-.745-.044-.542-.455-.456-.146-.749"/></svg>}>
+ <Card title="SigNoz" href="/0.0.6/connections/signoz" icon={<svg role="img" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><title>SigNoz</title><path opacity="0.1" d="M100.279 199.833C44.5682 199.833 0 156.12 0 101.479C0 47.3844 44.5682 3.125 100.279 3.125H163.231C183.844 3.125 200 19.5174 200 39.1882V101.479C200 156.12 155.432 199.833 100.279 199.833Z"/><path d="M99.4919 58.9008C57.8802 58.9008 34.4413 93.3585 33.4637 94.8253C31.0537 98.4385 31.0537 103.111 33.4655 106.727C34.4413 108.191 57.8802 142.649 99.4919 142.649C141.103 142.649 164.543 108.191 165.52 106.724C167.93 103.111 167.93 98.4385 165.518 94.8227C164.542 93.3585 141.103 58.9008 99.4919 58.9008ZM39.2234 102.886C38.3677 101.604 38.3677 99.9463 39.2234 98.6633C40.0095 97.4834 56.6976 72.9705 86.5341 67.0904C73.0136 72.3095 63.393 85.4356 63.393 100.775C63.393 116.114 73.0136 129.24 86.5341 134.459C56.6976 128.579 40.0095 104.066 39.2234 102.886ZM82.8568 100.775C82.8568 102.686 81.3074 104.235 79.396 104.235C77.4845 104.235 75.9352 102.686 75.9352 100.775C75.9352 87.7858 86.5024 77.2185 99.4916 77.2185C101.403 77.2185 102.952 78.7676 102.952 80.6792C102.952 82.5908 101.403 84.1398 99.4916 84.1398C90.3189 84.1398 82.8568 91.6019 82.8568 100.775ZM99.4919 109.188C94.8525 109.188 91.0783 105.414 91.0783 100.775C91.0783 96.1356 94.8525 92.3612 99.4919 92.3612C104.132 92.3612 107.906 96.1354 107.906 100.775C107.906 105.414 104.132 109.188 99.4919 109.188ZM159.76 102.886C158.974 104.066 142.286 128.579 112.45 134.459C125.971 129.24 135.591 116.114 135.591 100.775C135.591 85.4358 125.971 72.3096 112.45 67.0905C142.286 72.971 158.974 97.4837 159.76 98.6634C160.616 99.9463 160.616 101.604 159.76 102.886Z"/></svg>}>
</Card>
- <Card title="New Relic" href="/0.0.1/connections/new-relic" icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>New Relic</title><path d="M8.0015 14.3091v7.384L12.0008 24V12.0008L1.6078 5.9996v4.6167ZM12.0008 0 2.8232 5.2976 6.8209 7.606l5.1799-2.9893 6.3936 3.6913v7.384l-5.1783 2.9908v4.6167l9.176-5.2991V5.9996Z"/></svg>}>
+ <Card title="Dynatrace" href="/0.0.6/connections/dynatrace" icon={<svg viewBox="0 0 24 24" role="img" xmlns="http://www.w3.org/2000/svg"><title>Dynatrace icon</title><path d="M9.373 0c-.31.006-.93.09-1.521.654C6.98 1.478 2.628 5.61.88 7.27.09 8.024.16 8.865.16 8.934v.377c.067-.292.187-.499.427-.825.496-.616 1.3-.788 1.627-.822a64.233 64.233 0 0 1 .002 0 64.233 64.233 0 0 1 6.527-.549c4.335-.137 7.197.225 7.197.225l6.084-5.793s-3.188-.6-6.82-1.027A93.394 93.394 0 0 0 9.566.006c-.021 0-.09-.008-.193-.006zm13.56 2.508l-6.066 5.79s.222 2.88-.137 7.198c-.189 2.45-.584 4.866-.875 6.494-.052.326-.256 1.114-.925 1.594-.29.198-.491.295-.748.363 1.546-.51 1.091-7.047 1.091-7.047-4.335.137-7.214-.222-7.214-.222L1.975 22.47s3.222.634 6.855 1.045c2.056.24 4.833.429 5.227.463.023 0 .045-.007.068-.012-.013.003-.022.009-.035.012.138 0 .259.015.379.015.085 0 .925.105 1.713-.648 1.748-1.663 6.083-5.81 6.94-6.633.788-.754.72-1.594.72-1.68a81.84 81.84 0 0 0-.207-5.654c-.24-3.65-.701-6.871-.701-6.871zM3.856 8.305C2.125 8.307.348 8.513.16 9.326c.017 1.216.05 3.137.205 5.28.24 3.65.703 6.886.703 6.886l6.082-5.79c-.017.017-.239-2.88.121-7.198H7.27s-1.684-.202-3.415-.2z"/></svg>}>
</Card>
+</CardGroup>
+
+---
+
+<CardGroup cols={2}>
+<Card title="Integrations" href="/0.0.6/integrations/introduction" icon='circle-nodes'>
+Integrate your LLM Provider with Doku
+</Card>
+<Card title="API Refernce" href="/0.0.6/api-reference/introduction" icon='code'>
+OpenAPI specification for API Endpoints in Doku
+</Card>
</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.4/connections/new-relic.mdx b/docs/0.0.6/connections/new-relic.mdx
similarity index 96%
rename from docs/0.0.4/connections/new-relic.mdx
rename to docs/0.0.6/connections/new-relic.mdx
index 1d595b4c..33cdf970 100644
--- a/docs/0.0.4/connections/new-relic.mdx
+++ b/docs/0.0.6/connections/new-relic.mdx
@@ -11,15 +11,19 @@ description: 'Connect Doku to New Relic'
Doku can automatically send LLM usage data from Doku to New Relic using the [Report Metrics HTTP API](https://docs.newrelic.com/docs/data-apis/ingest-apis/metric-api/report-metrics-metric-api/) and [Send Logs API](https://docs.newrelic.com/docs/logs/log-api/introduction-log-api/)
-Add the following to your doku configuration file(`doku.yml`).
+Make the following curl request to Doku to add a connection for New Relic. See more on the [Connections API](/0.0.6/api-reference/endpoint/connections/create)
-```yaml doku.yml
-connections:
- enabled: true # Enable or Disable the Observability Platform, Example: true
- newRelic:
- metricsUrl: <your-new-relic-metrics-url> # URL to the New Relic Metric API
- logsUrl: <your-new-relic-logs-url> # URL to the New Relic Log API
- key: <your-new-relic-api-key> # Ingest API Key of the New Relic Account
+```shell
+curl --request POST \
+ --url https://<YOUR_DOKU_URL>/api/connections \
+ --header 'Authorization: <DOKU_API_KEY>' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "Platform": "newrelic",
+ "MetricsUrl": "<YOUR_NEWRELIC_METRICS_URL>",
+ "LogsUrl": "<YOUR_NEWRELIC_LOGS_URL>",
+ "ApiKey": "<YOUR_NEWRELIC_API_KEY>"
+}'
```
## New Relic Resources
diff --git a/docs/0.0.6/connections/signoz.mdx b/docs/0.0.6/connections/signoz.mdx
new file mode 100644
index 00000000..3ad27a62
--- /dev/null
+++ b/docs/0.0.6/connections/signoz.mdx
@@ -0,0 +1,1469 @@
+---
+title: 'SigNoz'
+description: 'Connect Doku to SigNoz'
+---
+
+<Frame>
+ <img src="https://github.com/dokulabs/doku/blob/main/docs/images/signoz-dashboard-1.jpg?raw=true" />
+ <img src="https://github.com/dokulabs/doku/blob/main/docs/images/signoz-dashboard-2.jpg?raw=true" />
+</Frame>
+
+Doku can automatically send LLM usage data from Doku to SigNoz using the [HTTP Logs API](https://signoz.io/docs/userguide/send-logs-http/)
+
+Make the following curl request to Doku to add a connection for SigNoz. See more on the [Connections API](/0.0.6/api-reference/endpoint/connections/create)
+
+```shell
+curl --request POST \
+ --url https://<YOUR_DOKU_URL>/api/connections \
+ --header 'Authorization: <DOKU_API_KEY>' \
+ --header 'Content-Type: application/json' \
+ --data '{
+ "Platform": "signoz",
+ "LogsUrl": "<YOUR_SIGNOZ_LOGS_URL>",
+ "ApiKey": "<YOUR_SIGNOZ_API_KEY>"
+}'
+```
+
+## SigNoz Resources
+
+<Accordion title="Dashboard">
+ ```json
+ {
+ "description": "This dashboard tracks costs, tokens, & model usage for LLM Applications via Doku for enhanced performance and evaluation.",
+ "layout": [
+ {
+ "h": 3,
+ "i": "4d33e5a0-2e34-4626-9dff-f795cd8e62ee",
+ "moved": false,
+ "static": false,
+ "w": 9,
+ "x": 0,
+ "y": 5
+ },
+ {
+ "h": 3,
+ "i": "5705486f-dfab-4428-96ce-97d5ccfc0620",
+ "moved": false,
+ "static": false,
+ "w": 6,
+ "x": 6,
+ "y": 17
+ },
+ {
+ "h": 3,
+ "i": "532306fd-bc68-4e3e-a76f-313b92d22f0e",
+ "moved": false,
+ "static": false,
+ "w": 3,
+ "x": 9,
+ "y": 14
+ },
+ {
+ "h": 3,
+ "i": "60e26de7-3b68-4348-b31b-bb7275a26a45",
+ "moved": false,
+ "static": false,
+ "w": 12,
+ "x": 0,
+ "y": 2
+ },
+ {
+ "h": 2,
+ "i": "443e85bf-9863-4002-abd4-0407fa12e92d",
+ "moved": false,
+ "static": false,
+ "w": 3,
+ "x": 2,
+ "y": 0
+ },
+ {
+ "h": 3,
+ "i": "84dc9645-8c6c-4b9a-9558-2386b6eb4d10",
+ "moved": false,
+ "static": false,
+ "w": 6,
+ "x": 0,
+ "y": 17
+ },
+ {
+ "h": 2,
+ "i": "99d0eee5-9e91-4496-a7ee-70508cbbca6b",
+ "moved": false,
+ "static": false,
+ "w": 3,
+ "x": 5,
+ "y": 0
+ },
+ {
+ "h": 2,
+ "i": "a0f453e8-0b6f-45bb-910c-6171a50919a9",
+ "moved": false,
+ "static": false,
+ "w": 2,
+ "x": 0,
+ "y": 0
+ },
+ {
+ "h": 2,
+ "i": "4f778a79-54cd-4a99-a5b0-3d06647c1fb9",
+ "moved": false,
+ "static": false,
+ "w": 4,
+ "x": 8,
+ "y": 0
+ },
+ {
+ "h": 3,
+ "i": "1128a154-ed4f-4189-b1ca-d52f28a78d28",
+ "moved": false,
+ "static": false,
+ "w": 3,
+ "x": 9,
+ "y": 11
+ },
+ {
+ "h": 3,
+ "i": "0c3a8c8a-5116-47f2-9dfe-242440ee65df",
+ "moved": false,
+ "static": false,
+ "w": 3,
+ "x": 9,
+ "y": 8
+ },
+ {
+ "h": 3,
+ "i": "ec9a5671-4a0c-4172-a383-82f37ab682f7",
+ "moved": false,
+ "static": false,
+ "w": 3,
+ "x": 9,
+ "y": 5
+ },
+ {
+ "h": 3,
+ "i": "af5f5471-e523-49e5-8de3-17a8c43fd115",
+ "moved": false,
+ "static": false,
+ "w": 9,
+ "x": 0,
+ "y": 8
+ },
+ {
+ "h": 3,
+ "i": "4f33601c-9707-4b52-8194-e6671c52666e",
+ "moved": false,
+ "static": false,
+ "w": 9,
+ "x": 0,
+ "y": 11
+ },
+ {
+ "h": 3,
+ "i": "11cba8dc-b2de-4eb6-a546-8a3cbe43cba2",
+ "moved": false,
+ "static": false,
+ "w": 9,
+ "x": 0,
+ "y": 14
+ }
+ ],
+ "name": "",
+ "tags": [
+ "Doku",
+ "OpenAI",
+ "Cohere",
+ "Anthropic"
+ ],
+ "title": "Doku - LLM Monitoring",
+ "variables": {},
+ "widgets": [
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "a0f453e8-0b6f-45bb-910c-6171a50919a9",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "value",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "",
+ "id": "------false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "",
+ "type": ""
+ },
+ "aggregateOperator": "count",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "9a3b0db1",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [],
+ "having": [],
+ "legend": "",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "984ba011-8db8-45aa-a4e2-8668569236bb",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Total Requests",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "99d0eee5-9e91-4496-a7ee-70508cbbca6b",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "value",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "totalTokens--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "totalTokens",
+ "type": "tag"
+ },
+ "aggregateOperator": "avg",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [],
+ "op": "AND"
+ },
+ "groupBy": [],
+ "having": [],
+ "legend": "",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "last",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "ebc81d59-4638-46a7-b111-adb28ccf64ac",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Avg Tokens / Request",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "84dc9645-8c6c-4b9a-9558-2386b6eb4d10",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "table",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "requestDuration--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "requestDuration",
+ "type": "tag"
+ },
+ "aggregateOperator": "count",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "eb4d013a",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "model--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "model",
+ "type": "tag"
+ }
+ ],
+ "having": [],
+ "legend": "Count",
+ "limit": null,
+ "orderBy": [
+ {
+ "columnName": "timestamp",
+ "order": "desc"
+ }
+ ],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "2e7436ea-db19-4790-aeef-e905849ed401",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Model Usage",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "4f778a79-54cd-4a99-a5b0-3d06647c1fb9",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "value",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "usageCost--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "usageCost",
+ "type": "tag"
+ },
+ "aggregateOperator": "avg",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "6ce37ed5",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [],
+ "having": [],
+ "legend": "",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "last",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "6d5d2593-1ae7-481f-88be-ba762b9196a0",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Avg Cost / Request",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "443e85bf-9863-4002-abd4-0407fa12e92d",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "value",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "requestDuration--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "requestDuration",
+ "type": "tag"
+ },
+ "aggregateOperator": "avg",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "65e9c28f",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [],
+ "having": [],
+ "legend": "",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "last",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "38484c36-2230-45a7-9f0d-4211c9d00975",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Avg Request Duration",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "60e26de7-3b68-4348-b31b-bb7275a26a45",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "graph",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "requestDuration--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "requestDuration",
+ "type": "tag"
+ },
+ "aggregateOperator": "count",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "f28b0509",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [],
+ "having": [],
+ "legend": "Count",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "c6d1c906-6116-4559-a1eb-33b53d0abfcd",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Requests overtime",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "532306fd-bc68-4e3e-a76f-313b92d22f0e",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "table",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "requestDuration--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "requestDuration",
+ "type": "tag"
+ },
+ "aggregateOperator": "count",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "78e35563",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "applicationName--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "applicationName",
+ "type": "tag"
+ }
+ ],
+ "having": [],
+ "legend": "",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "24b9c833-d9ef-40de-b10c-1dbfbd7ef7c5",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Usage by Application",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "1128a154-ed4f-4189-b1ca-d52f28a78d28",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "table",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "requestDuration--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "requestDuration",
+ "type": "tag"
+ },
+ "aggregateOperator": "count",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "c79b6091",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "environment--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "environment",
+ "type": "resource"
+ }
+ ],
+ "having": [],
+ "legend": "",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "790116c6-535c-4e08-9fa2-0a158eb7b796",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Usage by Environment",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "0c3a8c8a-5116-47f2-9dfe-242440ee65df",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "table",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "requestDuration--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "requestDuration",
+ "type": "tag"
+ },
+ "aggregateOperator": "count",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "b575368c",
+ "key": {
+ "dataType": "string",
+ "id": "applicationName--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "applicationName",
+ "type": "tag"
+ },
+ "op": "exists",
+ "value": ""
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "platform--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "platform",
+ "type": "tag"
+ }
+ ],
+ "having": [],
+ "legend": "",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "d59f9848-99b6-4d7b-9c3f-ab4752623cff",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Usage by Platform",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "ec9a5671-4a0c-4172-a383-82f37ab682f7",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "table",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "requestDuration--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "requestDuration",
+ "type": "tag"
+ },
+ "aggregateOperator": "count",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "5a2b96e0",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "generation--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "generation",
+ "type": "tag"
+ }
+ ],
+ "having": [],
+ "legend": "",
+ "limit": null,
+ "orderBy": [
+ {
+ "columnName": "#SIGNOZ_VALUE",
+ "order": "desc"
+ }
+ ],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "db77fe7d-8982-4f4a-ab90-b139151ae121",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Usage by Category",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "5705486f-dfab-4428-96ce-97d5ccfc0620",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "graph",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "usageCost--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "usageCost",
+ "type": "tag"
+ },
+ "aggregateOperator": "avg",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "67d33dbc",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "model--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "model",
+ "type": "tag"
+ }
+ ],
+ "having": [],
+ "legend": "{{model}}",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "9d51906e-c800-4063-b355-333f882cfa74",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Avg Cost by Model",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "4d33e5a0-2e34-4626-9dff-f795cd8e62ee",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "graph",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "usageCost--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "usageCost",
+ "type": "tag"
+ },
+ "aggregateOperator": "avg",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "b906c8d2",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "generation--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "generation",
+ "type": "tag"
+ }
+ ],
+ "having": [],
+ "legend": "{{generation}}",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "a6678a16-3579-4037-8644-aa29c102dc41",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Avg Cost by Category",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "af5f5471-e523-49e5-8de3-17a8c43fd115",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "graph",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "usageCost--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "usageCost",
+ "type": "tag"
+ },
+ "aggregateOperator": "avg",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "11c2ee90",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "platform--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "platform",
+ "type": "tag"
+ }
+ ],
+ "having": [],
+ "legend": "{{platform}}",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "490a0010-6497-4caf-a19f-06532673278c",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Avg Cost by Platform",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "4f33601c-9707-4b52-8194-e6671c52666e",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "graph",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "usageCost--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "usageCost",
+ "type": "tag"
+ },
+ "aggregateOperator": "avg",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "e2a969e5",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "environment--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "environment",
+ "type": "resource"
+ }
+ ],
+ "having": [],
+ "legend": "{{environment}}",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "8bb7bebd-1472-4f1b-8ab8-9c649581bac0",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Avg Cost by Environment",
+ "yAxisUnit": "none"
+ },
+ {
+ "description": "",
+ "fillSpans": false,
+ "id": "11cba8dc-b2de-4eb6-a546-8a3cbe43cba2",
+ "isStacked": false,
+ "nullZeroValues": "zero",
+ "opacity": "1",
+ "panelTypes": "graph",
+ "query": {
+ "builder": {
+ "queryData": [
+ {
+ "aggregateAttribute": {
+ "dataType": "float64",
+ "id": "usageCost--float64--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "usageCost",
+ "type": "tag"
+ },
+ "aggregateOperator": "avg",
+ "dataSource": "logs",
+ "disabled": false,
+ "expression": "A",
+ "filters": {
+ "items": [
+ {
+ "id": "e2a969e5",
+ "key": {
+ "dataType": "string",
+ "id": "job--string--resource--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "job",
+ "type": "resource"
+ },
+ "op": "=",
+ "value": "doku"
+ }
+ ],
+ "op": "AND"
+ },
+ "groupBy": [
+ {
+ "dataType": "string",
+ "id": "applicationName--string--tag--false",
+ "isColumn": false,
+ "isJSON": false,
+ "key": "applicationName",
+ "type": "tag"
+ }
+ ],
+ "having": [],
+ "legend": "{{applicationName}}",
+ "limit": null,
+ "orderBy": [],
+ "queryName": "A",
+ "reduceTo": "sum",
+ "stepInterval": 60
+ }
+ ],
+ "queryFormulas": []
+ },
+ "clickhouse_sql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "id": "9c3b02ce-4ff7-4992-a323-0e492f85cb5b",
+ "promql": [
+ {
+ "disabled": false,
+ "legend": "",
+ "name": "A",
+ "query": ""
+ }
+ ],
+ "queryType": "builder"
+ },
+ "softMax": null,
+ "softMin": null,
+ "thresholds": [],
+ "timePreferance": "GLOBAL_TIME",
+ "title": "Avg Cost by Application",
+ "yAxisUnit": "none"
+ }
+ ]
+ }
+ ```
+</Accordion>
\ No newline at end of file
diff --git a/docs/0.0.6/installation.mdx b/docs/0.0.6/installation.mdx
new file mode 100644
index 00000000..72beccc7
--- /dev/null
+++ b/docs/0.0.6/installation.mdx
@@ -0,0 +1,102 @@
+---
+title: 'Install Doku'
+description: 'Deploy Doku in your preferred environment'
+icon: 'circle-down'
+---
+
+Doku flexibly adapts to your preferred environment. Select a deployment method that best fits your needs:
+
+<CardGroup cols={2}>
+ <Card
+ title="Kubernetes"
+ icon={<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <title>Kubernetes</title>
+ <path fill="#FFA500" d="M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z"/></svg>}
+ href="/0.0.6/installation#kubernetes"
+ >
+ Deploy Doku on a Kubernetes for scalable LLM Monitoring capabilities.
+ </Card>
+ <Card
+ title="Docker"
+ icon="docker"
+ href="/0.0.6/installation#docker"
+ >
+ Deploy Doku using Docker for an easy-to-manage LLM Monitoring setup.
+ </Card>
+</CardGroup>
+
+## Kubernetes
+
+Deploy Doku on your Kubernetes cluster using the [Doku Helm chart](https://github.com/dokulabs/helm/tree/main/charts/doku) for a reliable and scalable solution.
+<Steps>
+ <Step title="Helm Repo Setup">
+ ```shell shell
+ helm repo add dokulabs https://dokulabs.github.io/helm/
+ helm repo update
+ ```
+ </Step>
+ <Step title="Installing the Helm Chart">
+ ```shell shell
+ helm install doku dokulabs/doku
+ ```
+ </Step>
+</Steps>
+<Info>As Doku does not have a built-in visualization UI yet, it is preferred that you set up the `connections` configuration within the [values.yaml](https://github.com/dokulabs/helm/blob/main/charts/doku/values.yaml) file. Doing so enables visualization of the LLM Observability data processed by Doku using an external observability platform.</Info>
+
+## Docker
+For a quick and straightforward setup, Docker Compose can be used to deploy Doku.
+
+<Steps>
+ <Step title="Create `docker-compose.yml`">
+ ```yml
+ version: '3.8'
+
+ services:
+ clickhouse:
+ image: clickhouse/clickhouse-server:24.1.5
+ container_name: clickhouse
+ environment:
+ CLICKHOUSE_PASSWORD: ${DOKU_DB_PASSWORD:-DOKU}
+ CLICKHOUSE_USER: ${DOKU_DB_USER:-default}
+ volumes:
+ - clickhouse-data:/var/lib/clickhouse
+ ports:
+ - "${DOKU_DB_PORT:-9000}:9000"
+ restart: always
+
+ doku-ingester:
+ image: ghcr.io/patcher99/doku-ingester:0.0.8
+ container_name: doku-ingester
+ environment:
+ DOKU_DB_HOST: clickhouse
+ DOKU_DB_PORT: ${DOKU_DB_PORT:-9000}
+ DOKU_DB_NAME: ${DOKU_DB_NAME:-default}
+ DOKU_DB_USER: ${DOKU_DB_USER:-default}
+ DOKU_DB_PASSWORD: ${DOKU_DB_PASSWORD:-DOKU}
+ ports:
+ - "9044:9044"
+ depends_on:
+ - clickhouse
+ restart: always
+
+ volumes:
+ clickhouse-data:
+ ```
+ </Step>
+ <Step title="Start Docker Compose">
+ ```shell
+ docker-compose up -d
+ ```
+ </Step>
+</Steps>
+
+---
+
+<CardGroup cols={2}>
+<Card title="Integrations" href="/0.0.6/integrations/introduction" icon='circle-nodes'>
+Integrate your LLM Provider with Doku
+</Card>
+<Card title="Connections" href="/0.0.6/connections/intro" icon='link'>
+Connect to your existing Observablity Platform
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/anthropic/examples/completions.mdx b/docs/0.0.6/integrations/anthropic/examples/completions.mdx
new file mode 100644
index 00000000..38a0a011
--- /dev/null
+++ b/docs/0.0.6/integrations/anthropic/examples/completions.mdx
@@ -0,0 +1,53 @@
+---
+title: 'Completions'
+description: 'Monitor Anthropic Completions API Usage'
+---
+
+## Completions
+<Tabs>
+ <Tab title="Python">
+ ```python
+ from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
+ import dokumetry
+
+ anthropic = Anthropic(
+ # defaults to os.environ.get("ANTHROPIC_API_KEY")
+ api_key="my_api_key",
+ )
+
+ # Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
+ dokumetry.init(llm=anthropic, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ completion = anthropic.completions.create(
+ model="claude-2",
+ max_tokens_to_sample=300,
+ prompt=f"{HUMAN_PROMPT} Hello, Claude{AI_PROMPT}",
+ )
+ print(completion.completion)
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```javascript
+ import Anthropic from '@anthropic-ai/sdk';
+ import DokuMetry from 'dokumetry';
+
+ const anthropic = new Anthropic({
+ apiKey: 'my_api_key', // defaults to process.env["ANTHROPIC_API_KEY"]
+ });
+
+ // Pass the above `anthropic` object along with your DOKU URL and API key and this will make sure that all Anthropic calls are automatically tracked.
+ DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const completion = await anthropic.completions.create({
+ model: 'claude-2',
+ max_tokens_to_sample: 300,
+ prompt: `${Anthropic.HUMAN_PROMPT} Hello, Claude{Anthropic.AI_PROMPT}`,
+ });
+ console.log(completion.completion);
+ }
+ main().catch(console.error);
+ ```
+ </Tab>
+</Tabs>
+
diff --git a/docs/0.0.6/integrations/anthropic/introduction.mdx b/docs/0.0.6/integrations/anthropic/introduction.mdx
new file mode 100644
index 00000000..5ddfd673
--- /dev/null
+++ b/docs/0.0.6/integrations/anthropic/introduction.mdx
@@ -0,0 +1,91 @@
+---
+title: 'Anthropic Integration'
+sidebarTitle: 'Get Started'
+---
+
+DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Anthropic usage data and metrics from your Python/NodeJS code.
+
+## Get Started
+
+The integration is compatible with Anthropic SDK versions >=0.10.0
+
+<Tabs>
+ <Tab title="Python">
+ ```shell
+ pip install dokumetry
+ ```
+
+ ```python
+ from anthropic import Anthropic, HUMAN_PROMPT, AI_PROMPT
+ import dokumetry
+
+ anthropic = Anthropic(
+ api_key="anthropic_api_key",
+ )
+
+ dokumetry.init(llm = anthropic, doku_url = "YOUR_DOKU_URL", api_key = "YOUR_DOKU_TOKEN")
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```shell
+ npm install dokumetry
+ ```
+
+ ```javascript
+ import Anthropic from '@anthropic-ai/sdk';
+ import DokuMetry from 'dokumetry';
+
+ const anthropic = new Anthropic({
+ apiKey: 'anthropic_api_key',
+ });
+
+ DokuMetry.init({llm: anthropic, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+ ```
+ </Tab>
+</Tabs>
+
+## Supported Endpoints
+
+The following Anthropic Endpoints are supported for monitoring with DokuMetry
+
+- [Completions](/0.0.6/integrations/anthropic/examples/completions)
+
+## Parameters
+<Tabs>
+ <Tab title="Python">
+ | Parameter | Description | Required |
+ |-------------------|-----------------------------------------------------------|---------------|
+ | llm | Anthropic Object to track | Yes |
+ | doku_url | URL of your Doku Ingester | Yes |
+ | api_key | Your Doku API key | Yes |
+ | environment | Custom environment tag to include in your metrics | Optional |
+ | application_name | Custom application name tag for your metrics | Optional |
+ | skip_resp | Skip response from the Doku Ingester for faster execution | Optional |
+ </Tab>
+ <Tab title="NodeJS">
+ | Parameter | Description | Required |
+ |-------------------|-----------------------------------------------------------|---------------|
+ | llm | Anthropic Object to track | Yes |
+ | dokuUrl | URL of your Doku Ingester | Yes |
+ | apiKey | Your Doku API key | Yes |
+ | environment | Custom environment tag to include in your metrics | Optional |
+ | applicationName | Custom application name tag for your metrics | Optional |
+ | skipResp | Skip response from the Doku Ingester for faster execution | Optional |
+ </Tab>
+</Tabs>
+
+## Advanced Usage
+When using DokuMetry in Production environments, It is recommened to set Skip response parameter to `true` for faster porcessing.
+
+To filter your LLM Usage according application or the environment, set the Application name and Environment paramaters with the actual values.
+
+---
+
+<CardGroup cols={2}>
+<Card title="Connections" href="/0.0.6/connections/intro" icon='link'>
+Connect to your existing Observablity Platform
+</Card>
+<Card title="API Refernce" href="/0.0.6/api-reference/introduction" icon='code'>
+OpenAPI specification for API Endpoints in Doku
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/cohere/examples/chat.mdx b/docs/0.0.6/integrations/cohere/examples/chat.mdx
new file mode 100644
index 00000000..9ab82220
--- /dev/null
+++ b/docs/0.0.6/integrations/cohere/examples/chat.mdx
@@ -0,0 +1,108 @@
+---
+title: 'Chat'
+description: 'Monitor Cohere Chat API usage'
+---
+
+## Chat
+<Tabs>
+ <Tab title="Python">
+ <CodeGroup>
+ ```python No Streaming
+ import cohere
+ import dokumetry
+
+ co = cohere.Client('<<apiKey>>')
+
+ # Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ response = co.chat(
+ chat_history=[
+ {"role": "USER", "message": "Who discovered gravity?"},
+ {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
+ ],
+ message="What year was he born?",
+ # perform web search before answering the question. You can also use your own custom connector.
+ connectors=[{"id": "web-search"}]
+ )
+ print(response)
+ ```
+
+ ```python Streaming
+ import cohere
+ import dokumetry
+
+ co = cohere.Client('<<apiKey>>')
+
+ # Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ response = co.chat(
+ chat_history=[
+ {"role": "USER", "message": "Who discovered gravity?"},
+ {"role": "CHATBOT", "message": "The man who is widely credited with discovering gravity is Sir Isaac Newton"}
+ ],
+ message="What year was he born?",
+ stream=True,
+ # perform web search before answering the question. You can also use your own custom connector.
+ connectors=[{"id": "web-search"}]
+ )
+ print(response)
+ ```
+ </CodeGroup>
+ </Tab>
+ <Tab title="Javascript">
+ <CodeGroup>
+ ```javascript No Streaming
+ import { CohereClient } from "cohere-ai";
+ import DokuMetry from 'dokumetry';
+
+ const cohere = new CohereClient({
+ token: "<<apiKey>>",
+ });
+
+ (async () => {
+ // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ const response = await cohere.chat({
+ message: 'Say this is a test',
+ model: 'command',
+ });
+
+ console.log(response)
+ })();
+ ```
+
+ ```javascript Streaming
+ import { CohereClient } from "cohere-ai";
+ import DokuMetry from 'dokumetry';
+
+ const cohere = new CohereClient({
+ token: "<<apiKey>>",
+ });
+
+ (async () => {
+ // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ const chatStream = await cohere.chatStream({
+ chatHistory: [
+ { role: "USER", message: "Who discovered gravity?" },
+ { role: "CHATBOT", message: "The man who is widely credited with discovering gravity is Sir Isaac Newton" }
+ ],
+ message: "What year was he born?",
+ // perform web search before answering the question. You can also use your own custom connector.
+ connectors: [{ id: "web-search" }],
+ });
+
+ for await (const message of chatStream) {
+ if (message.eventType === "text-generation") {
+ console.log(message);
+ }
+ }
+ })();
+ ```
+ </CodeGroup>
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/cohere/examples/embed.mdx b/docs/0.0.6/integrations/cohere/examples/embed.mdx
new file mode 100644
index 00000000..63857c2a
--- /dev/null
+++ b/docs/0.0.6/integrations/cohere/examples/embed.mdx
@@ -0,0 +1,48 @@
+---
+title: 'Embed'
+description: 'Monitor Cohere Embed API usage'
+---
+
+## Embed
+<Tabs>
+ <Tab title="Python">
+ ```python
+ import cohere
+ import dokumetry
+
+ co = cohere.Client('<<apiKey>>')
+
+ # Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ response = co.embed(
+ texts=['hello', 'goodbye'],
+ model='embed-english-v3.0',
+ input_type='classification'
+ )
+ print(response)
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```javascript
+ import { CohereClient } from "cohere-ai";
+ import DokuMetry from 'dokumetry';
+
+ const cohere = new CohereClient({
+ token: "<<apiKey>>",
+ });
+
+ (async () => {
+ // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ const embed = await cohere.embed({
+ texts: ["hello", "goodbye"],
+ model: "embed-english-v3.0",
+ inputType: "classification",
+ });
+ console.log(embed);
+ })();
+ ```
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/cohere/examples/generate.mdx b/docs/0.0.6/integrations/cohere/examples/generate.mdx
new file mode 100644
index 00000000..87ec795c
--- /dev/null
+++ b/docs/0.0.6/integrations/cohere/examples/generate.mdx
@@ -0,0 +1,45 @@
+---
+title: 'Generate'
+description: 'Monitor Cohere Generate API usage'
+---
+
+## Generate
+<Tabs>
+ <Tab title="Python">
+ ```python
+ import cohere
+ import dokumetry
+
+ co = cohere.Client('<<apiKey>>')
+
+ # Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ response = co.generate(
+ prompt='Please explain to me how LLMs work',
+ )
+ print(response)
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```javascript
+ import { CohereClient } from "cohere-ai";
+ import DokuMetry from 'dokumetry';
+
+ const cohere = new CohereClient({
+ token: "<<apiKey>>",
+ });
+
+ (async () => {
+ // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ const generate = await cohere.generate({
+ prompt: "Please explain to me how LLMs work",
+ });
+
+ console.log(generate);
+ })();
+ ```
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/cohere/examples/summarize.mdx b/docs/0.0.6/integrations/cohere/examples/summarize.mdx
new file mode 100644
index 00000000..fcb99ea3
--- /dev/null
+++ b/docs/0.0.6/integrations/cohere/examples/summarize.mdx
@@ -0,0 +1,87 @@
+---
+title: 'Summarize'
+description: 'Monitor Cohere Summarize API usage'
+---
+
+## Summarize
+<Tabs>
+ <Tab title="Python">
+ ```python
+ import cohere
+ import dokumetry
+
+ co = cohere.Client('<<apiKey>>')
+
+ # Pass the above `co` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ dokumetry.init(llm=co, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ text=(
+ "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
+ "It may be made from milk or cream and is flavoured with a sweetener, "
+ "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
+ "or with fruit such as strawberries or peaches. "
+ "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
+ "Food coloring is sometimes added, in addition to stabilizers. "
+ "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
+ "and to prevent detectable ice crystals from forming. The result is a smooth, "
+ "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
+ "It becomes more malleable as its temperature increases.\n\n"
+ "The meaning of the name \"ice cream\" varies from one country to another. "
+ "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
+ "and most governments regulate the commercial use of the various terms according to the "
+ "relative quantities of the main ingredients, notably the amount of cream. "
+ "Products that do not meet the criteria to be called ice cream are sometimes labelled "
+ "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
+ "one word is used fo\r all variants. Analogues made from dairy alternatives, "
+ "such as goat's or sheep's milk, or milk substitutes "
+ "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
+ "lactose intolerant, allergic to dairy protein or vegan."
+ )
+
+ response = co.summarize(
+ text=text,
+ )
+ print(response)
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```javascript
+ import { CohereClient } from "cohere-ai";
+ import DokuMetry from 'dokumetry';
+
+ const cohere = new CohereClient({
+ token: "<<apiKey>>",
+ });
+
+ (async () => {
+ // Pass the above `cohere` object along with your DOKU URL and API key and this will make sure that all Cohere calls are automatically tracked.
+ DokuMetry.init({llm: cohere, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ const summarize = await cohere.summarize({
+ text: "Ice cream is a sweetened frozen food typically eaten as a snack or dessert. "
+ + "It may be made from milk or cream and is flavoured with a sweetener, "
+ + "either sugar or an alternative, and a spice, such as cocoa or vanilla, "
+ + "or with fruit such as strawberries or peaches. "
+ + "It can also be made by whisking a flavored cream base and liquid nitrogen together. "
+ + "Food coloring is sometimes added, in addition to stabilizers. "
+ + "The mixture is cooled below the freezing point of water and stirred to incorporate air spaces "
+ + "and to prevent detectable ice crystals from forming. The result is a smooth, "
+ + "semi-solid foam that is solid at very low temperatures (below 2 °C or 35 °F). "
+ + "It becomes more malleable as its temperature increases.\n\n"
+ + "The meaning of the name \"ice cream\" varies from one country to another. "
+ + "In some countries, such as the United States, \"ice cream\" applies only to a specific variety, "
+ + "and most governments regulate the commercial use of the various terms according to the "
+ + "relative quantities of the main ingredients, notably the amount of cream. "
+ + "Products that do not meet the criteria to be called ice cream are sometimes labelled "
+ + "\"frozen dairy dessert\" instead. In other countries, such as Italy and Argentina, "
+ + "one word is used fo\r all variants. Analogues made from dairy alternatives, "
+ + "such as goat's or sheep's milk, or milk substitutes "
+ + "(e.g., soy, cashew, coconut, almond milk or tofu), are available for those who are "
+ + "lactose intolerant, allergic to dairy protein or vegan.",
+ });
+
+ console.log(summarize);
+ })();
+ ```
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/cohere/introduction.mdx b/docs/0.0.6/integrations/cohere/introduction.mdx
new file mode 100644
index 00000000..b5c067c8
--- /dev/null
+++ b/docs/0.0.6/integrations/cohere/introduction.mdx
@@ -0,0 +1,92 @@
+---
+title: 'Cohere integration'
+sidebarTitle: 'Get Started'
+---
+
+DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor Cohere usage data and metrics from your Python/NodeJS code.
+
+## Get Started
+
+The integration is compatible with Cohere SDK versions >=4.0.0
+
+<Tabs>
+ <Tab title="Python">
+ ```shell
+ pip install dokumetry
+ ```
+
+ ```python
+ import cohere
+ import dokumetry
+
+ co = cohere.Client('YOUR_API_KEY')
+
+ dokumetry.init(llm = co, doku_url = "YOUR_DOKU_URL", api_key = "YOUR_DOKU_TOKEN")
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```shell
+ npm install dokumetry
+ ```
+
+ ```javascript
+ import { CohereClient } from "cohere-ai";
+ import DokuMetry from 'dokumetry';
+
+ const co = new CohereClient({
+ token: "<<apiKey>>",
+ });
+
+ DokuMetry.init({llm: co, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+ ```
+ </Tab>
+</Tabs>
+
+## Supported Endpoints
+The following Cohere Endpoints are supported for monitoring with DokuMetry
+
+- [Chat](/0.0.6/integrations/cohere/examples/chat)
+- [Generate](/0.0.6/integrations/cohere/examples/generate)
+- [Summarize](/0.0.6/integrations/cohere/examples/summarize)
+- [Embed](/0.0.6/integrations/cohere/examples/embed)
+
+## Parameters
+
+<Tabs>
+ <Tab title="Python">
+ | Parameter | Description | Required |
+ |-------------------|-----------------------------------------------------------|---------------|
+ | llm | Cohere Object to track | Yes |
+ | doku_url | URL of your Doku Ingester | Yes |
+ | api_key | Your Doku API key | Yes |
+ | environment | Custom environment tag to include in your metrics | Optional |
+ | application_name | Custom application name tag for your metrics | Optional |
+ | skip_resp | Skip response from the Doku Ingester for faster execution | Optional |
+ </Tab>
+ <Tab title="NodeJS">
+ | Parameter | Description | Required |
+ |-------------------|-----------------------------------------------------------|---------------|
+ | llm | Cohere Object to track | Yes |
+ | dokuUrl | URL of your Doku Ingester | Yes |
+ | apiKey | Your Doku API key | Yes |
+ | environment | Custom environment tag to include in your metrics | Optional |
+ | applicationName | Custom application name tag for your metrics | Optional |
+ | skipResp | Skip response from the Doku Ingester for faster execution | Optional |
+ </Tab>
+</Tabs>
+
+## Advanced Usage
+When using DokuMetry in Production environments, It is recommened to set Skip response parameter to `true` for faster porcessing.
+
+To filter your LLM Usage according application or the environment, set the Application name and Environment paramaters with the actual values.
+
+---
+
+<CardGroup cols={2}>
+<Card title="Connections" href="/0.0.6/connections/intro" icon='link'>
+Connect to your existing Observablity Platform
+</Card>
+<Card title="API Refernce" href="/0.0.6/api-reference/introduction" icon='code'>
+OpenAPI specification for API Endpoints in Doku
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.3/dokumetry/introduction.mdx b/docs/0.0.6/integrations/introduction.mdx
similarity index 76%
rename from docs/0.0.3/dokumetry/introduction.mdx
rename to docs/0.0.6/integrations/introduction.mdx
index bad68619..cf05c5d2 100644
--- a/docs/0.0.3/dokumetry/introduction.mdx
+++ b/docs/0.0.6/integrations/introduction.mdx
@@ -1,15 +1,14 @@
---
-title: 'Overview'
-description: 'Seamlessly send LLM usage data to Doku'
+title: 'Introduction'
+description: 'Integrate and Monitor usage from LLM Providers'
---
-[DokuMetry SDK](https://www.npmjs.com/package/dokumetry) (`dokumetry`) empowers you to effortlessly track and monitor language learning model (LLM) usage data and metrics from your Python/NodeJS code. It seamlessly integrates with major LLM Platforms:
+Start integrating and monitoring your applications with Doku effortlessly. Choose from a range of providers to **start tracking LLM performance, usage, and costs** without hassle.
-
-DokuMetry SDKs can currently track and monitor API usage for the below platforms
<CardGroup cols={3}>
<Card
title="OpenAI"
+ href="/0.0.6/integrations/openai/introduction"
icon={
<svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<title>OpenAI</title>
@@ -21,6 +20,7 @@ DokuMetry SDKs can currently track and monitor API usage for the below platforms
</Card>
<Card
title="Cohere"
+ href="/0.0.6/integrations/cohere/introduction"
icon={
<svg role="image" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 75 75">
<g>
@@ -45,6 +45,7 @@ DokuMetry SDKs can currently track and monitor API usage for the below platforms
</Card>
<Card
title="Anthropic"
+ href="/0.0.6/integrations/anthropic/introduction"
icon={
<svg viewBox="0 0 256 176" xmlns="http://www.w3.org/2000/svg">
<path d="M147.486878,0 C147.486878,0 217.568251,175.780074 217.568251,175.780074 C217.568251,175.780074 256,175.780074 256,175.780074 C256,175.780074 185.918621,0 185.918621,0 C185.918621,0 147.486878,0 147.486878,0 C147.486878,0 147.486878,0 147.486878,0 Z"></path>
@@ -56,19 +57,13 @@ DokuMetry SDKs can currently track and monitor API usage for the below platforms
</Card>
</CardGroup>
-All LLM observability data collected by DokuMetry is sent directly to the Doku Platform for streamlined tracking.
-
-## Features
-
-- **Effortless Setup:** Integrate full-featured LLM usage monitoring into your application with just two lines of code.
-- **Efficient Performance:** Designed for near-zero latency impact, allowing your applications to run smoothly without compromise.
-- **Secure and Reliable**: DokuMetry SDKs prioritize the safety and integrity of your data. All data transmission to Doku is conducted over secure HTTP, ensuring that your observability data is protected during transit.
-
-## Supported Languages
+---
<CardGroup cols={2}>
-<Card title="Python" href="/0.0.3/dokumetry/python" icon="python">
+<Card title="Quickstart" href="/0.0.6/quickstart" icon='bolt'>
+Get Started with monitoring your LLM Applications in 2 simple steps
</Card>
-<Card title="NodeJS" href="/0.0.3/dokumetry/node" icon="node-js">
+<Card title="Connections" href="/0.0.6/connections/intro" icon='link'>
+Connect to your existing Observablity Platform
</Card>
-</CardGroup>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/openai/examples/audio.mdx b/docs/0.0.6/integrations/openai/examples/audio.mdx
new file mode 100644
index 00000000..4cf99fbe
--- /dev/null
+++ b/docs/0.0.6/integrations/openai/examples/audio.mdx
@@ -0,0 +1,56 @@
+---
+title: 'Audio'
+description: 'Monitor OpenAI Audio API usage'
+---
+
+## Create Speech
+
+<Tabs>
+ <Tab title="Python">
+ ```python
+ from pathlib import Path
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ speech_file_path = Path(__file__).parent / "speech.mp3"
+ response = client.audio.speech.create(
+ model="tts-1",
+ voice="alloy",
+ input="The quick brown fox jumped over the lazy dog."
+ )
+ response.stream_to_file(speech_file_path)
+ ```
+ </Tab>
+ <Tab title="NodeJS">
+ ```javascript
+ import fs from "fs";
+ import path from "path";
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ const speechFile = path.resolve("./speech.mp3");
+
+ async function main() {
+ const mp3 = await openai.audio.speech.create({
+ model: "tts-1",
+ voice: "alloy",
+ input: "Today is a wonderful day to build something people love!",
+ });
+ console.log(speechFile);
+ const buffer = Buffer.from(await mp3.arrayBuffer());
+ await fs.promises.writeFile(speechFile, buffer);
+ }
+ main();
+ ```
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/openai/examples/chat.mdx b/docs/0.0.6/integrations/openai/examples/chat.mdx
new file mode 100644
index 00000000..f0ca6753
--- /dev/null
+++ b/docs/0.0.6/integrations/openai/examples/chat.mdx
@@ -0,0 +1,294 @@
+---
+title: 'Chat Completions'
+description: 'Monitor OpenAI Chat Completions API usage'
+---
+
+
+<Tabs>
+ <Tab title="Python">
+ <CodeGroup>
+ ```python Default
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ completion = client.chat.completions.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {"role": "system", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "Hello!"}
+ ]
+ )
+
+ print(completion.choices[0].message)
+ ```
+
+ ```python Image Input
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ response = client.chat.completions.create(
+ model="gpt-4-vision-preview",
+ messages=[
+ {
+ "role": "user",
+ "content": [
+ {"type": "text", "text": "What’s in this image?"},
+ {
+ "type": "image_url",
+ "image_url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
+ },
+ ],
+ }
+ ],
+ max_tokens=300,
+ )
+
+ print(response.choices[0])
+ ```
+
+ ```python Streaming
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ completion = client.chat.completions.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {"role": "system", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "Hello!"}
+ ],
+ stream=True
+ )
+
+ for chunk in completion:
+ print(chunk.choices[0].delta)
+ ```
+
+ ```python Functions
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ]
+ messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]
+ completion = client.chat.completions.create(
+ model="gpt-3.5-turbo",
+ messages=messages,
+ tools=tools,
+ tool_choice="auto"
+ )
+
+ print(completion)
+ ```
+
+ ```python LogProbs
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ completion = client.chat.completions.create(
+ model="gpt-3.5-turbo",
+ messages=[
+ {"role": "user", "content": "Hello!"}
+ ],
+ logprobs=True,
+ top_logprobs=2
+ )
+
+ print(completion.choices[0].message)
+ print(completion.choices[0].logprobs)
+ ```
+ </CodeGroup>
+ </Tab>
+ <Tab title="NodeJS">
+ <CodeGroup>
+ ```javascript Default
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ messages: [{ role: "system", content: "You are a helpful assistant." }],
+ model: "gpt-3.5-turbo",
+ });
+
+ console.log(completion.choices[0]);
+ }
+
+ main();
+ ```
+
+ ```javascript Image Input
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const response = await openai.chat.completions.create({
+ model: "gpt-4-vision-preview",
+ messages: [
+ {
+ role: "user",
+ content: [
+ { type: "text", text: "What’s in this image?" },
+ {
+ type: "image_url",
+ image_url:
+ "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg",
+ },
+ ],
+ },
+ ],
+ });
+ console.log(response.choices[0]);
+ }
+ main();
+ ```
+
+ ```javascript Streaming
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ model: "gpt-3.5-turbo",
+ messages: [
+ {"role": "system", "content": "You are a helpful assistant."},
+ {"role": "user", "content": "Hello!"}
+ ],
+ stream: true,
+ });
+
+ for await (const chunk of completion) {
+ console.log(chunk.choices[0].delta.content);
+ }
+ }
+
+ main();
+ ```
+
+ ```javascript Functions
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}];
+ const tools = [
+ {
+ "type": "function",
+ "function": {
+ "name": "get_current_weather",
+ "description": "Get the current weather in a given location",
+ "parameters": {
+ "type": "object",
+ "properties": {
+ "location": {
+ "type": "string",
+ "description": "The city and state, e.g. San Francisco, CA",
+ },
+ "unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
+ },
+ "required": ["location"],
+ },
+ }
+ }
+ ];
+
+ const response = await openai.chat.completions.create({
+ model: "gpt-3.5-turbo",
+ messages: messages,
+ tools: tools,
+ tool_choice: "auto",
+ });
+
+ console.log(response);
+ }
+
+ main();
+ ```
+
+ ```javascript LogProbs
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const completion = await openai.chat.completions.create({
+ messages: [{ role: "user", content: "Hello!" }],
+ model: "gpt-3.5-turbo",
+ logprobs: true,
+ top_logprobs: 2,
+ });
+
+ console.log(completion.choices[0]);
+ }
+
+ main();
+ ```
+ </CodeGroup>
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/openai/examples/completions.mdx b/docs/0.0.6/integrations/openai/examples/completions.mdx
new file mode 100644
index 00000000..4071b67b
--- /dev/null
+++ b/docs/0.0.6/integrations/openai/examples/completions.mdx
@@ -0,0 +1,95 @@
+---
+title: 'Completions'
+description: 'Monitor OpenAI Completions API Usage'
+---
+
+<Tabs>
+ <Tab title="Python">
+ <CodeGroup>
+ ```python No Streaming
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ client.completions.create(
+ model="gpt-3.5-turbo-instruct",
+ prompt="Say this is a test",
+ max_tokens=7,
+ temperature=0
+ )
+ ```
+
+ ```python Streaming
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ for chunk in client.completions.create(
+ model="gpt-3.5-turbo-instruct",
+ prompt="Say this is a test",
+ max_tokens=7,
+ temperature=0,
+ stream=True
+ ):
+
+ print(chunk.choices[0].text)
+ ```
+ </CodeGroup>
+ </Tab>
+ <Tab title="NodeJS">
+ <CodeGroup>
+ ```javascript No Streaming
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const completion = await openai.completions.create({
+ model: "gpt-3.5-turbo-instruct",
+ prompt: "Say this is a test.",
+ max_tokens: 7,
+ temperature: 0,
+ });
+
+ console.log(completion);
+ }
+ main();
+ ```
+
+ ```javascript Streaming
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const stream = await openai.completions.create({
+ model: "gpt-3.5-turbo-instruct",
+ prompt: "Say this is a test.",
+ stream: true,
+ });
+
+ for await (const chunk of stream) {
+ console.log(chunk.choices[0].text)
+ }
+ }
+ main();
+ ```
+ </CodeGroup>
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/openai/examples/embeddings.mdx b/docs/0.0.6/integrations/openai/examples/embeddings.mdx
new file mode 100644
index 00000000..80ddf22d
--- /dev/null
+++ b/docs/0.0.6/integrations/openai/examples/embeddings.mdx
@@ -0,0 +1,48 @@
+---
+title: 'Embeddings'
+description: 'Monitor OpenAI Embeddings API usage'
+---
+
+## Create Embeddings
+<Tabs>
+ <Tab title="Python">
+ ```python
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ client.embeddings.create(
+ model="text-embedding-ada-002",
+ input="The food was delicious and the waiter...",
+ encoding_format="float"
+ )
+ ```
+ </Tab>
+ <Tab title="javascript">
+ ```javascript
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const embedding = await openai.embeddings.create({
+ model: "text-embedding-ada-002",
+ input: "The quick brown fox jumped over the lazy dog",
+ encoding_format: "float",
+ });
+
+ console.log(embedding);
+ }
+
+ main();
+ ```
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/openai/examples/fine-tuning.mdx b/docs/0.0.6/integrations/openai/examples/fine-tuning.mdx
new file mode 100644
index 00000000..dbb9c06d
--- /dev/null
+++ b/docs/0.0.6/integrations/openai/examples/fine-tuning.mdx
@@ -0,0 +1,45 @@
+---
+title: 'Fine Tuning'
+description: 'Monitor OpenAI Fine Tuning API usage'
+---
+
+## Create Fine Tuning Job
+<Tabs>
+ <Tab title="Python">
+ ```python
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ client.fine_tuning.jobs.create(
+ training_file="file-abc123",
+ model="gpt-3.5-turbo"
+ )
+ ```
+ </Tab>
+ <Tab title="javascript">
+ ```javascript
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const fineTune = await openai.fineTuning.jobs.create({
+ training_file: "file-abc123"
+ });
+
+ console.log(fineTune);
+ }
+
+ main();
+ ```
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/openai/examples/image.mdx b/docs/0.0.6/integrations/openai/examples/image.mdx
new file mode 100644
index 00000000..1c59e680
--- /dev/null
+++ b/docs/0.0.6/integrations/openai/examples/image.mdx
@@ -0,0 +1,88 @@
+---
+title: 'Image'
+description: 'Monitor OpenAI Image API usage'
+---
+
+## Create Image
+
+<Tabs>
+ <Tab title="Python">
+ ```python
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ client.images.generate(
+ model="dall-e-3",
+ prompt="A cute baby sea otter",
+ n=1,
+ size="1024x1024"
+ )
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```javascript
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const image = await openai.images.generate({ model: "dall-e-3", prompt: "A cute baby sea otter" });
+
+ console.log(image.data);
+ }
+ main();
+ ```
+ </Tab>
+</Tabs>
+
+## Create Image Variation
+
+<Tabs>
+ <Tab title="Python">
+ ```python
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ # Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+
+ response = client.images.create_variation(
+ image=open("image_edit_original.png", "rb"),
+ n=2,
+ size="1024x1024"
+ )
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```javascript
+ import fs from "fs";
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const openai = new OpenAI();
+
+ // Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
+ DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+
+ async function main() {
+ const image = await openai.images.createVariation({
+ image: fs.createReadStream("otter.png"),
+ });
+
+ console.log(image.data);
+ }
+ main();
+ ```
+ </Tab>
+</Tabs>
\ No newline at end of file
diff --git a/docs/0.0.6/integrations/openai/introduction.mdx b/docs/0.0.6/integrations/openai/introduction.mdx
new file mode 100644
index 00000000..693fc801
--- /dev/null
+++ b/docs/0.0.6/integrations/openai/introduction.mdx
@@ -0,0 +1,93 @@
+---
+title: 'OpenAI Integration'
+sidebarTitle: 'Get Started'
+---
+
+DokuMetry SDKs (`dokumetry`) empowers you to effortlessly track and monitor OpenAI usage data and metrics from your Python/NodeJS code.
+
+## Get Started
+
+The integration is compatible with OpenAI SDK versions >=1.0.0
+
+<Tabs>
+ <Tab title="Python">
+ ```shell
+ pip install dokumetry
+ ```
+
+ ```python
+ from openai import OpenAI
+ import dokumetry
+
+ client = OpenAI()
+
+ dokumetry.init(llm = client, doku_url = "YOUR_DOKU_URL", api_key = "YOUR_DOKU_TOKEN")
+ ```
+ </Tab>
+ <Tab title="Javascript">
+ ```shell
+ npm install dokumetry
+ ```
+
+ ```javascript
+ import OpenAI from "openai";
+ import DokuMetry from 'dokumetry';
+
+ const client = new OpenAI();
+
+ DokuMetry.init({llm: client, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+ ```
+ </Tab>
+</Tabs>
+
+## Supported Endpoints
+
+The following OpenAI Endpoints are supported for monitoring with DokuMetry
+
+- [Chat completions](/0.0.6/integrations/openai/examples/chat)
+- [Image Create](/0.0.6/integrations/openai/examples/image#create-image) and [Image Variations](/0.0.6/integrations/openai/examples/image#create-image-variation)
+- [Audio Speech Create](/0.0.6/integrations/openai/examples/audio)
+- [Embeddings](/0.0.6/integrations/openai/examples/embeddings)
+- [Fine Tunings](/0.0.6/integrations/openai/examples/fine-tuning)
+- [Completions](/0.0.6/integrations/openai/examples/completions)
+
+## Parameters
+
+<Tabs>
+ <Tab title="Python">
+ | Parameter | Description | Required |
+ |-------------------|-----------------------------------------------------------|---------------|
+ | llm | OpenAI Object to track | Yes |
+ | doku_url | URL of your Doku Ingester | Yes |
+ | api_key | Your Doku API key | Yes |
+ | environment | Custom environment tag to include in your metrics | Optional |
+ | application_name | Custom application name tag for your metrics | Optional |
+ | skip_resp | Skip response from the Doku Ingester for faster execution | Optional |
+ </Tab>
+ <Tab title="NodeJS">
+ | Parameter | Description | Required |
+ |-------------------|-----------------------------------------------------------|---------------|
+ | llm | OpenAI Object to track | Yes |
+ | dokuUrl | URL of your Doku Ingester | Yes |
+ | apiKey | Your Doku API key | Yes |
+ | environment | Custom environment tag to include in your metrics | Optional |
+ | applicationName | Custom application name tag for your metrics | Optional |
+ | skipResp | Skip response from the Doku Ingester for faster execution | Optional |
+ </Tab>
+</Tabs>
+
+## Advanced Usage
+When using DokuMetry in Production environments, It is recommened to set Skip response parameter to `true` for faster porcessing.
+
+To filter your LLM Usage according application or the environment, set the Application name and Environment paramaters with the actual values.
+
+---
+
+<CardGroup cols={2}>
+<Card title="Connections" href="/0.0.6/connections/intro" icon='link'>
+Connect to your existing Observablity Platform
+</Card>
+<Card title="API Refernce" href="/0.0.6/api-reference/introduction" icon='code'>
+OpenAPI specification for API Endpoints in Doku
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.6/introduction.mdx b/docs/0.0.6/introduction.mdx
new file mode 100644
index 00000000..dd389e0d
--- /dev/null
+++ b/docs/0.0.6/introduction.mdx
@@ -0,0 +1,64 @@
+---
+title: What is Doku?
+description: 'Open-source platform for monitoring and evaluating LLMs at scale'
+---
+
+Doku is an **open-source LLMOps tool** engineered to enables developers with comprehensive capabilities to monitor, analyze, and optimize LLM applications. It provides valuable real-time data on **LLM usage, performance, and costs**. Through seamless integrations with leading LLM platforms, including OpenAI, Cohere, and Anthropic, Doku acts as a central command center for all your LLM needs. It effectively guides your efforts, ensuring that your LLM applications not only operate at peak efficiency but also scale successfully.
+
+## Why use Doku?
+Get advanced monitoring and evaluation for your LLM applications with these key benefits:
+
+- **Granular Usage Insights of your LLM Applications**: Assess your LLM's performance and costs with fine-grained control, breaking down metrics by environment (such as staging or production) or application, to optimize for efficiency and scalability.
+- **Real-Time Data Streaming**: Unlike other platforms where you might wait minutes to see your data due to data being sent in batches, Doku is able to display data as it streams. This immediate insight enables quick decision-making and adjustments.
+- **Zero Added Latency**: Doku's smart data handling ensures rapid data processing without impacting your application's performance, maintaining the responsiveness of your LLM applications.
+- **Connect to Observability Platforms**: Doku seamlessly connects with leading observability platforms like Grafana Cloud and Datadog, among others to automatically export data.
+
+## How it works
+<Frame>
+ <img src="https://raw.githubusercontent.com/dokulabs/.github/main/profile/assets/banner.gif" />
+</Frame>
+
+### Step 1: Instrument your Application
+Integrating the `dokumetry` SDK into LLM applications is straightforward with SDKs designed for Python and NodeJS. Start monitoring for your LLM Application with just **two lines of code**:
+
+<CodeGroup>
+```python python
+import dokumetry
+
+dokumetry.init(llm=openai, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+```
+
+```javascript NodeJS
+import DokuMetry from 'dokumetry';
+
+DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+```
+</CodeGroup>
+
+### Step 2: Data processed by Doku Ingester
+Once the `dokumetry` SDKs are configured in your LLM application, Monitoring data starts streaming to the [Doku Ingester](https://github.com/dokulabs/doku/tree/main/src/ingester#readme). It processes and safely stores your data in ClickHouse, keeping your LLM Monitoring data **secure** and **compliant** in your environment.
+
+You can choose to use a new ClickHouse database setup or connect to your existing one to work with Doku.
+
+### Step 3: Visualize in your Observability Platform
+With your LLM monitoring data processed, connect Doku to your preferred Observability Platform to begin visualizing and analyzing your data in-depth.
+
+Stay tuned for the upcoming release of Doku UI, enhancing your data visualization capabilities further.
+
+## Getting Started
+Select from the following guides to learn more about how to use Doku:
+
+<CardGroup cols={2}>
+<Card title="Quickstart" href="/0.0.6/quickstart" icon='bolt'>
+Get Started with monitoring your LLM Applications in 2 simple steps
+</Card>
+<Card title="Integrations" href="/0.0.6/integrations/introduction" icon='circle-nodes'>
+Integrate your LLM Provider with Doku
+</Card>
+<Card title="Installation" href="/0.0.6/installation" icon='circle-down'>
+Deploy Doku in your preferred environment
+</Card>
+<Card title="Connections" href="/0.0.6/connections/intro" icon='link'>
+Connect to your existing Observablity Platform
+</Card>
+</CardGroup>
\ No newline at end of file
diff --git a/docs/0.0.1/quickstart.mdx b/docs/0.0.6/quickstart.mdx
similarity index 53%
rename from docs/0.0.1/quickstart.mdx
rename to docs/0.0.6/quickstart.mdx
index bd290ae0..e486c2cc 100644
--- a/docs/0.0.1/quickstart.mdx
+++ b/docs/0.0.6/quickstart.mdx
@@ -4,53 +4,77 @@ description: 'Quickly start **monitoring** your **LLM Applications** in just **t
icon: 'bolt'
---
-This guide will walk you through setting up your monitoring system with minimal effort. In just a few steps, you'll be able to track and analyze the performance and usage of your Large Language Model (LLM) applications.
-
-## Prerequistes
-- Ensure you have access to a **Kubernetes Cluster**. You can quickly spin up a Kubernetes Cluster using [Kind](https://github.com/kubernetes-sigs/kind?tab=readme-ov-file#installation-and-usage)
-
-## Get Started
+This guide will walk you through setting up monitoring for your LLM Application with minimal effort. In just a few steps, you'll be able to track and analyze the performance and usage of your Large Language Model (LLM) applications.
<Steps>
- <Step title="Install Doku in a Kubernetes Cluster">
+ <Step title="Deploy Doku">
<Steps>
- <Step title="Helm Repo Setup">
- ```shell shell
- helm repo add dokulabs https://dokulabs.github.io/helm/
- helm repo update
- ```
+ <Step title="Prepare your Environment">
+ ```yaml docker-compose.yml
+ version: '3.8'
+
+ services:
+ clickhouse:
+ image: clickhouse/clickhouse-server:24.1.5
+ container_name: clickhouse
+ environment:
+ CLICKHOUSE_PASSWORD: ${DOKU_DB_PASSWORD:-DOKU}
+ CLICKHOUSE_USER: ${DOKU_DB_USER:-default}
+ volumes:
+ - clickhouse-data:/var/lib/clickhouse
+ ports:
+ - "${DOKU_DB_PORT:-9000}:9000"
+ restart: always
+
+ doku-ingester:
+ image: ghcr.io/patcher99/doku-ingester:0.0.8
+ container_name: doku-ingester
+ environment:
+ DOKU_DB_HOST: clickhouse
+ DOKU_DB_PORT: ${DOKU_DB_PORT:-9000}
+ DOKU_DB_NAME: ${DOKU_DB_NAME:-default}
+ DOKU_DB_USER: ${DOKU_DB_USER:-default}
+ DOKU_DB_PASSWORD: ${DOKU_DB_PASSWORD:-DOKU}
+ ports:
+ - "9044:9044"
+ depends_on:
+ - clickhouse
+ restart: always
+
+ volumes:
+ clickhouse-data:
+ ```
</Step>
- <Step title="Installing the Helm Chart">
- ```shell shell
- helm install doku dokulabs/doku --version 0.0.7
- ```
+ <Step title="Launch Doku">
+ ```shell
+ docker-compose up -d
+ ```
</Step>
</Steps>
</Step>
<Step title="Generate an API Key">
- With Doku running, the next step is to [generate an API key](/0.0.1/api-reference/endpoint/api-keys/create) for secure communication between your applications and Doku.
+ With Doku running, the next step is to [generate an API key](/0.0.6/api-reference/endpoint/api-keys/create) for secure communication between your applications and Doku.
To generate your first API key, you can use the following command:
```shell shell
curl --request POST \
- --url https://<your-doku-url>/api/keys \
+ --url https://127.0.0.1:9044/api/keys \
--header 'Authorization: ""' \
--header 'Content-Type: application/json' \
--data '{
- "name": "Admin"
+ "name": "Patcher"
}'
```
- Make sure to store the returned API key securely, as it's necessary for authorizing future API calls with Doku.
-
- <Info>
- During your initial request to generate an API key, you can leave the Authorization header empty (i.e., `""`). For subsequent requests, you will need to supply the generated API key.
- </Info>
-
+ <Note>
+ **Save the API Key** — This key is essential for configuring the `dokumetry` SDK.
+
+ For your first API call to generate the key, the Authorization header should be left blank. However, remember to include this API key in the Authorization header for all future API interactions and SDK configurations.
+ </Note>
</Step>
- <Step title="Instrument your code">
- Choose the appropriate SDK for your application's programming language and follow the steps to integrate monitoring with just a couple of lines of code.
+ <Step title="Instrument your Application">
+ Choose the appropriate SDK for your LLM application's programming language and follow the steps to integrate monitoring with just **two lines of code**.
<Tabs>
<Tab title="Python">
<Steps>
@@ -60,12 +84,12 @@ This guide will walk you through setting up your monitoring system with minimal
```
</Step>
<Step title="Add the following two lines to your application code:">
- Add the snippet below to your Python application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.
+ Add the snippet below to your Python application, replace `YOUR_DOKU_TOKEN` with API key you created in Step 2.
```python
import dokumetry
- dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+ dokumetry.init(llm=client, doku_url="http://127.0.0.1:9044/", api_key="YOUR_DOKU_TOKEN")
```
Example Usage for monitoring `OpenAI` Usage:
@@ -79,7 +103,7 @@ This guide will walk you through setting up your monitoring system with minimal
)
# Pass the above `client` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
- dokumetry.init(llm=client, doku_url="YOUR_DOKU_URL", api_key="YOUR_DOKU_TOKEN")
+ dokumetry.init(llm=client, doku_url="http://127.0.0.1:9044/", api_key="YOUR_DOKU_TOKEN")
chat_completion = client.chat.completions.create(
messages=[
@@ -92,7 +116,7 @@ This guide will walk you through setting up your monitoring system with minimal
)
```
- Refer to the `dokumetry` [Python SDK repository](https://github.com/dokulabs/dokumetry-python) or the [DokuMetry Docs](/0.0.1/dokumetry/python/introduction) for more advanced configurations and use cases.
+ Refer to the `dokumetry` [Python SDK repository](https://github.com/dokulabs/dokumetry-python) for more advanced configurations and use cases.
</Step>
</Steps>
</Tab>
@@ -104,11 +128,11 @@ This guide will walk you through setting up your monitoring system with minimal
```
</Step>
<Step title="Add the following two lines to your application code">
- Add the snippet below to your NodeJS application, replacing `YOUR_DOKU_URL` and `YOUR_DOKU_TOKEN` with corresponding values.
+ Add the snippet below to your NodeJS application, replace `YOUR_DOKU_TOKEN` with API key you created in Step 2.
```javascript
import DokuMetry from 'dokumetry';
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+ DokuMetry.init({llm: openai, dokuUrl: "http://127.0.0.1:9044/", apiKey: "YOUR_DOKU_TOKEN"})
```
Example Usage for monitoring `OpenAI` Usage:
@@ -122,7 +146,7 @@ This guide will walk you through setting up your monitoring system with minimal
});
// Pass the above `openai` object along with your DOKU URL and API key and this will make sure that all OpenAI calls are automatically tracked.
- DokuMetry.init({llm: openai, dokuUrl: "YOUR_DOKU_URL", apiKey: "YOUR_DOKU_TOKEN"})
+ DokuMetry.init({llm: openai, dokuUrl: "http://127.0.0.1:9044/", apiKey: "YOUR_DOKU_TOKEN"})
async function main() {
const chatCompletion = await openai.chat.completions.create({
@@ -134,7 +158,7 @@ This guide will walk you through setting up your monitoring system with minimal
main();
```
- Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dokumetry-node) or the [DokuMetry Docs](/0.0.1/dokumetry/node/intro) for more advanced configurations and use cases.
+ Refer to the `dokumetry` [NodeJS SDK repository](https://github.com/dokulabs/dokumetry-node) for more advanced configurations and use cases.
</Step>
</Steps>
</Tab>
@@ -142,9 +166,15 @@ This guide will walk you through setting up your monitoring system with minimal
</Step>
</Steps>
-## (Optional) Export Data
-<Card title="Connections" href="/0.0.1/connections/intro" icon='connectdevelop'>
+You're all set! Following these steps should have you on your way to effectively monitoring your LLM applications. If you have any questions or need support, reach out to our [community](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA).
+
+---
+
+<CardGroup cols={2}>
+<Card title="Integrations" href="/0.0.6/integrations/introduction" icon='circle-nodes'>
+Integrate your LLM Provider with Doku
+</Card>
+<Card title="Connections" href="/0.0.6/connections/intro" icon='link'>
Connect to your existing Observablity Platform
</Card>
-
-You're all set! Following these steps should have you on your way to effectively monitoring your LLM applications. If you have any questions or need support, reach out to our [community](https://join.slack.com/t/doku-0tq5728/shared_invite/zt-2a9aql9xx-FN5EIZ2DtZ~XtJoYdxUDtA).
\ No newline at end of file
+</CardGroup>
\ No newline at end of file
diff --git a/docs/mint.json b/docs/mint.json
index 21a848f6..c5f90897 100644
--- a/docs/mint.json
+++ b/docs/mint.json
@@ -1,6 +1,6 @@
{
"$schema": "https://mintlify.com/schema.json",
- "versions": ["0.0.5", "0.0.4", "0.0.3", "0.0.2", "0.0.1"],
+ "versions": ["0.0.6", "0.0.5"],
"name": "Doku",
"logo": {
"dark": "https://github.com/dokulabs/.github/blob/main/profile/assets/dark-bg-with-text-logo.jpg?raw=true",
@@ -23,7 +23,7 @@
}
],
"modeToggle": {
- "default": "dark"
+ "default": "light"
},
"feedback": {
"thumbsRating": true,
@@ -43,66 +43,66 @@
],
"navigation": [
{
- "group": "Get Started",
+ "group": "Introduction",
"pages": [
- "0.0.5/introduction",
- "0.0.5/quickstart",
- "0.0.5/installation",
- "0.0.5/configuration"
+ "0.0.6/introduction",
+ "0.0.6/quickstart",
+ "0.0.6/installation",
+ "0.0.6/configuration"
],
- "version": "0.0.5"
+ "version": "0.0.6"
},
{
"group": "Integrations",
- "version": "0.0.5",
+ "version": "0.0.6",
"pages": [
- "0.0.5/integrations/introduction",
+ "0.0.6/integrations/introduction",
{
"group": "OpenAI",
- "version": "0.0.5",
+ "version": "0.0.6",
"pages": [
- "0.0.5/integrations/openai/introduction",
+ "0.0.6/integrations/openai/introduction",
{
"group": "Examples",
- "version": "0.0.5",
+ "version": "0.0.6",
"pages": [
- "0.0.5/integrations/openai/examples/chat",
- "0.0.5/integrations/openai/examples/image",
- "0.0.5/integrations/openai/examples/embeddings",
- "0.0.5/integrations/openai/examples/audio",
- "0.0.5/integrations/openai/examples/fine-tuning",
- "0.0.5/integrations/openai/examples/completions"
+ "0.0.6/integrations/openai/examples/chat",
+ "0.0.6/integrations/openai/examples/image",
+ "0.0.6/integrations/openai/examples/embeddings",
+ "0.0.6/integrations/openai/examples/audio",
+ "0.0.6/integrations/openai/examples/fine-tuning",
+ "0.0.6/integrations/openai/examples/completions"
]
}
]
},
{
"group": "Cohere",
- "version": "0.0.5",
+ "version": "0.0.6",
"pages": [
- "0.0.5/integrations/cohere/introduction",
+ "0.0.6/integrations/cohere/introduction",
{
"group": "Examples",
- "version": "0.0.5",
+ "version": "0.0.6",
"pages": [
- "0.0.5/integrations/cohere/examples/chat",
- "0.0.5/integrations/cohere/examples/generate",
- "0.0.5/integrations/cohere/examples/summarize",
- "0.0.5/integrations/cohere/examples/embed"
+ "0.0.6/integrations/cohere/examples/chat",
+ "0.0.6/integrations/cohere/examples/generate",
+ "0.0.6/integrations/cohere/examples/summarize",
+ "0.0.6/integrations/cohere/examples/embed"
]
}
]
},
{
"group": "Anthropic",
- "version": "0.0.5",
+ "version": "0.0.6",
"pages": [
- "0.0.5/integrations/anthropic/introduction",
+ "0.0.6/integrations/anthropic/introduction",
{
"group": "Examples",
- "version": "0.0.5",
+ "version": "0.0.6",
"pages": [
- "0.0.5/integrations/anthropic/examples/completions"
+ "0.0.6/integrations/anthropic/examples/completions"
]
}
]
@@ -112,278 +112,103 @@
{
"group": "Connections",
"pages": [
- "0.0.5/connections/intro",
- "0.0.5/connections/grafanaoss",
- "0.0.5/connections/grafanacloud",
- "0.0.5/connections/datadog",
- "0.0.5/connections/new-relic",
- "0.0.5/connections/signoz",
- "0.0.5/connections/dynatrace"
+ "0.0.6/connections/intro",
+ "0.0.6/connections/grafanaoss",
+ "0.0.6/connections/grafanacloud",
+ "0.0.6/connections/datadog",
+ "0.0.6/connections/new-relic",
+ "0.0.6/connections/signoz",
+ "0.0.6/connections/dynatrace"
],
- "version": "0.0.5"
+ "version": "0.0.6"
},
{
"group": "API Reference",
"pages": [
- "0.0.5/api-reference/introduction",
+ "0.0.6/api-reference/introduction",
{
"group": "API Keys",
"icon": "key",
"pages": [
- "0.0.5/api-reference/endpoint/api-keys/create",
- "0.0.5/api-reference/endpoint/api-keys/get",
- "0.0.5/api-reference/endpoint/api-keys/delete"
+ "0.0.6/api-reference/endpoint/api-keys/create",
+ "0.0.6/api-reference/endpoint/api-keys/get",
+ "0.0.6/api-reference/endpoint/api-keys/delete"
],
- "version": "0.0.5"
+ "version": "0.0.6"
},
{
"group": "Connections",
"icon": "link",
"pages": [
- "0.0.5/api-reference/endpoint/connections/create",
- "0.0.5/api-reference/endpoint/connections/delete"
+ "0.0.6/api-reference/endpoint/connections/create",
+ "0.0.6/api-reference/endpoint/connections/delete"
],
- "version": "0.0.5"
- },
- {
- "group": "Data",
- "icon": "table",
- "pages": [
- "0.0.5/api-reference/endpoint/retention/update"
- ],
- "version": "0.0.5"
+ "version": "0.0.6"
}
],
- "version": "0.0.5"
+ "version": "0.0.6"
},
{
"group": "Get Started",
"pages": [
- "0.0.4/introduction",
- "0.0.4/quickstart",
- "0.0.4/installation",
- "0.0.4/configuration"
+ "0.0.5/introduction",
+ "0.0.5/quickstart",
+ "0.0.5/installation",
+ "0.0.5/configuration"
],
- "version": "0.0.4"
+ "version": "0.0.5"
},
{
- "group": "DokuMetry",
- "version": "0.0.4",
+ "group": "Integrations",
+ "version": "0.0.5",
"pages": [
- "0.0.4/dokumetry/introduction",
+ "0.0.5/integrations/introduction",
{
- "group": "Python",
- "version": "0.0.4",
- "icon": "python",
+ "group": "OpenAI",
+ "version": "0.0.5",
"pages": [
- "0.0.4/dokumetry/python/introduction",
+ "0.0.5/integrations/openai/introduction",
{
"group": "Examples",
- "version": "0.0.4",
+ "version": "0.0.5",
"pages": [
- {
- "group": "OpenAI",
- "version": "0.0.4",
- "pages": [
- "0.0.4/dokumetry/python/examples/openai/chat",
- "0.0.4/dokumetry/python/examples/openai/image",
- "0.0.4/dokumetry/python/examples/openai/embeddings",
- "0.0.4/dokumetry/python/examples/openai/audio",
- "0.0.4/dokumetry/python/examples/openai/fine-tuning",
- "0.0.4/dokumetry/python/examples/openai/completions"
- ]
- },
- {
- "group": "Cohere",
- "version": "0.0.4",
- "pages": [
- "0.0.4/dokumetry/python/examples/cohere/chat",
- "0.0.4/dokumetry/python/examples/cohere/generate",
- "0.0.4/dokumetry/python/examples/cohere/co-summarize",
- "0.0.4/dokumetry/python/examples/cohere/embed"
- ]
- },
- {
- "group": "Anthropic",
- "version": "0.0.4",
- "pages": [
- "0.0.4/dokumetry/python/examples/anthropic/anthropic-completions"
- ]
- }
+ "0.0.5/integrations/openai/examples/chat",
+ "0.0.5/integrations/openai/examples/image",
+ "0.0.5/integrations/openai/examples/embeddings",
+ "0.0.5/integrations/openai/examples/audio",
+ "0.0.5/integrations/openai/examples/fine-tuning",
+ "0.0.5/integrations/openai/examples/completions"
]
}
]
},
{
- "group": "NodeJS",
- "version": "0.0.4",
- "icon": "node-js",
- "pages": [
- "0.0.4/dokumetry/node/introduction",
- {
- "group": "Examples",
- "version": "0.0.4",
- "pages": [
- {
- "group": "OpenAI",
- "version": "0.0.4",
- "pages": [
- "0.0.4/dokumetry/node/examples/openai/chat",
- "0.0.4/dokumetry/node/examples/openai/image",
- "0.0.4/dokumetry/node/examples/openai/embeddings",
- "0.0.4/dokumetry/node/examples/openai/audio",
- "0.0.4/dokumetry/node/examples/openai/fine-tuning",
- "0.0.4/dokumetry/node/examples/openai/chatCompletions"
- ]
- },
- {
- "group": "Cohere",
- "version": "0.0.4",
- "pages": [
- "0.0.4/dokumetry/node/examples/cohere/chat",
- "0.0.4/dokumetry/node/examples/cohere/generate",
- "0.0.4/dokumetry/node/examples/cohere/summarize",
- "0.0.4/dokumetry/node/examples/cohere/embed"
- ]
- },
- {
- "group": "Anthropic",
- "version": "0.0.4",
- "pages": [
- "0.0.4/dokumetry/node/examples/anthropic/anthropic-completions"
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "group": "Connections",
- "pages": [
- "0.0.4/connections/intro",
- "0.0.4/connections/grafanaoss",
- "0.0.4/connections/grafanacloud",
- "0.0.4/connections/datadog",
- "0.0.4/connections/new-relic"
- ],
- "version": "0.0.4"
- },
- {
- "group": "API Reference",
- "pages": [
- "0.0.4/api-reference/introduction",
- {
- "group": "API Keys",
- "icon": "key",
- "pages": [
- "0.0.4/api-reference/endpoint/api-keys/create",
- "0.0.4/api-reference/endpoint/api-keys/get",
- "0.0.4/api-reference/endpoint/api-keys/delete"
- ],
- "version": "0.0.4"
- }
- ],
- "version": "0.0.4"
- },
- {
- "group": "Get Started",
- "pages": [
- "0.0.3/introduction",
- "0.0.3/quickstart",
- "0.0.3/installation",
- "0.0.3/configuration"
- ],
- "version": "0.0.3"
- },
- {
- "group": "DokuMetry",
- "version": "0.0.3",
- "pages": [
- "0.0.3/dokumetry/introduction",
- {
- "group": "Python",
- "version": "0.0.3",
- "icon": "python",
+ "group": "Cohere",
+ "version": "0.0.5",
"pages": [
- "0.0.3/dokumetry/python/introduction",
+ "0.0.5/integrations/cohere/introduction",
{
"group": "Examples",
- "version": "0.0.3",
+ "version": "0.0.5",
"pages": [
- {
- "group": "OpenAI",
- "version": "0.0.3",
- "pages": [
- "0.0.3/dokumetry/python/examples/openai/chat",
- "0.0.3/dokumetry/python/examples/openai/image",
- "0.0.3/dokumetry/python/examples/openai/embeddings",
- "0.0.3/dokumetry/python/examples/openai/audio",
- "0.0.3/dokumetry/python/examples/openai/fine-tuning",
- "0.0.3/dokumetry/python/examples/openai/completions"
- ]
- },
- {
- "group": "Cohere",
- "version": "0.0.3",
- "pages": [
- "0.0.3/dokumetry/python/examples/cohere/chat",
- "0.0.3/dokumetry/python/examples/cohere/generate",
- "0.0.3/dokumetry/python/examples/cohere/co-summarize",
- "0.0.3/dokumetry/python/examples/cohere/embed"
- ]
- },
- {
- "group": "Anthropic",
- "version": "0.0.3",
- "pages": [
- "0.0.3/dokumetry/python/examples/anthropic/anthropic-completions"
- ]
- }
+ "0.0.5/integrations/cohere/examples/chat",
+ "0.0.5/integrations/cohere/examples/generate",
+ "0.0.5/integrations/cohere/examples/summarize",
+ "0.0.5/integrations/cohere/examples/embed"
]
}
]
},
{
- "group": "NodeJS",
- "version": "0.0.3",
- "icon": "node-js",
+ "group": "Anthropic",
+ "version": "0.0.5",
"pages": [
- "0.0.3/dokumetry/node/introduction",
+ "0.0.5/integrations/anthropic/introduction",
{
"group": "Examples",
- "version": "0.0.3",
+ "version": "0.0.5",
"pages": [
- {
- "group": "OpenAI",
- "version": "0.0.3",
- "pages": [
- "0.0.3/dokumetry/node/examples/openai/chat",
- "0.0.3/dokumetry/node/examples/openai/image",
- "0.0.3/dokumetry/node/examples/openai/embeddings",
- "0.0.3/dokumetry/node/examples/openai/audio",
- "0.0.3/dokumetry/node/examples/openai/fine-tuning",
- "0.0.3/dokumetry/node/examples/openai/chatCompletions"
- ]
- },
- {
- "group": "Cohere",
- "version": "0.0.3",
- "pages": [
- "0.0.3/dokumetry/node/examples/cohere/chat",
- "0.0.3/dokumetry/node/examples/cohere/generate",
- "0.0.3/dokumetry/node/examples/cohere/summarize",
- "0.0.3/dokumetry/node/examples/cohere/embed"
- ]
- },
- {
- "group": "Anthropic",
- "version": "0.0.3",
- "pages": [
- "0.0.3/dokumetry/node/examples/anthropic/anthropic-completions"
- ]
- }
+ "0.0.5/integrations/anthropic/examples/completions"
]
}
]
@@ -393,292 +218,49 @@
{
"group": "Connections",
"pages": [
- "0.0.3/connections/intro",
- "0.0.3/connections/grafanaoss",
- "0.0.3/connections/grafanacloud",
- "0.0.3/connections/datadog",
- "0.0.3/connections/new-relic"
+ "0.0.5/connections/intro",
+ "0.0.5/connections/grafanaoss",
+ "0.0.5/connections/grafanacloud",
+ "0.0.5/connections/datadog",
+ "0.0.5/connections/new-relic",
+ "0.0.5/connections/signoz",
+ "0.0.5/connections/dynatrace"
],
- "version": "0.0.3"
+ "version": "0.0.5"
},
{
"group": "API Reference",
"pages": [
- "0.0.3/api-reference/introduction",
+ "0.0.5/api-reference/introduction",
{
"group": "API Keys",
"icon": "key",
"pages": [
- "0.0.3/api-reference/endpoint/api-keys/create",
- "0.0.3/api-reference/endpoint/api-keys/get",
- "0.0.3/api-reference/endpoint/api-keys/delete"
+ "0.0.5/api-reference/endpoint/api-keys/create",
+ "0.0.5/api-reference/endpoint/api-keys/get",
+ "0.0.5/api-reference/endpoint/api-keys/delete"
],
- "version": "0.0.3"
- }
- ],
- "version": "0.0.3"
- },
- {
- "group": "Get Started",
- "pages": [
- "0.0.2/introduction",
- "0.0.2/quickstart",
- "0.0.2/installation",
- "0.0.2/configure"
- ],
- "version": "0.0.2"
- },
- {
- "group": "DokuMetry",
- "version": "0.0.2",
- "pages": [
- "0.0.2/dokumetry/introduction",
- {
- "group": "Python",
- "version": "0.0.2",
- "icon": "python",
- "pages": [
- "0.0.2/dokumetry/python/introduction",
- {
- "group": "Examples",
- "version": "0.0.2",
- "pages": [
- {
- "group": "OpenAI",
- "version": "0.0.2",
- "pages": [
- "0.0.2/dokumetry/python/examples/openai/chat",
- "0.0.2/dokumetry/python/examples/openai/image",
- "0.0.2/dokumetry/python/examples/openai/embeddings",
- "0.0.2/dokumetry/python/examples/openai/audio",
- "0.0.2/dokumetry/python/examples/openai/fine-tuning",
- "0.0.2/dokumetry/python/examples/openai/completions"
- ]
- },
- {
- "group": "Cohere",
- "version": "0.0.2",
- "pages": [
- "0.0.2/dokumetry/python/examples/cohere/chat",
- "0.0.2/dokumetry/python/examples/cohere/generate",
- "0.0.2/dokumetry/python/examples/cohere/co-summarize",
- "0.0.2/dokumetry/python/examples/cohere/embed"
- ]
- },
- {
- "group": "Anthropic",
- "version": "0.0.2",
- "pages": [
- "0.0.2/dokumetry/python/examples/anthropic/anthropic-completions"
- ]
- }
- ]
- }
- ]
+ "version": "0.0.5"
},
{
- "group": "NodeJS",
- "version": "0.0.2",
- "icon": "node-js",
- "pages": [
- "0.0.2/dokumetry/node/introduction",
- {
- "group": "Examples",
- "version": "0.0.2",
- "pages": [
- {
- "group": "OpenAI",
- "version": "0.0.2",
- "pages": [
- "0.0.2/dokumetry/node/examples/openai/chat",
- "0.0.2/dokumetry/node/examples/openai/image",
- "0.0.2/dokumetry/node/examples/openai/embeddings",
- "0.0.2/dokumetry/node/examples/openai/audio",
- "0.0.2/dokumetry/node/examples/openai/fine-tuning",
- "0.0.2/dokumetry/node/examples/openai/chatCompletions"
- ]
- },
- {
- "group": "Cohere",
- "version": "0.0.2",
- "pages": [
- "0.0.2/dokumetry/node/examples/cohere/chat",
- "0.0.2/dokumetry/node/examples/cohere/generate",
- "0.0.2/dokumetry/node/examples/cohere/summarize",
- "0.0.2/dokumetry/node/examples/cohere/embed"
- ]
- },
- {
- "group": "Anthropic",
- "version": "0.0.2",
- "pages": [
- "0.0.2/dokumetry/node/examples/anthropic/anthropic-completions"
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "group": "Connections",
- "pages": [
- "0.0.2/connections/intro",
- "0.0.2/connections/grafanaoss",
- "0.0.2/connections/grafanacloud",
- "0.0.2/connections/datadog",
- "0.0.2/connections/new-relic"
- ],
- "version": "0.0.2"
- },
- {
- "group": "API Reference",
- "pages": [
- "0.0.2/api-reference/introduction",
- {
- "group": "API Keys",
- "icon": "key",
+ "group": "Connections",
+ "icon": "link",
"pages": [
- "0.0.2/api-reference/endpoint/api-keys/create",
- "0.0.2/api-reference/endpoint/api-keys/Get",
- "0.0.2/api-reference/endpoint/api-keys/delete"
+ "0.0.5/api-reference/endpoint/connections/create",
+ "0.0.5/api-reference/endpoint/connections/delete"
],
- "version": "0.0.2"
- }
- ],
- "version": "0.0.2"
- },
- {
- "group": "Get Started",
- "pages": [
- "0.0.1/intro",
- "0.0.1/quickstart",
- "0.0.1/installation",
- "0.0.1/configuration"
- ],
- "version": "0.0.1"
- },
- {
- "group": "DokuMetry",
- "version": "0.0.1",
- "pages": [
- "0.0.1/dokumetry/introduction",
- {
- "group": "Python",
- "version": "0.0.1",
- "icon": "python",
- "pages": [
- "0.0.1/dokumetry/python/introduction",
- {
- "group": "Examples",
- "version": "0.0.1",
- "pages": [
- {
- "group": "OpenAI",
- "version": "0.0.1",
- "pages": [
- "0.0.1/dokumetry/python/examples/openai/chat",
- "0.0.1/dokumetry/python/examples/openai/image",
- "0.0.1/dokumetry/python/examples/openai/embeddings",
- "0.0.1/dokumetry/python/examples/openai/audio",
- "0.0.1/dokumetry/python/examples/openai/fine-tuning",
- "0.0.1/dokumetry/python/examples/openai/completions"
- ]
- },
- {
- "group": "Cohere",
- "version": "0.0.1",
- "pages": [
- "0.0.1/dokumetry/python/examples/cohere/chat",
- "0.0.1/dokumetry/python/examples/cohere/generate",
- "0.0.1/dokumetry/python/examples/cohere/co-summarize",
- "0.0.1/dokumetry/python/examples/cohere/embed"
- ]
- },
- {
- "group": "Anthropic",
- "version": "0.0.1",
- "pages": [
- "0.0.1/dokumetry/python/examples/anthropic/anthropic-completions"
- ]
- }
- ]
- }
- ]
+ "version": "0.0.5"
},
{
- "group": "NodeJS",
- "version": "0.0.1",
- "icon": "node-js",
- "pages": [
- "0.0.1/dokumetry/node/intro",
- {
- "group": "Examples",
- "version": "0.0.1",
- "pages": [
- {
- "group": "OpenAI",
- "version": "0.0.1",
- "pages": [
- "0.0.1/dokumetry/node/examples/openai/chat",
- "0.0.1/dokumetry/node/examples/openai/image",
- "0.0.1/dokumetry/node/examples/openai/embeddings",
- "0.0.1/dokumetry/node/examples/openai/audio",
- "0.0.1/dokumetry/node/examples/openai/fine-tuning",
- "0.0.1/dokumetry/node/examples/openai/chatCompletions"
- ]
- },
- {
- "group": "Cohere",
- "version": "0.0.1",
- "pages": [
- "0.0.1/dokumetry/node/examples/cohere/chat",
- "0.0.1/dokumetry/node/examples/cohere/generate",
- "0.0.1/dokumetry/node/examples/cohere/summarize",
- "0.0.1/dokumetry/node/examples/cohere/embed"
- ]
- },
- {
- "group": "Anthropic",
- "version": "0.0.1",
- "pages": [
- "0.0.1/dokumetry/node/examples/anthropic/anthropic-completions"
- ]
- }
- ]
- }
- ]
- }
- ]
- },
- {
- "group": "Connections",
- "pages": [
- "0.0.1/connections/intro",
- "0.0.1/connections/grafanaoss",
- "0.0.1/connections/grafanacloud",
- "0.0.1/connections/datadog",
- "0.0.1/connections/new-relic"
- ],
- "version": "0.0.1"
- },
- {
- "group": "API Reference",
- "pages": [
- "0.0.1/api-reference/introduction",
- {
- "group": "API Keys",
- "icon": "key",
+ "group": "Data",
+ "icon": "table",
"pages": [
- "0.0.1/api-reference/endpoint/api-keys/create",
- "0.0.1/api-reference/endpoint/api-keys/get",
- "0.0.1/api-reference/endpoint/api-keys/delete"
+ "0.0.5/api-reference/endpoint/retention/update"
],
- "version": "0.0.1"
+ "version": "0.0.5"
}
],
- "version": "0.0.1"
+ "version": "0.0.5"
}
],
"analytics": {
diff --git a/src/ingester/api/handlers.go b/src/ingester/api/handlers.go
index cf31b590..682cae1a 100644
--- a/src/ingester/api/handlers.go
+++ b/src/ingester/api/handlers.go
@@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"net/http"
- "regexp"
"strings"
"ingester/auth"
@@ -122,6 +121,10 @@ func generateConnectionsHandler(w http.ResponseWriter, r *http.Request) {
err := db.GenerateConnection(getAuthKey(r), request)
if err != nil {
+ if err.Error() == "AUTHFAILED" {
+ sendJSONResponse(w, http.StatusUnauthorized, errMsgAuthFailed)
+ return
+ }
sendJSONResponse(w, http.StatusBadRequest, "Error creating connection: "+err.Error())
return
}
@@ -149,6 +152,10 @@ func deleteConnectionsHandler(w http.ResponseWriter, r *http.Request) {
sendJSONResponse(w, http.StatusNotFound, "No existing Connection found")
return
}
+ if err.Error() == "AUTHFAILED" {
+ sendJSONResponse(w, http.StatusUnauthorized, errMsgAuthFailed)
+ return
+ }
sendJSONResponse(w, http.StatusBadRequest, "Error deleting connection: "+err.Error())
return
}
@@ -278,34 +285,6 @@ func ConnectionsHandler(w http.ResponseWriter, r *http.Request) {
}
}
-// retentionHandler handles updating the retention period in the Database.
-func RetentionHandler(w http.ResponseWriter, r *http.Request) {
- type RetentionRequest struct {
- RetentionPeriod string `json:"retentionPeriod"`
- }
- var request RetentionRequest
-
- if err := decodeRequestBody(r, &request); err != nil {
- sendJSONResponse(w, http.StatusBadRequest, errMsgInvalidBody)
- return
- }
-
- // Use regex to validate the format "<int> days"
- match, _ := regexp.MatchString(`^\d+\s+days$`, request.RetentionPeriod)
- if !match {
- sendJSONResponse(w, http.StatusBadRequest, "retention period should be in the format '<int> days'")
- return
- }
-
- err := db.UpdateRetention(getAuthKey(r), request.RetentionPeriod)
- if err != nil {
- sendJSONResponse(w, http.StatusInternalServerError, err.Error())
- return
- }
-
- sendJSONResponse(w, http.StatusOK, "retention period updated successfully")
-}
-
// BaseEndpoint serves as a health check and entry point for the service.
func BaseEndpoint(w http.ResponseWriter, r *http.Request) {
if err := db.PingDB(); err != nil {
diff --git a/src/ingester/config/config.go b/src/ingester/config/config.go
index 65dcc083..4d3f503d 100644
--- a/src/ingester/config/config.go
+++ b/src/ingester/config/config.go
@@ -9,19 +9,18 @@ import (
// Assuming Configuration struct definition is globally accessible
type Configuration struct {
- IngesterPort string `json:"ingesterPort"`
- Pricing struct {
+ Pricing struct {
URL string `json:"url"`
} `json:"pricing"`
Database struct {
- Host string `json:"host"`
- Name string `json:"name"`
- Password string `json:"password"`
- Port string `json:"port"`
- SSLMode string `json:"sslmode"`
- User string `json:"user"`
- MaxIdleConns int `json:"maxIdleConns"`
- MaxOpenConns int `json:"maxOpenConns"`
+ Host string `json:"host"`
+ Name string `json:"name"`
+ Password string `json:"password"`
+ Port string `json:"port"`
+ User string `json:"user"`
+ MaxIdleConns int `json:"maxIdleConns"`
+ MaxOpenConns int `json:"maxOpenConns"`
+ RetentionPeriod string `json:"retentionPeriod"`
} `json:"database"`
}
@@ -42,17 +41,12 @@ func LoadConfigFromEnv() (*Configuration, error) {
config.Database.Name = os.Getenv("DOKU_DB_NAME")
config.Database.Password = os.Getenv("DOKU_DB_PASSWORD")
config.Database.Port = os.Getenv("DOKU_DB_PORT")
- config.Database.SSLMode = os.Getenv("DOKU_DB_SSLMODE")
config.Database.User = os.Getenv("DOKU_DB_USER")
config.Database.MaxIdleConns = getIntFromEnv("DOKU_DB_MAX_IDLE_CONNS")
config.Database.MaxOpenConns = getIntFromEnv("DOKU_DB_MAX_OPEN_CONNS")
- config.IngesterPort = os.Getenv("DOKU_INGESTER_PORT")
+ config.Database.RetentionPeriod = os.Getenv("DOKU_DB_RETENTION_PERIOD")
config.Pricing.URL = os.Getenv("DOKU_PRICING_JSON_URL")
- // Setting default values if the environment variables are not provided
- if config.IngesterPort == "" {
- config.IngesterPort = "9044" // default port
- }
if config.Pricing.URL == "" {
config.Pricing.URL = "https://raw.githubusercontent.com/dokulabs/doku/main/assets/pricing.json" // default pricing URL
}
@@ -62,6 +56,9 @@ func LoadConfigFromEnv() (*Configuration, error) {
if config.Database.MaxOpenConns == 0 {
config.Database.MaxOpenConns = 20 // default max open connections
}
+ if config.Database.RetentionPeriod == "" {
+ config.Database.RetentionPeriod = "6 MONTH" // default retention period
+ }
missingVars := []string{}
@@ -75,9 +72,6 @@ func LoadConfigFromEnv() (*Configuration, error) {
if config.Database.Port == "" {
missingVars = append(missingVars, "DOKU_DB_PORT")
}
- if config.Database.SSLMode == "" {
- missingVars = append(missingVars, "DOKU_DB_SSLMODE")
- }
if config.Database.User == "" {
missingVars = append(missingVars, "DOKU_DB_USER")
}
diff --git a/src/ingester/db/db.go b/src/ingester/db/db.go
index 4c4e87a5..54fe8d7d 100644
--- a/src/ingester/db/db.go
+++ b/src/ingester/db/db.go
@@ -1,6 +1,7 @@
package db
import (
+ "context"
"crypto/rand"
"database/sql"
"encoding/hex"
@@ -12,20 +13,21 @@ import (
"sync"
"time"
- _ "github.com/lib/pq"
+ "github.com/ClickHouse/clickhouse-go/v2"
+ _ "github.com/ClickHouse/clickhouse-go/v2/lib/driver"
"github.com/pkoukk/tiktoken-go"
"github.com/rs/zerolog/log"
)
var (
- once sync.Once // once is used to ensure that the database is initialized only once
- connectionCache sync.Map // connectionCache stores the lookup of connection details
- ApiKeyCache = sync.Map{} // ApiKeyCache stores the lookup of API keys and organization IDs.
- CacheEntryDuration = time.Minute * 10 // CacheEntryDuration defines how long an item should stay in the cache before being re-validated.
- db *sql.DB // db holds the database connection
- doku_llm_data_table = "DOKU_LLM_DATA" // doku_llm_data_table holds the name of the data table
- doku_apikeys_table = "DOKU_APIKEYS" // doku_apikeys_table holds the name of the API keys table
- doku_connections_table = "DOKU_CONNECTIONS" // doku_connections_table holds the name of the connections table
+ connectionCache sync.Map // connectionCache stores the lookup of connection details
+ ApiKeyCache = sync.Map{} // ApiKeyCache stores the lookup of API keys and organization IDs.
+ CacheEntryDuration = time.Minute * 10 // CacheEntryDuration defines how long an item should stay in the cache before being re-validated.
+ db clickhouse.Conn // db holds the database connection
+ ctx = context.Background() // ctx is the context for the database connection
+ doku_llm_data_table = "DOKU_LLM_DATA" // doku_llm_data_table holds the name of the data table
+ doku_apikeys_table = "DOKU_APIKEYS" // doku_apikeys_table holds the name of the API keys table
+ doku_connections_table = "DOKU_CONNECTIONS" // doku_connections_table holds the name of the connections table
// validFields represent the fields that are expected in the incoming data.
validFields = []string{
"name",
@@ -65,6 +67,14 @@ type connectionCacheEntry struct {
Timestamp time.Time
}
+// PingDB checks if the database is responsive.
+func PingDB() error {
+ if err := db.Ping(ctx); err != nil {
+ return err
+ }
+ return nil
+}
+
// EvictExpiredEntries goes through the cache and evicts expired entries.
func EvictExpiredEntries() {
now := time.Now()
@@ -78,25 +88,6 @@ func EvictExpiredEntries() {
})
}
-// PingDB attempts to ping the database to check if it's alive.
-func PingDB() error {
- var attempt int
- retryDelay := 15 * time.Second
-
- for attempt < 5 {
- attempt++
- err := db.Ping()
- if err == nil {
- return nil
- }
-
- log.Warn().Err(err).Msgf("Failed to connect to the database on attempt %d, retrying in %s", attempt, retryDelay)
- time.Sleep(retryDelay)
- }
-
- return fmt.Errorf("failed to connect to the database after %d attempts", attempt)
-}
-
// GenerateSecureRandomKey should generate a secure random string to be used as an API key.
func generateSecureRandomKey() (string, error) {
randomPartLength := 40 / 2 // Each byte becomes two hex characters, so we need half as many bytes.
@@ -104,7 +95,7 @@ func generateSecureRandomKey() (string, error) {
randomBytes := make([]byte, randomPartLength)
_, err := rand.Read(randomBytes)
if err != nil {
- log.Error().Err(err).Msg("Error generating random bytes")
+ log.Error().Err(err).Msg("error generating random bytes")
// In the case of an error, return it as we cannot generate a key.
return "", err
}
@@ -119,162 +110,139 @@ func generateSecureRandomKey() (string, error) {
// getCreateConnectionsTableSQL returns the SQL query to create the API keys table.
func getCreateConnectionsTableSQL(tableName string) string {
return fmt.Sprintf(`
- CREATE TABLE IF NOT EXISTS %s (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- platform VARCHAR(50) NOT NULL,
- metricsUrl TEXT NOT NULL,
- logsUrl TEXT NOT NULL,
- apiKey TEXT NOT NULL,
- metricsUsername VARCHAR(50) NOT NULL,
- logsUsername VARCHAR(50) NOT NULL,
- created_at TIMESTAMPTZ DEFAULT NOW()
- );`, tableName)
+ CREATE TABLE IF NOT EXISTS %s (
+ id UUID DEFAULT generateUUIDv4(),
+ platform String NOT NULL,
+ metricsUrl String NOT NULL,
+ logsUrl String NOT NULL,
+ apiKey String NOT NULL,
+ metricsUsername String NOT NULL,
+ logsUsername String NOT NULL,
+ created_at DateTime DEFAULT now()
+ ) ENGINE = MergeTree()
+ ORDER BY id;`, tableName)
}
// getCreateAPIKeysTableSQL returns the SQL query to create the API keys table.
func getCreateAPIKeysTableSQL(tableName string) string {
return fmt.Sprintf(`
- CREATE TABLE IF NOT EXISTS %s (
- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
- api_key VARCHAR(255) NOT NULL UNIQUE,
- name VARCHAR(50) NOT NULL,
- created_at TIMESTAMPTZ DEFAULT NOW()
- );`, tableName)
+ CREATE TABLE IF NOT EXISTS %s (
+ id UUID DEFAULT generateUUIDv4(), // Use ClickHouse's function to generate UUIDs
+ api_key String NOT NULL, // VARCHAR is equivalent to String in ClickHouse
+ name String NOT NULL,
+ created_at DateTime DEFAULT now()
+ ) ENGINE = MergeTree() // Specify the table engine, MergeTree engines are common in ClickHouse
+ ORDER BY (id, api_key);`, tableName) // Define the primary key as part of the engine's ORDER BY
}
-// getCreateDataTableSQL returns the SQL query to create the data table.
-func getCreateDataTableSQL(tableName string) string {
+// getCreateDataTableSQL returns the SQL query to create the data table in ClickHouse.
+func getCreateDataTableSQL(tableName string, retentionPeriod string) string {
return fmt.Sprintf(`
- CREATE TABLE IF NOT EXISTS %s (
- time TIMESTAMPTZ NOT NULL,
- id UUID DEFAULT gen_random_uuid(),
- llmReqId TEXT,
- environment VARCHAR(50) NOT NULL,
- endpoint VARCHAR(50) NOT NULL,
- sourceLanguage VARCHAR(50) NOT NULL,
- applicationName VARCHAR(50) NOT NULL,
- completionTokens INTEGER,
- promptTokens INTEGER,
- totalTokens INTEGER,
- finishReason VARCHAR(50),
- requestDuration DOUBLE PRECISION,
- usageCost DOUBLE PRECISION,
- model VARCHAR(50),
- prompt TEXT,
- response TEXT,
- imageSize TEXT,
- revisedPrompt TEXT,
- image TEXT,
- audioVoice TEXT,
- finetuneJobStatus TEXT,
- feedback INTEGER
- );`, tableName)
+ CREATE TABLE IF NOT EXISTS %s (
+ time DateTime NOT NULL,
+ id UUID DEFAULT generateUUIDv4(),
+ llmReqId String,
+ environment String NOT NULL,
+ endpoint String NOT NULL,
+ sourceLanguage String NOT NULL,
+ applicationName String NOT NULL,
+ completionTokens Int32,
+ promptTokens Int32,
+ totalTokens Int32,
+ finishReason String,
+ requestDuration Float64,
+ usageCost Float64,
+ model String,
+ prompt String,
+ response String,
+ imageSize String,
+ revisedPrompt String,
+ image String,
+ audioVoice String,
+ finetuneJobStatus String,
+ feedback Int32
+ ) ENGINE = MergeTree()
+ ORDER BY (time, id)
+ TTL time + INTERVAL + %s DELETE; `, tableName, retentionPeriod)
}
-// tableExists checks if a table exists in the database.
-func tableExists(db *sql.DB, tableName string) (bool, error) {
- query := `
- SELECT EXISTS (
- SELECT 1
- FROM information_schema.tables
- WHERE table_schema = 'public'
- AND lower(table_name) = lower($1)
- )
- `
-
- var exists bool
- err := db.QueryRow(query, tableName).Scan(&exists)
- if err != nil {
+func tableExists(tableName string, databaseName string) (bool, error) {
+ query := `SELECT count()
+ FROM system.tables
+ WHERE database = ? AND name = ?`
+
+ var count uint64
+ if err := db.QueryRow(ctx, query, databaseName, tableName).Scan(&count); err != nil {
return false, err
}
-
- return exists, nil
+ return count > 0, nil
}
-// createTable creates a table in the database if it doesn't exist.
-func createTable(db *sql.DB, tableName string) error {
+// createTable attempts to create a table in ClickHouse if it doesn't already exist.
+func createTable(tableName string, cfg config.Configuration) error {
var createTableSQL string
+
if tableName == doku_apikeys_table {
createTableSQL = getCreateAPIKeysTableSQL(tableName)
} else if tableName == doku_llm_data_table {
- createTableSQL = getCreateDataTableSQL(tableName)
+ createTableSQL = getCreateDataTableSQL(tableName, cfg.Database.RetentionPeriod)
} else if tableName == doku_connections_table {
createTableSQL = getCreateConnectionsTableSQL(tableName)
}
- exists, err := tableExists(db, tableName)
+ exists, err := tableExists(tableName, cfg.Database.Name)
if err != nil {
return fmt.Errorf("error checking table '%s' existence: %w", tableName, err)
}
if !exists {
- _, err := db.Exec(createTableSQL)
- if err != nil {
- return fmt.Errorf("error creating table %s: %w", tableName, err)
+ if err = db.Exec(ctx, createTableSQL); err != nil {
+ return fmt.Errorf("error creating table '%s': %w", tableName, err)
}
- log.Info().Msgf("Table '%s' created in the database", tableName)
-
if tableName == doku_apikeys_table {
- createIndexSQL := fmt.Sprintf("CREATE INDEX IF NOT EXISTS idx_api_key ON %s (api_key);", tableName)
- _, err = db.Exec(createIndexSQL)
- if err != nil {
- return fmt.Errorf("error creating index on 'api_key' column: %w", err)
- }
-
- // Add fresh installation API key
newAPIKey, _ := generateSecureRandomKey()
-
// Insert the new API key into the database
insertQuery := fmt.Sprintf("INSERT INTO %s (api_key, name) VALUES ($1, $2)", doku_apikeys_table)
- _, err = db.Exec(insertQuery, newAPIKey, "doku-client-internal")
+ err = db.Exec(ctx, insertQuery, newAPIKey, "doku-client-internal")
if err != nil {
log.Error().Err(err).Msg("Error inserting the new API key in the database")
return err
}
- log.Info().Msgf("Index on 'api_key' column checked/created in table '%s'", tableName)
- }
-
- // If the table to create is the data table, convert it into a hypertable
- if tableName == doku_llm_data_table {
- _, err := db.Exec("SELECT create_hypertable($1, 'time')", tableName)
- if err != nil {
- return fmt.Errorf("error creating hypertable: %w", err)
- }
- log.Info().Msgf("Table '%s' converted to a Hypertable", tableName)
- query := fmt.Sprintf("SELECT add_retention_policy('%s', INTERVAL '%s')", tableName, "180 days")
- _, err = db.Exec(query)
- if err != nil {
- return fmt.Errorf("error adding data retention policy: %w", err)
- }
- log.Info().Msgf("Added data retention policy of '%s' to '%s' ", "180 days", tableName)
}
- } else {
- log.Info().Msgf("Table '%s' already exists in the database", tableName)
+ log.Printf("table '%s' created in the database", tableName)
+ return nil
}
+ log.Info().Msgf("table '%s' exists in the database", tableName)
return nil
}
// initializeDB initializes connection to the database.
func initializeDB(cfg config.Configuration) error {
- var dbErr error
- once.Do(func() {
- connStr := fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=%s",
- cfg.Database.Host, cfg.Database.Port, cfg.Database.User, cfg.Database.Password, cfg.Database.Name, cfg.Database.SSLMode)
-
- if db, dbErr = sql.Open("postgres", connStr); dbErr != nil {
- log.Error().Err(dbErr).Msg("Error connecting to the database")
- return
- }
-
- dbErr = PingDB()
- if dbErr != nil {
- return
+ var err error
+ addr := fmt.Sprintf("%s:%s", cfg.Database.Host, cfg.Database.Port)
+ for attempt := 1; attempt <= 5; attempt++ {
+ db, _ = clickhouse.Open(&clickhouse.Options{
+ Addr: []string{addr},
+ Auth: clickhouse.Auth{
+ Database: cfg.Database.Name,
+ Username: cfg.Database.User,
+ Password: cfg.Database.Password,
+ },
+ MaxOpenConns: cfg.Database.MaxOpenConns,
+ MaxIdleConns: cfg.Database.MaxIdleConns,
+ })
+
+ // Ping the database to check if it's connected.
+ if err = PingDB(); err != nil {
+ log.Warn().Msgf("failed to connect to the database on attempt %d, retrying in %s", attempt, 15*time.Second)
+ if attempt < 5 {
+ db.Close()
+ time.Sleep(15 * time.Second)
+ continue
+ }
+ return err
}
- log.Info().Msg("Successfully connected to the database")
-
- db.SetMaxOpenConns(cfg.Database.MaxOpenConns)
- db.SetMaxIdleConns(cfg.Database.MaxIdleConns)
- })
- return dbErr
+ }
+ return nil
}
func getTokens(text, model string) int {
@@ -313,11 +281,12 @@ func insertDataToDB(data map[string]interface{}) (string, int) {
}
}
- // Define the SQL query for data insertion
- query := fmt.Sprintf("INSERT INTO %s (time, llmReqId, environment, endpoint, sourceLanguage, applicationName, completionTokens, promptTokens, totalTokens, finishReason, requestDuration, usageCost, model, prompt, response, imageSize, revisedPrompt, image, audioVoice, finetuneJobStatus) VALUES (NOW(), $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19)", doku_llm_data_table)
+ // Construct query with placeholders
+ query := fmt.Sprintf("INSERT INTO %s (time, llmReqId, environment, endpoint, sourceLanguage, applicationName, completionTokens, promptTokens, totalTokens, finishReason, requestDuration, usageCost, model, prompt, response, imageSize, revisedPrompt, image, audioVoice, finetuneJobStatus) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", doku_llm_data_table)
- // Execute the SQL query
- _, err := db.Exec(query,
+ // Create a slice for parameters in the correct order
+ params := []interface{}{
+ time.Now(),
data["llmReqId"],
data["environment"],
data["endpoint"],
@@ -337,10 +306,12 @@ func insertDataToDB(data map[string]interface{}) (string, int) {
data["image"],
data["audioVoice"],
data["finetuneJobStatus"],
- )
+ }
+
+ // Execute the SQL query
+ err := db.Exec(ctx, query, params...)
if err != nil {
- log.Error().Err(err).Msg("Error Inserting data into the database")
- // Update the response message and status code for error
+ log.Error().Err(err).Msg("error Inserting data into the database")
return "Internal Server Error", http.StatusInternalServerError
}
@@ -364,28 +335,24 @@ func insertDataToDB(data map[string]interface{}) (string, int) {
func Init(cfg config.Configuration) error {
err := initializeDB(cfg)
if err != nil {
- log.Error().Err(err).Msg("Error initializing database")
- return fmt.Errorf("could not initialize connection to the database: %w", err)
+ return err
}
// Create the DATA and API keys table if it doesn't exist.
- log.Info().Msgf("Creating '%s', '%s' and '%s' tables in the database if they don't exist", doku_connections_table, doku_apikeys_table, doku_llm_data_table)
+ log.Info().Msgf("creating '%s', '%s' and '%s' tables in the database if they don't exist", doku_connections_table, doku_apikeys_table, doku_llm_data_table)
- err = createTable(db, doku_connections_table)
+ err = createTable(doku_connections_table, cfg)
if err != nil {
- log.Error().Err(err).Msgf("Error creating table %s", doku_connections_table)
return err
}
- err = createTable(db, doku_apikeys_table)
+ err = createTable(doku_apikeys_table, cfg)
if err != nil {
- log.Error().Err(err).Msgf("Error creating table %s", doku_apikeys_table)
return err
}
- err = createTable(db, doku_llm_data_table)
+ err = createTable(doku_llm_data_table, cfg)
if err != nil {
- log.Error().Err(err).Msgf("Error creating table %s", doku_apikeys_table)
return err
}
return nil
@@ -405,7 +372,8 @@ func checkConnections() (*connections.ConnectionConfig, error) {
// If not in cache or cache is expired, query the database
query := fmt.Sprintf("SELECT platform, metricsUrl, logsUrl, apiKey, metricsUsername, logsUsername FROM %s;", doku_connections_table)
var connDetails connections.ConnectionConfig
- row := db.QueryRow(query)
+ // Ensure you have a valid database connection 'db' to ClickHouse, and it might need a context passed if supported
+ row := db.QueryRow(ctx, query) // Assuming you have a context 'ctx' available
err := row.Scan(&connDetails.Platform, &connDetails.MetricsUrl, &connDetails.LogsUrl,
&connDetails.ApiKey, &connDetails.MetricsUsername, &connDetails.LogsUsername)
if err != nil {
@@ -430,12 +398,12 @@ func PerformDatabaseInsertion(data map[string]interface{}) (string, int) {
return responseMessage, statusCode
}
-// CheckAPIKey retrieves the name associated with the given API key from the database.
func CheckAPIKey(apiKey string) (string, error) {
var name string
- query := fmt.Sprintf("SELECT name FROM %s WHERE api_key = $1", doku_apikeys_table)
- err := db.QueryRow(query, apiKey).Scan(&name)
+ // Adjust the placeholder for ClickHouse
+ query := fmt.Sprintf("SELECT name FROM %s WHERE api_key = ?", doku_apikeys_table)
+ err := db.QueryRow(ctx, query, apiKey).Scan(&name)
if err != nil {
if err == sql.ErrNoRows {
return "", err
@@ -445,14 +413,13 @@ func CheckAPIKey(apiKey string) (string, error) {
return name, nil
}
-// GenerateAPIKey generates a new API key for a given name and stores it in the database.
func GenerateAPIKey(existingAPIKey, name string) (string, error) {
- // If there are any existing API keys, authenticate the provided API key before proceeding
- var count int
+ count := uint64(0)
+
countQuery := fmt.Sprintf("SELECT COUNT(*) FROM %s WHERE name != 'doku-client-internal'", doku_apikeys_table)
- err := db.QueryRow(countQuery).Scan(&count)
+ err := db.QueryRow(ctx, countQuery).Scan(&count)
if err != nil {
- log.Error().Err(err).Msg("Error checking API key table")
+ log.Error().Err(err).Msg("error checking API key table")
return "", fmt.Errorf("failed to check API key table: %v", err)
}
@@ -461,164 +428,129 @@ func GenerateAPIKey(existingAPIKey, name string) (string, error) {
// Attempt to retrieve any existing key for the given name.
_, err = GetAPIKeyForName(existingAPIKey, name)
if err == nil {
- log.Warn().Msgf("Error creating new API Key as a key with the name '%s' already exists", name)
+ log.Warn().Msgf("error creating new API Key as a key with the name '%s' already exists", name)
return "", fmt.Errorf("KEYEXISTS")
} else if err.Error() == "AUTHFAILED" {
return "", err
}
}
- // No existing key found, proceed to generate a new API key
- log.Info().Msgf("Creating a new API Key with the name: %s", name)
newAPIKey, _ := generateSecureRandomKey()
- // Insert the new API key into the database
- insertQuery := fmt.Sprintf("INSERT INTO %s (api_key, name) VALUES ($1, $2)", doku_apikeys_table)
- _, err = db.Exec(insertQuery, newAPIKey, name)
- if err != nil {
- log.Error().Err(err).Msg("Error inserting the new API key in the database")
+ // Properly use placeholders for the query parameters, adjusted for ClickHouse
+ insertQuery := fmt.Sprintf("INSERT INTO %s (api_key, name) VALUES (?, ?)", doku_apikeys_table)
+ if err := db.Exec(ctx, insertQuery, newAPIKey, name); err != nil {
+ log.Error().Err(err).Msg("error inserting the new API key in the database")
return "", err
}
log.Info().Msgf("API Key with the name '%s' created successfully", name)
return newAPIKey, nil
}
-// GetAPIKeyForName retrieves an API key for a given name from the database.
func GetAPIKeyForName(existingAPIKey, name string) (string, error) {
-
- // Autheticate the provided API key before proceeding
+ // Authenticate the provided API key before proceeding
_, err := CheckAPIKey(existingAPIKey)
if err != nil {
log.Warn().Msg("Authorization Failed for an API Key")
return "", fmt.Errorf("AUTHFAILED")
}
-
// Retrieve the API key for the given name
var apiKey string
- query := fmt.Sprintf("SELECT api_key FROM %s WHERE name = $1", doku_apikeys_table)
- err = db.QueryRow(query, name).Scan(&apiKey)
+ // Adjust the query to use ? as a placeholder
+ query := fmt.Sprintf("SELECT api_key FROM %s WHERE name = ?", doku_apikeys_table)
+ err = db.QueryRow(ctx, query, name).Scan(&apiKey)
if err != nil {
if err == sql.ErrNoRows {
log.Warn().Msgf("API Key with the name '%s' currently not found in the database", name)
return "", fmt.Errorf("NOTFOUND")
}
- log.Warn().Err(err).Msgf("Error retrieving API key for the name '%s'", name)
+ log.Warn().Err(err).Msgf("error retrieving API key for the name '%s'", name)
return "", err
}
return apiKey, nil
}
-// DeleteAPIKey deletes an API key for a given name from the database.
func DeleteAPIKey(existingAPIKey, name string) error {
-
- // Autheticate the provided API key before proceeding and check if the API key exists
+ // Authenticate the provided API key before proceeding and check if the API key exists
apiKey, err := GetAPIKeyForName(existingAPIKey, name)
if err != nil {
- if err.Error() == "AUTHFAILED" {
- return err
- }
- if err.Error() == "NOTFOUND" {
- return err
- }
+ // If auth failed or API key was not found, return the error directly
return err
}
// Delete the API key from the database
- log.Info().Msgf("Deleting API Key with the name '%s' from the database", name)
- query := fmt.Sprintf("DELETE FROM %s WHERE api_key = $1", doku_apikeys_table)
- _, err = db.Exec(query, apiKey)
- if err != nil {
- log.Error().Err(err).Msg("Error deleting API key")
+ log.Info().Msgf("deleting API Key with the name '%s' from the database", name)
+ // Adjust the query to use ? as the placeholder for ClickHouse
+ query := fmt.Sprintf("DELETE FROM %s WHERE api_key = ?", doku_apikeys_table)
+ if err = db.Exec(ctx, query, apiKey); err != nil {
+ log.Error().Err(err).Msg("error deleting API key")
return err
}
+
+ // Assuming ApiKeyCache is a custom caching mechanism you've implemented
ApiKeyCache.Delete(apiKey)
log.Info().Msgf("API Key with the name '%s' deleted successfully", name)
return nil
}
-// GenerateConnection
func GenerateConnection(existingAPIKey string, config ConnectionRequest) error {
- // Autheticate the provided API key before proceeding
+ // Authenticate the provided API key before proceeding
_, err := CheckAPIKey(existingAPIKey)
if err != nil {
log.Warn().Msg("Authorization Failed for an API Key")
return fmt.Errorf("AUTHFAILED")
}
- deleteRows := fmt.Sprintf("DELETE FROM %s", doku_connections_table)
- _, err = db.Exec(deleteRows)
- if err != nil {
- log.Error().Err(err).Msg("Error deleting the existing Connections config in the database")
+ // Delete all existing rows in the connections table
+ deleteRows := fmt.Sprintf("DELETE FROM %s WHERE 1=1", doku_connections_table)
+ if err = db.Exec(ctx, deleteRows); err != nil {
+ log.Error().Err(err).Msg("error deleting the existing Connections config in the database")
return err
}
- insertQuery := fmt.Sprintf("INSERT INTO %s (platform, metricsUrl, logsUrl, apiKey, metricsUsername, logsUsername) VALUES ($1, $2, $3, $4, $5, $6)", doku_connections_table)
- _, err = db.Exec(insertQuery, config.Platform, config.MetricsURL, config.LogsURL, config.ApiKey, config.MetricsUsername, config.LogsUserName)
- if err != nil {
- log.Error().Err(err).Msg("Error inserting the new Connections config in the database")
+ // Insert the new connection configuration into the table
+ // Note: ClickHouse uses ? as placeholders
+ insertQuery := fmt.Sprintf("INSERT INTO %s (platform, metricsUrl, logsUrl, apiKey, metricsUsername, logsUsername) VALUES (?, ?, ?, ?, ?, ?)", doku_connections_table)
+ if err = db.Exec(ctx, insertQuery, config.Platform, config.MetricsURL, config.LogsURL, config.ApiKey, config.MetricsUsername, config.LogsUserName); err != nil {
+ log.Error().Err(err).Msg("error inserting the new Connections config in the database")
return err
}
+ // Assuming connectionCache is a custom mechanism for caching the connection configuration
connectionCache.Delete("connectionConfig")
log.Info().Msgf("New Connection config created successfully")
return nil
}
-// DeleteConnection deletes the connection details from the database.
+// / DeleteConnection deletes the existing connection configuration from the database.
func DeleteConnection(existingAPIKey string) error {
- // Autheticate the provided API key before proceeding
+ // Authenticate the provided API key before proceeding
_, err := CheckAPIKey(existingAPIKey)
if err != nil {
log.Warn().Msg("Authorization Failed for an API Key")
return fmt.Errorf("AUTHFAILED")
}
- var count int
+ var count uint64
countQuery := fmt.Sprintf("SELECT COUNT(*) FROM %s", doku_connections_table)
- err = db.QueryRow(countQuery).Scan(&count)
+ err = db.QueryRow(ctx, countQuery).Scan(&count)
if err != nil {
- log.Info().Msgf("%d", count)
- log.Error().Err(err).Msg("Error checking Connections Table")
+ log.Error().Err(err).Msg("error checking Connections Table")
return fmt.Errorf("failed to check Connections table: %v", err)
}
if count >= 1 {
- deleteRows := fmt.Sprintf("DELETE FROM %s", doku_connections_table)
- _, err = db.Exec(deleteRows)
+ deleteRows := fmt.Sprintf("DELETE FROM %s WHERE 1=1", doku_connections_table)
+ err = db.Exec(ctx, deleteRows)
if err != nil {
- log.Error().Err(err).Msg("Error deleting the existing Connections config in the database")
+ log.Error().Err(err).Msg("error deleting the existing Connections config in the database")
return err
}
+ // Assuming connectionCache is a mechanism you've implemented for caching
connectionCache.Delete("connectionConfig")
- log.Info().Msgf("Connection config deleted successfully")
+ log.Info().Msg("connection config deleted successfully")
} else {
return fmt.Errorf("NOTFOUND")
}
return nil
}
-
-// UpdateRetentionPeriod updates the retention period for the data table.
-func UpdateRetention(existingAPIKey string, retentionPeriod string) error {
- // Autheticate the provided API key before proceeding
- _, err := CheckAPIKey(existingAPIKey)
- if err != nil {
- log.Warn().Msg("Authorization Failed for an API Key")
- return fmt.Errorf("AUTHFAILED")
- }
-
- query := fmt.Sprintf("SELECT remove_retention_policy('%s')", doku_llm_data_table)
- _, err = db.Exec(query)
- if err != nil {
- return fmt.Errorf("error removing existing data retention policy: %w", err)
- }
-
- // Update the retention period for the data table
- query = fmt.Sprintf("SELECT add_retention_policy('%s', INTERVAL '%s')", doku_llm_data_table, retentionPeriod)
- _, err = db.Exec(query)
- if err != nil {
- return fmt.Errorf("error adding data retention policy: %w", err)
- }
- log.Info().Msgf("Added data retention policy of '%s' to '%s' ", retentionPeriod, doku_llm_data_table)
-
- return nil
-}
diff --git a/src/ingester/go.mod b/src/ingester/go.mod
index eb1cc15b..db477115 100644
--- a/src/ingester/go.mod
+++ b/src/ingester/go.mod
@@ -3,17 +3,30 @@ module ingester
go 1.21.5
require (
+ github.com/ClickHouse/clickhouse-go/v2 v2.18.0
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be
github.com/gorilla/mux v1.8.1
- github.com/lib/pq v1.10.9
github.com/pkoukk/tiktoken-go v0.1.6
github.com/rs/zerolog v1.31.0
)
require (
+ github.com/ClickHouse/ch-go v0.58.2 // indirect
+ github.com/andybalholm/brotli v1.1.0 // indirect
github.com/dlclark/regexp2 v1.10.0 // indirect
+ github.com/go-faster/city v1.0.1 // indirect
+ github.com/go-faster/errors v0.6.1 // indirect
github.com/google/uuid v1.6.0 // indirect
+ github.com/klauspost/compress v1.16.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
- golang.org/x/sys v0.12.0 // indirect
+ github.com/paulmach/orb v0.11.1 // indirect
+ github.com/pierrec/lz4/v4 v4.1.18 // indirect
+ github.com/pkg/errors v0.9.1 // indirect
+ github.com/segmentio/asm v1.2.0 // indirect
+ github.com/shopspring/decimal v1.3.1 // indirect
+ go.opentelemetry.io/otel v1.22.0 // indirect
+ go.opentelemetry.io/otel/trace v1.22.0 // indirect
+ golang.org/x/sys v0.16.0 // indirect
+ gopkg.in/yaml.v3 v3.0.1 // indirect
)
diff --git a/src/ingester/go.sum b/src/ingester/go.sum
index cbf6483c..bbd69883 100644
--- a/src/ingester/go.sum
+++ b/src/ingester/go.sum
@@ -1,35 +1,131 @@
+github.com/ClickHouse/ch-go v0.58.2 h1:jSm2szHbT9MCAB1rJ3WuCJqmGLi5UTjlNu+f530UTS0=
+github.com/ClickHouse/ch-go v0.58.2/go.mod h1:Ap/0bEmiLa14gYjCiRkYGbXvbe8vwdrfTYWhsuQ99aw=
+github.com/ClickHouse/clickhouse-go/v2 v2.18.0 h1:O1LicIeg2JS2V29fKRH4+yT3f6jvvcJBm506dpVQ4mQ=
+github.com/ClickHouse/clickhouse-go/v2 v2.18.0/go.mod h1:ztQvX6wm7kAbhJslS87EXEhOVNY/TObXwyURnGju5FQ=
+github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
+github.com/andybalholm/brotli v1.1.0/go.mod h1:sms7XGricyQI9K10gOSf56VKKWS4oLer58Q+mhRPtnY=
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be h1:J5BL2kskAlV9ckgEsNQXscjIaLiOYiZ75d4e94E6dcQ=
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be/go.mod h1:mk5IQ+Y0ZeO87b858TlA645sVcEcbiX6YqP98kt+7+w=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dlclark/regexp2 v1.10.0 h1:+/GIL799phkJqYW+3YbOd8LCcbHzT0Pbo8zl70MHsq0=
github.com/dlclark/regexp2 v1.10.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
+github.com/go-faster/city v1.0.1 h1:4WAxSZ3V2Ws4QRDrscLEDcibJY8uf41H6AhXDrNDcGw=
+github.com/go-faster/city v1.0.1/go.mod h1:jKcUJId49qdW3L1qKHH/3wPeUstCVpVSXTM6vO3VcTw=
+github.com/go-faster/errors v0.6.1 h1:nNIPOBkprlKzkThvS/0YaX8Zs9KewLCOSFQS5BU06FI=
+github.com/go-faster/errors v0.6.1/go.mod h1:5MGV2/2T9yvlrbhe9pD9LO5Z/2zCSq2T8j+Jpi2LAyY=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
+github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
+github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
-github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
-github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
+github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk=
+github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I=
+github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
+github.com/paulmach/orb v0.11.1 h1:3koVegMC4X/WeiXYz9iswopaTwMem53NzTJuTF20JzU=
+github.com/paulmach/orb v0.11.1/go.mod h1:5mULz1xQfs3bmQm63QEJA6lNGujuRafwA5S/EnuLaLU=
+github.com/paulmach/protoscan v0.2.1/go.mod h1:SpcSwydNLrxUGSDvXvO0P7g7AuhJ7lcKfDlhJCDw2gY=
+github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ=
+github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkoukk/tiktoken-go v0.1.6 h1:JF0TlJzhTbrI30wCvFuiw6FzP2+/bR+FIxUdgEAcUsw=
github.com/pkoukk/tiktoken-go v0.1.6/go.mod h1:9NiV+i9mJKGj1rYOT+njbv+ZwA/zJxYdewGl6qVatpg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
-github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
-github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
+github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
+github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
+github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
+github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
+github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
+github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
+github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
+github.com/xdg-go/scram v1.1.1/go.mod h1:RaEWvsqvNKKvBPvcKeFjrG2cJqOkHTiyTpzz23ni57g=
+github.com/xdg-go/stringprep v1.0.3/go.mod h1:W3f5j4i+9rC0kuIEJL0ky1VpHXQU3ocBgklLGvcBnW8=
+github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
+github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+go.mongodb.org/mongo-driver v1.11.4/go.mod h1:PTSz5yu21bkT/wXpkS7WR5f0ddqw5quethTUn9WM+2g=
+go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
+go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
+go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
+go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
+golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
+golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
+gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/src/ingester/main.go b/src/ingester/main.go
index d04bf790..0f359354 100644
--- a/src/ingester/main.go
+++ b/src/ingester/main.go
@@ -28,7 +28,7 @@ func waitForShutdown(server *http.Server) {
// Wait for an interrupt
sig := <-quit
log.Info().Msgf("caught sig: %+v", sig)
- log.Info().Msg("Sstarting to shutdown server")
+ log.Info().Msg("starting to shutdown server")
// Initialize the context with a timeout to ensure the app can make a graceful exit
// or abort if it takes too long
@@ -49,7 +49,7 @@ func main() {
figure.NewColorFigure("DOKU Ingester", "", "yellow", true).Print()
// Configure global settings for the zerolog logger
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
- log.Info().Msg("Starting Doku Ingester")
+ log.Info().Msg("starting Doku Ingester")
// Load the configuration from the environment variables
cfg, err := config.LoadConfigFromEnv()
@@ -73,24 +73,22 @@ func main() {
log.Info().Msg("initializing connection to the backend database")
err = db.Init(*cfg)
if err != nil {
- log.Fatal().Err(err).Msg("unable to initialize connection to the backend database")
+ log.Fatal().Msgf("%v", err)
}
log.Info().Msg("successfully initialized connection to the backend database")
// Cache eviction setup for the API Keys and Connections
auth.InitializeCacheEviction()
-
// Initialize the HTTP server routing
r := mux.NewRouter()
r.HandleFunc("/api/push", api.DataHandler).Methods("POST")
r.HandleFunc("/api/keys", api.APIKeyHandler).Methods("GET", "POST", "DELETE")
r.HandleFunc("/", api.BaseEndpoint).Methods("GET")
r.HandleFunc("/api/connections", api.ConnectionsHandler).Methods("POST", "DELETE")
- r.HandleFunc("/api/data/retention", api.RetentionHandler).Methods("POST")
// Define and start the HTTP server
server := &http.Server{
- Addr: ":" + cfg.IngesterPort,
+ Addr: ":9044",
Handler: r,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
@@ -99,9 +97,9 @@ func main() {
// Starts the HTTP server in a goroutine and logs any error upon starting.
go func() {
- log.Info().Msg("server listening on port " + cfg.IngesterPort)
+ log.Info().Msg("server listening on port :9044")
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
- log.Fatal().Err(err).Msg("could not listen on port " + cfg.IngesterPort)
+ log.Fatal().Err(err).Msg("could not listen on port :9044")
}
}()