> ## Documentation Index
> Fetch the complete documentation index at: https://docs.021labs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> RDK - LLM Tracing Library for Python

# RDK Python SDK

RDK (Reinforcement Development Kit) is a lightweight Python library for tracing LLM applications. It provides automatic instrumentation for popular LLM providers and frameworks, giving you complete visibility into your AI application's behavior.

## Why RDK?

Building LLM applications requires understanding what's happening under the hood. RDK helps you:

* **Debug faster** - See exactly what prompts are sent and responses received
* **Monitor costs** - Track token usage across all your LLM calls
* **Optimize performance** - Identify slow calls and bottlenecks
* **Ensure compliance** - Automatically redact PII from traces

## Key Features

<CardGroup cols={2}>
  <Card title="Auto-instrumentation" icon="wand-magic-sparkles">
    Automatic tracing for Anthropic, OpenAI, LangChain, and Gemini SDKs
  </Card>

  <Card title="PII Redaction" icon="shield-halved">
    Built-in redaction for emails, phone numbers, SSNs, API keys, and custom patterns
  </Card>

  <Card title="Minimal Overhead" icon="gauge-high">
    Async batching with configurable flush intervals
  </Card>

  <Card title="Framework Agnostic" icon="puzzle-piece">
    Works with FastAPI, Flask, or any Python application
  </Card>

  <Card title="Synthetic Worlds" icon="flask-vial">
    Simulate tool calls with realistic responses for fast local iteration
  </Card>
</CardGroup>

## Supported Integrations

| Provider      | Auto-instrumentation | Notes                                            |
| ------------- | -------------------- | ------------------------------------------------ |
| Anthropic     | Yes                  | Auto-instrumented at `init()`                    |
| OpenAI        | Yes                  | Auto-instrumented at `init()`                    |
| LangChain     | Yes                  | Auto-instrumented at `init()`                    |
| Google Gemini | Yes                  | Auto-instrumented at `init()`                    |
| BAML          | Manual               | Requires `b = instrument_baml(b)` after `init()` |

## Quick Example

```python theme={null}
from rdk import observe
from anthropic import Anthropic

# All LLM calls are automatically traced
@observe(name="my-chat")
def chat(message: str) -> str:
    client = Anthropic()
    response = client.messages.create(
        model="claude-sonnet-4-6",
        max_tokens=1024,
        messages=[{"role": "user", "content": message}]
    )
    return response.content[0].text

result = chat("Hello, world!")  # Auto-initializes using RDK_API_KEY
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get up and running in 5 minutes
  </Card>

  <Card title="Integrations" icon="plug" href="/integrations/anthropic">
    Set up your LLM provider
  </Card>
</CardGroup>
