🔗 Live Application: https://contractscan-ai-pejjpdbqmcuqqgyyoaiw9a.streamlit.app/
Legal contracts are complex, lengthy, and difficult for non-lawyers to interpret. Manual review is slow and often misses hidden risk clauses.
ContractScan AI solves this by using a large language model (LLaMA 3.3 70B via Groq) to:
- Extract key contractual clauses
- Detect legal & financial risks
- Classify risk severity
- Provide plain-English summaries
- Return structured, machine-readable JSON
- 📂 Upload contract PDFs (up to 200MB)
- 📝 Paste raw contract text
- 🤖 AI-driven clause extraction
⚠️ Risk classification (High / Medium / Low)- 📊 Structured JSON response
- 📘 Plain-English executive summary
- 🎯 Clean, responsive Streamlit UI
- ☁️ Cloud deployment (Streamlit Community Cloud)
- 🔐 Secure API key handling via environment variables
User Input (PDF/Text)
↓
PDF Text Extraction (pdfplumber)
↓
Structured Prompt Engineering
↓
Groq LLaMA 3.3 70B API
↓
Strict JSON Response
↓
Parsed & Rendered Risk Dashboard
| Layer | Technology |
|---|---|
| Frontend | Streamlit |
| Backend Logic | Python |
| LLM Provider | Groq API |
| Model | LLaMA 3.3 70B Versatile |
| PDF Parsing | pdfplumber |
| Environment Handling | python-dotenv |
{
"summary": "This contract defines employment terms between Company A and Employee B.",
"parties": ["Company A", "Employee B"],
"risk_flags": [
{
"clause": "Non-compete",
"risk_level": "HIGH",
"reason": "Restrictive 3-year non-compete period"
}
],
"recommendations": [
"Negotiate non-compete duration",
"Clarify termination conditions"
]
}git clone https://github.com/siddhart3000/contractscan-ai.git
cd contractscan-aipython -m venv venv
source venv/bin/activate # Mac/Linux
venv\Scripts\activate # Windowspip install -r requirements.txtCreate .env file:
GROQ_API_KEY=your_groq_api_key_here
Get API key from: https://console.groq.com/keys
streamlit run app.pyAccess at: http://localhost:8501
- Deployed on Streamlit Community Cloud
- Environment variables securely configured
- Automatic redeploy on GitHub push
- Public production-ready URL available
Live App: https://contractscan-ai-pejjpdbqmcuqqgyyoaiw9a.streamlit.app/
- API keys are NOT stored in repository
.envis excluded via.gitignore- Secrets managed securely in deployment
- Strict JSON schema enforced in model response
- Input validation implemented
✔ LLM API Integration ✔ Structured Information Extraction ✔ Risk Categorization Logic ✔ Clean & Functional UI ✔ Secure Deployment ✔ Public GitHub Repository ✔ Working Live Demo
- Predictive dispute probability scoring
- Financial impact projection
- Contract comparison engine
- Downloadable PDF risk report
- Job offer / campus drive analyzer module
- Multi-language contract support
Siddharth Singh AI Enthusiast | DSA Developer | Data Visualizer B.Tech CSE @ LPU (2022–2026)
GitHub: https://github.com/siddhart3000
This project is built for educational and evaluation purposes.