Content
# 🧠 AI Log Analyzer
[](https://www.python.org/)
[](https://fastapi.tiangolo.com/)
[](https://ollama.com/)
[](LICENSE)
> ✨ An AI-powered system for **log file analysis** using local LLaMA3 + FastAPI.
> 🚨 Detects anomalies, 🧠 recognizes patterns, and 📄 generates automated incident reports.
> Ideal for **web server logs**, **application logs**, or **custom pipelines**.
---
## 🎯 Features
- 🔍 **Anomaly Detection** – Captures HTTP errors, exceptions, and unusual logs
- 📊 **Pattern Recognition** – Identifies frequent paths/messages
- 🤖 **AI Chatbot Interface** – Interact via terminal CLI using LLaMA3 (Ollama)
- ⚡ **FastAPI REST API** – Query `/analyze` for real-time results
- 📁 **JSON Report Export** – Auto-generated `incident_report.json`
---
<details>
<summary>📁 <strong>Project Structure</strong> (click to expand)</summary>
ai-log-analyzer/
├── main/
│ ├── log_chatbot.py # Interactive CLI chatbot
│ ├── run_pipeline.py # Main execution pipeline
│ ├── llama_query.py # Talk to LLaMA locally
│ ├── mcp_server.py # FastAPI app for RESTful analysis
│ ├── report_generator.py # Saves JSON report
│ ├── anomaly_detector.py # Anomaly rules (500, error)
│ ├── pattern_recognizer.py # Pattern recognition logic
│ └── mcp_tools/
│ ├── parser.py # Raw log parser
│ └── analyzer.py # Combined logic
├── logs/ # Example log files
├── output/ # Generated reports
├── requirements.txt
└── README.md
</details>
---
## ⚙️ Installation
```bash
git clone https://github.com/Labeeb-coder/ai-log-analyzer.git
cd ai-log-analyzer
pip install -r requirements.txt
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
markitdown
Python tool for converting files and office documents to Markdown.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
OmniRoute
Never stop coding. The free AI gateway — one endpoint, 160+ providers, zero...
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
mempalace
The highest-scoring AI memory system ever benchmarked. And it's free.