anymize.py
Python ยท 404 lines21 class Valves(BaseModel):22 anymize_api_key: str = Field(23 default="",24 description="Your anymize API key (format: anymize_xxxxxxxxxxxxx)",25 )26 27 input_filter: str = Field(28 "text_anonymization",29 description="Controls how sensitive data in the input is processed before analysis",30 json_schema_extra={31 "enum": [32 "text_anonymization", ๐Anymize Filter for Open-WebUI
Automatically anonymize sensitive data in your AI conversations for GDPR compliance and privacy protection.
๐ฏWhat it does
Detects and anonymizes personally identifiable information (PII) before sending to AI models:
- Names โ [[Name-abc123]]
- Emails โ [[Email-def456]]
- Phone numbers โ [[Phone-ghi789]]
- Addresses, SSNs, financial data and more
- Document files โ Text extraction + anonymization
๐Installation
1. Install Function
- Go to link
- Click "Get" or "Install" button
- Function will be automatically added to your Open-WebUI
2. Enable Function
- Toggle the function ON (blue switch)
- Click three dots (โฏ) โ Toggle "Global" ON
โ๏ธConfiguration
1. Get API Key
- Sign up at anymize.ai
- Generate API key (format:
anymize_xxxxxxxxxxxxx)
2. Configure Settings
- Go to Admin Panel โ Functions โ Anymize Filter
- Click gear icon (โ๏ธ)
- Set configuration:
| Setting | Options | Description |
|---|---|---|
anymize_api_key | anymize_xxxxx | Your API key (REQUIRED) |
input_filter | text_anonymization (default) | Anonymize text messages only |
file_anonymization | Anonymize uploaded files only | |
text_file_anonymization | Anonymize both text messages and files | |
output_filter | anonymized (default) | Keep responses with anonymized placeholders |
deanonymized | Restore original values in responses |
- Click Save
๐ฌUsage
1. Enable in Chat
- Start new chat
- Toggle Anymize button ON in chat interface
- Send message with sensitive data and/or upload files
2. Input Filter Options
Text Only (text_anonymization)
Your input:
Hi, I'm John Smith, email: [email protected], phone: (555) 123-4567 AI sees (anonymized):
Hi, I'm [[Name-abc123]], email: [[Email-def456]], phone: [[Phone-ghi789]] Files Only (file_anonymization)
- Upload PDF, Word, or text files
- Files are processed to extract text content
- Extracted text is anonymized before sending to AI
- Original message text remains unchanged
Both Text and Files (text_file_anonymization)
- Your message text gets anonymized
- Uploaded files are processed and anonymized
- All content is combined and sent to AI
3. Output Filter Options
Anonymized Response (anonymized)
Hello [[Name-abc123]]! I can help you with your account at [[Email-def456]]. Deanonymized Response (deanonymized)
Hello John Smith! I can help you with your account at [email protected]. ๐Supported File Types
- PDF documents (.pdf)
- Word documents (.doc, .docx)
- Text files (.txt)
Files are processed to extract text content, which is then anonymized before analysis.
๐งTroubleshooting
| Problem | Solution |
|---|---|
| "API key not configured" | Set API key in Admin Panel โ Functions โ Gear icon |
| Function not working | Check: Function enabled + Global enabled + Anymize button ON |
| "Anonymization failed" | Verify API key, check network, try again |
| "File processing failed" | Check file format is supported, file isn't corrupted |
| "Anonymization timeout" | Large files may take time, wait up to 25 minutes |
| "Google quota exceeded" | Switch to different AI model (not an anymize issue) |
โ Quick Setup Checklist
- Install function in Admin Panel
- Enable function (blue toggle)
- Enable globally (โฏ โ Global)
- Set API key in configuration
- Choose input filter (text/files/both)
- Choose output filter (anonymized/deanonymized)
- Toggle Anymize button ON in chat
- Test with personal data and/or files
๐Support
- Open-WebUI: docs.openwebui.com
๐ Ready to chat securely with protected data and files!
0
1 
