CoolFace
Apppublic

Anonymized1/Interacting-With-LLMs

sourceHugging Facecc-by-4.0updated 1d agoView on Hugging Face
0likes
App README

PRISE — Privacy Risk Inference System with Explainability

PRISE is a browser-based chat interface that places a transparency layer between the user and a conversational LLM. Alongside the model's ordinary reply, each turn is annotated to show what the system has learned about the user. Identifying details in the message are highlighted and labelled by type. Phrases that match an external record about the user are marked and traced back to their source. A profile card lists the demographic attributes the model can now predict, each with its confidence and the evidence behind it. A single risk score summarises the turn.

Differential privacy can be applied on the user's side: before a message is sent, its content words are perturbed so that the model receives a noised version of the text. The conversation panel still shows what the user actually wrote, and a badge on the message reports how many words were substituted and at which privacy budget (ε).

Usage

Dependencies

Python 3.10. Install with:

bash
pip install -r requirements.txt

The main dependencies are Gradio, OpenAI, LangChain, FAISS, sentence-transformers and rank-bm25.

API keys

Keys are read from the environment; only the provider you intend to use is required.

bash
export GEMINI_API_KEY="..."         # default provider
export OPENAI_API_KEY="..."         # optional
export TOGETHER_API_KEY="..."       # optional
export VALID_ACCESS_TOKEN_1="..."   # optional, gates the app behind a token

Running

bash
python app.py

The app serves on http://localhost:7860.

Options

Every option below is available both as a command-line flag and as a URL query parameter, so a configuration can be assigned via a link:

http://localhost:7860/?rag=1&epsilon=20&show_pii_highlights=1
OptionValuesDefaultMeaning
modelmodel nameGemini-2.5-FlashLLM used for the conversation
rag0 / 11Link the conversation against the external corpus
epsilonfloat or infinfPrivacy budget for the perturbation; inf disables it
show_risk0 / 11Show the privacy risk panel
show_tips0 / 11Show hover tooltips
show_pii_highlights0 / 11Highlight identifying details
show_rag_highlights0 / 11Highlight matches against external data
show_settings0 / 10Show the live settings panel
show_dp031When to show the privacy settings panel: never, after each turn, at the start only, or when the conversation ends
show_infr_attr_card021When to show the inferred-attributes card: never, after each turn, or when the conversation ends
enable_social_scraping0 / 10Retrieve public social media posts as external data (experimental)
show_social_scraping0 / 10Show the social media control in the interface
show_upload_data0 / 10Show the control for uploading a custom corpus
scenario_modereal, persona1, persona2realFree-style conversation, or a scripted persona
demo0 / 10Run the interface without making API calls

token is accepted as a URL parameter only, and carries the session access token. --retriever_path (an alternative retriever pickle) and --port (default 7860) are command-line flags only.

License

CC BY 4.0.