Faasera Documentation

πŸ“š Table of Contents


Faasera Chat Compliance Proxy is a secure, pluggable reverse proxy that redacts sensitive information (PII, PHI, PCI, etc.) from chat completion requests before forwarding them to OpenAI or any LLM endpoint. It uses Faasera Profiler to perform inline masking for compliance and privacy protection.


Why Use This Proxy?


Features


Quickstart

1. Clone the Repo

git clone https://github.com/faasera/faasera-openai-proxy.git
cd faasera-openai-proxy

2. Create a .env file

# TLS configuration
FAASERA_PROXY_PORT=8080
FAASERA_CERT_FILE=certs/cert.pem
FAASERA_KEY_FILE=certs/key.pem

# Profiler
FAASERA_PROFILER_ENDPOINT=https://localhost:8000

# Target LLM
DEFAULT_TARGET=openai
OPENAI_API_KEY=sk-xxx
CLAUDE_API_KEY=sk-ant-xxx

3. Generate Certificates (Optional for HTTPS)

make cert

4. Run the Proxy

make run

This starts an HTTPS server on https://localhost:8080.


Example Request

curl https://localhost:8080/v1/chat/completions \
  -k \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
    "model": "gpt-3.5-turbo",
    "messages": [{"role": "user", "content": "My SSN is 123-45-6789 and my name is John Smith"}]
  }'

What Happens:

  1. Text is sent to Faasera Profiler.
  2. Sensitive parts (e.g. John Smith, 123-45-6789) are redacted.
  3. Cleaned request is forwarded to OpenAI or the configured LLM.
  4. Response is returned to the client.

Multi-LLM Support

The proxy can forward redacted requests to any of these:

Provider Env Value Path
OpenAI openai /v1/chat/completions
Claude claude /v1/messages
Gemini gemini /v1beta/models/...
Local local /chat

Change the target by setting:

DEFAULT_TARGET=claude

How It Works


Project Structure

faasera-openai-proxy/
β”œβ”€β”€ main.py                       # Entry point (TLS-enabled server)
β”œβ”€β”€ Makefile                      # Run and cert helpers
β”œβ”€β”€ requirements.txt              # Minimal dependencies
β”œβ”€β”€ config/
β”‚   └── env.example               # Sample env vars
β”œβ”€β”€ certs/
β”‚   └── cert.pem, key.pem         # TLS certificates (auto-generated)
β”œβ”€β”€ docs/
β”‚   └── README.md                 # This file
β”œβ”€β”€ scripts/
β”‚   └── generate_cert.sh          # Self-signed cert generator
β”œβ”€β”€ faasera_openai_proxy/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ proxy.py                  # Core proxy logic (mask + forward)
β”‚   └── targets.py                # LLM target router
└── tests/
    β”œβ”€β”€ __init__.py
    └── test_proxy.py             # Basic tests

Security Notes


License

MIT. Includes third-party dependencies under their respective licenses.


About Faasera

Faasera is a real-time data compliance platform that automates data profiling, masking, validation, and privacy controls across modern AI and data pipelines.


πŸ“ž Support & Resources

Resource Link
🌐 Website faasera.ai
πŸ“§ Support support.faasera.ai
πŸŽ₯ YouTube youtube.com/@FaaseraAI
πŸ’Ό LinkedIn linkedin.com/company/faasera
πŸ“˜ Facebook facebook.com/faasera.ai