Rahnuma is a production-quality Urdu AI assistant designed to help users with general conversations, text rewriting, and content summarization. It is built with a focus on Responsible AI, incorporating multi-stage safety guardrails to ensure it does not provide medical, legal, or religious advice.
| Screen 2 | Screen 3 |
|---|---|
![]() |
![]() |
- Native Urdu Fluency: Optimized using the
Qalb-1.0-8B-Instructmodel for natural Pakistani Urdu. - Advanced Orchestration: Conversation logic managed by LangGraph for robust state management.
- Safety First: Integrated keyword filtering and LLM-based intent classification to block sensitive domains.
- Premium UI: Modern, responsive Right-to-Left (RTL) chat interface built with accessibility in mind.
- LLM Core: Qalb-1.0-8B-Instruct (HuggingFace Transformers)
- Quantization: BitsAndBytes (4-bit NF4 quantization for efficient GPU memory usage)
- Agent Framework: LangGraph (Stateful orchestration)
- Backend API: FastAPI (High-performance asynchronous API)
- Inference Engine: PyTorch & Accelerate
- Frontend: Custom HTML5, CSS3 (with Google Fonts Integration), and Vanilla JavaScript
- Web Server: Uvicorn
The assistant is strictly constrained to avoid high-stakes advice. The pipeline includes:
- Classify Intent: Detects if the user is asking for chat, rewriting, or blocked topics.
- Safety Check: Immediate refusal of medical, legal, or religious queries.
- Post-Processing: Ensures output quality and removes repetitive patterns.
rahnuma/
├─ app/
│ ├─ main.py # FastAPI Server & Routes
│ ├─ graph.py # LangGraph Pipeline logic
│ ├─ model.py # Model loading & Inference
│ ├─ safety.py # Heuristic guardrails
│ └─ prompts.py # All Urdu system prompts
├─ ui/
│ └─ index.html # Front-end chat UI
├─ requirements.txt # Project dependencies
└─ README.md # Documentation
Ensure the model files are located at ./models/Qalb-1.0-8B-Instruct.
pip install -r requirements.txtpython -m rahnuma.app.mainAccess the interface at http://localhost:8001.
AI Engineer | RAG Systems | LLM Chatbots | AI Agents
I build production-grade AI systems that help businesses:
- RAG Systems: Chat with private data securely.
- AI Agents: Automate complex multi-step workflows.
- Custom LLM Solutions: Fine-tuned and optimized for specific niche tasks.
- Python-based AI Backends: Scalable, reliable, and high-performance.
- 📧 Email: [email protected]
- 🔗 LinkedIn: Hassan Khan
- 🔗 Upwork: Work with me on Upwork
Disclaimer: Rahnuma is an AI assistant and is not a substitute for professional human consultation.


