CoolFace
Apppublic

yamraj047/api-problem-fix

sourceHugging Faceapache-2.0updated 8mo agoView on Hugging Face
0likes
README.md66 linesDownload Raw Back to root
1---2title: LexNepal AI API3emoji: ⚖️4colorFrom: blue5colorTo: indigo6sdk: docker7pinned: false8license: apache-2.09---10 11# 🇳🇵 LexNepal AI API12 13Advanced Legal Intelligence API for Nepal Legal Code using Retrieval-Augmented Generation (RAG).14 15## 🚀 Features16 17- **Hybrid Retrieval**: Dense vector search + keyword matching18- **Cross-Encoder Reranking**: Precise relevance scoring19- **Zero-Hallucination**: Answers only from verified legal texts20- **Fast & Free**: Optimized for CPU inference21 22## 🏗️ Architecture23 24- **Embedding Model**: all-mpnet-base-v2 (768D)25- **Reranking**: MS-MARCO Cross-Encoder26- **LLM**: Llama 3.3 70B (via Groq)27- **Vector DB**: FAISS (L2 Index)28 29## 📡 API Endpoints30 31- `GET /` - Interactive API documentation (Swagger UI)32- `GET /health` - Health check33- `GET /stats` - Database statistics34- `POST /query` - Process legal query35 36## 💻 Usage Example37```bash38curl -X POST "https://YOUR_USERNAME-lexnepal-api.hf.space/query" \39  -H "Content-Type: application/json" \40  -d '{41    "query": "What are the penalties for theft in Nepal?",42    "max_sources": 1043  }'44```45 46## 🔒 Environment Variables47 48Set `GROQ_API_KEY` in Space settings for custom API key.49 50## 📊 Dataset51 52- **Total Provisions**: 6000+53- **Legal Documents**: 7 Nepal laws54- **Vector Dimensions**: 76855 56## 🛠️ Tech Stack57 58- FastAPI59- Sentence Transformers60- FAISS61- Groq API62- Docker63 64---65 66Built with ❤️ for Nepal's legal community