RedaktAIDocs

Playground

Run the interactive demo to see Rdakt AI in action

The Rdakt AI playground is a full-stack chat application that demonstrates anonymization in real-time. It includes a React frontend with a live anonymization inspector.

Prerequisites

  • Docker and Docker Compose installed
  • At least one LLM API key (OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY)

Start the Playground

docker compose -f playground/docker-compose.yml up --build -d

This starts:

  • Frontend — React app at http://localhost:5173
  • Backend — FastAPI server at http://localhost:8000

Using the Playground

  1. Open http://localhost:5173 in your browser

  2. Select a model from the dropdown (GPT-4o, Claude Sonnet, Gemini Flash)

  3. Send a message containing PII, for example:

    "My name is John Smith, my email is john@example.com and my SSN is 123-45-6789. Can you summarize my profile?"

  4. Watch the Rdakt Inspector panel — it shows:

    • Entities detected in your message
    • The anonymized text sent to the LLM
    • The entity mapping (token → original value)
    • The deanonymized response

Test via cURL

curl -s -N http://localhost:8000/api/chat \
  -H 'Content-Type: application/json' \
  -d '{
    "messages": [{"role": "user", "content": "My email is john@example.com"}],
    "model": "gpt-4o-mini"
  }'

Architecture

Browser (React + useChat)
    ↓ Vercel AI Data Stream Protocol
FastAPI Backend
    ↓ RdaktMiddleware wrapping httpx transport
LLM API (OpenAI / Anthropic / Gemini)

The backend creates a RdaktMiddleware instance per conversation, with SQLite-backed session persistence. The frontend uses @ai-sdk/react's useChat hook for streaming.

Stop the Playground

docker compose -f playground/docker-compose.yml down

On this page