Triton AI Docs

Privacy Filter

Classify sensitive text with the hosted OpenAI Privacy Filter.

Send text to OpenAI Privacy Filter through the Triton AI vLLM passthrough. The model returns a classification score for each token.

Your key must include access to openai-privacy-filter. Use the authenticated model list to check access.

Classify text

Call POST /vllm/pooling with task: "token_classify". Privacy Filter uses token classification, so a Chat Completions request does not work.

The Python example uses only the standard library.

privacy_filter.py
import json
import os
from urllib.request import Request, urlopen

request = Request(
    "https://tritonai-api.ucsd.edu/vllm/pooling",
    headers={
        "Authorization": f"Bearer {os.environ['TRITONAI_API_KEY']}",
        "Content-Type": "application/json",
    },
    data=json.dumps({
        "model": "openai-privacy-filter",
        "input": "Contact Jamie Example at jamie@example.com or 202-555-0142.",
        "task": "token_classify",
    }).encode("utf-8"),
)

with urlopen(request, timeout=60) as response:
    result = json.load(response)

scores = result["data"][0]["data"]
print(f"Tokens: {len(scores)}")
print(f"Classes per token: {len(scores[0])}")

Read the scores

The data array contains one result per input. Each result has an index and a nested data array of token scores.

For one input with T tokens, the score array has shape T × 33. The 33 classes encode a background label and boundaries for eight privacy categories.

OpenAI publishes the class IDs in the model configuration.

From scores to redacted text

This endpoint returns token scores, not redacted text. Redaction also requires token-to-text alignment and decoding the scores into spans.

Use the constrained BIOES decoding described in the OpenAI model card. Independent per-token maximum scores can produce inconsistent span boundaries.

Evaluate the complete redaction process against your data and policy before production use. Model output does not replace data-access controls or human review.

See the Privacy Filter endpoint reference for the tested request and response fields.

On this page