FallacyLens is an AI-powered logical fallacy detection toolkit for arguments, essays, and debates.
This version uses the Groq Chat Completions API (e.g. llama-3.3-70b-versatile) as the
reasoning engine. Your Python code controls the prompt, parsing, and presentation.
Try the public demo on Streamlit Cloud:
👉 https://fallacylens-groq-wiqilee.streamlit.app
⚠️ This demo uses a shared Groq API key.
Please avoid automated or excessive requests.
- Logical fallacy span detection with severity + confidence
- Inline highlighting for detected fallacies in your text
- Clarity / Persuasion / Reliability scores (0–100)
- Assistant tools: rewrite, teacher feedback, persuasion optimizer, bias review
- Batch CSV analysis (column:
text) - Multi-model comparison across Groq-hosted models
- Python
- Streamlit (demo UI)
- FastAPI (service API)
- Groq Chat Completions API (LLM inference)
-
Create a Groq API key at https://console.groq.com.
-
Export your key as an environment variable:
export GROQ_API_KEY="YOUR_REAL_GROQ_API_KEY"
For quick local testing only, you can also edit
fallacylens/detector.pyand replace the string"YOUR_GROQ_API_KEY_HERE"with your real key, but you must not commit that to GitHub. -
Install dependencies:
pip install -r requirements.txt
-
Run the Streamlit demo:
streamlit run demo/app.py
-
Run the FastAPI service:
uvicorn api.main:app --reload
.
├─ api/ # FastAPI service
├─ demo/ # Streamlit demo app
├─ fallacylens/ # Core library (detector, models, taxonomy)
├─ requirements.txt
└─ README.md
- Never commit secrets (API keys,
.env, or Streamlit secrets). - Use environment variables (recommended) or your deployment platform’s secret manager.
- This repo includes a
.gitignorethat helps prevent accidental commits of credentials.
Built by Wiqi Lee
X / Twitter: @wiqi_lee
MIT — see LICENSE.