{"id":50297965,"url":"https://github.com/philterd/philter-ai-proxy","last_synced_at":"2026-05-28T10:04:47.569Z","repository":{"id":180156713,"uuid":"664666559","full_name":"philterd/philter-ai-proxy","owner":"philterd","description":"A proxy that uses Philter to redact text sent to AI services.","archived":false,"fork":false,"pushed_at":"2026-05-27T18:33:07.000Z","size":677,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-27T19:26:53.160Z","etag":null,"topics":["ai","ai-guardrails","guardrails","philter","proxy","redact"],"latest_commit_sha":null,"homepage":"https://www.philterd.ai","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philterd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-07-10T13:33:51.000Z","updated_at":"2026-05-27T18:32:37.000Z","dependencies_parsed_at":"2023-09-07T18:46:35.245Z","dependency_job_id":null,"html_url":"https://github.com/philterd/philter-ai-proxy","commit_stats":null,"previous_names":["philterd/philter-openai-proxy","philterd/philter-ai-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/philterd/philter-ai-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philterd%2Fphilter-ai-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philterd%2Fphilter-ai-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philterd%2Fphilter-ai-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philterd%2Fphilter-ai-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philterd","download_url":"https://codeload.github.com/philterd/philter-ai-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philterd%2Fphilter-ai-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33603479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-guardrails","guardrails","philter","proxy","redact"],"created_at":"2026-05-28T10:04:44.463Z","updated_at":"2026-05-28T10:04:47.563Z","avatar_url":"https://github.com/philterd.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Philter AI Proxy\n\nThis project is a proxy for OpenAI, Claude, Gemini, Ollama, and Amazon Bedrock that uses [Philter](https://philterd.ai/philter/) to remove PII, PHI, and other sensitive information from a [chat completion](https://platform.openai.com/docs/api-reference/chat), [messages](https://docs.anthropic.com/claude/reference/messages_post), [Gemini](https://ai.google.dev/api/rest/v1beta/models/generateContent), [Ollama](https://docs.ollama.com/api/generate), or [Bedrock Converse](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html) request before sending the request to the respective API. If you don't have a running instance of Philter, you can launch one in your cloud at https://philterd.ai/philter/.\n\nThe proxy works by sending requests destined for OpenAI, Claude, Gemini, Ollama, or Amazon Bedrock first to Philter where the sensitive information is redacted per Philter's configuration. The redacted text is then sent to the API. For example, if you send the following text `How old is John Smith?`, the proxy and Philter will remove the text `John Smith` from the request. The redacted request sent to the API will be `How old is REDACTED?`\n\nOutbound response scanning is also supported on an opt-in basis: LLM responses can be scanned through Philter before being returned to the client, guarding against hallucinated or training-data PII in responses. The behavior is configurable per route: redact detected PII, block the response entirely, or pass it through with a warning log.\n\nView the [documentation](http://philterd.github.io/philter-ai-proxy).\n\n## Running the Proxy\n\nCopy `config.example.yaml` to `config.yaml`, edit the values to match your environment, then run:\n\n```\n./philter-ai-proxy --config config.yaml\n```\n\nOr set the config path via environment variable:\n\n```\nPHILTER_PROXY_CONFIG=config.yaml ./philter-ai-proxy\n```\n\nTo run with Docker Compose, update `config.yaml` (mounted into the container) and then:\n\n```\ndocker compose build\ndocker compose up\n```\n\n## Usage\n\nTo use this proxy, you can send a request to it like you would to OpenAI, Claude, Gemini, or Bedrock but change the hostname:\n\n### OpenAI\n\n```\ncurl https://localhost:8080/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $OPENAI_API_KEY\" \\\n  -d '{\n    \"model\": \"gpt-3.5-turbo\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Whose social security number is 123-45-6789\"}]\n  }'\n```\n\n### Claude\n\n```\ncurl https://localhost:8080/v1/messages \\\n  -H \"Content-Type: application/json\" \\\n  -H \"x-api-key: $ANTHROPIC_API_KEY\" \\\n  -H \"anthropic-version: 2023-06-01\" \\\n  -d '{\n    \"model\": \"claude-3-5-sonnet-20241022\",\n    \"max_tokens\": 1024,\n    \"messages\": [{\"role\": \"user\", \"content\": \"Whose social security number is 123-45-6789\"}]\n  }'\n```\n\n### Gemini\n\n```\ncurl \"https://localhost:8080/v1beta/models/gemini-1.5-flash:generateContent?key=$GEMINI_API_KEY\" \\\n    -H 'Content-Type: application/json' \\\n    -X POST \\\n    -d '{\n      \"contents\": [{\n        \"parts\":[{\"text\": \"Whose social security number is 123-45-6789\"}]\n      }]\n    }'\n```\n\n### Ollama\n\n```\ncurl https://localhost:8080/api/generate \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"model\": \"llama3\",\n    \"prompt\": \"Whose social security number is 123-45-6789\",\n    \"stream\": false\n  }'\n```\n\n### OpenAI-Compatible Providers (Mistral, Cohere, vLLM, etc.)\n\nRegister any OpenAI-compatible provider under `providers.openaiCompatible` in `config.yaml`:\n\n```yaml\nproviders:\n  openaiCompatible:\n    mistral:\n      target: https://api.mistral.ai\n```\n\nThen send requests to `/{name}/v1/...`:\n\n```\ncurl https://localhost:8080/mistral/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer $MISTRAL_API_KEY\" \\\n  -d '{\n    \"model\": \"mistral-small-latest\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Whose social security number is 123-45-6789\"}]\n  }'\n```\n\n### Amazon Bedrock\n\nThe proxy signs requests to Bedrock using AWS Signature Version 4 — no AWS credentials are required from the client. Set `providers.bedrock.region` in `config.yaml` to enable this provider.\n\n```\ncurl https://localhost:8080/model/amazon.titan-text-express-v1/converse \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"messages\": [{\"role\": \"user\", \"content\": [{\"text\": \"Whose social security number is 123-45-6789\"}]}],\n    \"inferenceConfig\": {\"maxTokens\": 512}\n  }'\n```\n\n## License\n\nCopyright 2023-2026 Philterd, LLC. \"Philter\" is a registered trademark of Philterd, LLC.\n\nLicensed under the Apache License, version 2.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilterd%2Fphilter-ai-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilterd%2Fphilter-ai-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilterd%2Fphilter-ai-proxy/lists"}