Logo Lanfrica

Muhdrabe22/hausa-AI-chat

Domain:

natural language processing

Record type:

software
Creator:
Muh
Host:
# πŸŒ™ Aminu AI β€” Hausa Intelligent Assistant A full-stack, production-grade Hausa AI chatbot with voice support. ``` Stack: Python Β· FastAPI Β· Next.js Β· PostgreSQL Β· Qwen2.5-7B Β· Hugging Face Β· RunPod Β· Whisper STT Β· Coqui TTS ``` --- ## Architecture Overview ``` Browser (Next.js 14) β”‚ β”œβ”€β”€ Text message ──► POST /api/chat ──► LLM Service β”‚ β”‚ └── Voice message ──► POST /api/voice β”œβ”€β”€ RunPod (primary, GPU) β”‚ β”‚ └── Ollama local (fallback) β”‚ Whisper STT β”‚ (transcribe audio) β”‚ └── TTS reply ◄── Coqui TTS / gTTS FastAPI ──► PostgreSQL (sessions + messages) ──► Redis (optional caching) ``` --- ## Project Structure ``` aminu-ai/ β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ app/ β”‚ β”‚ β”œβ”€β”€ main.py # FastAPI app entry point β”‚ β”‚ β”œβ”€β”€ api/chat.py # All API routes β”‚ β”‚ β”œβ”€β”€ core/ β”‚ β”‚ β”‚ β”œβ”€β”€ config.py # Settings (pydantic-settings) β”‚ β”‚ β”‚ └── schemas.py # Pydantic request/response models β”‚ β”‚ β”œβ”€β”€ db/base.py # SQLAlchemy async engine + Base β”‚ β”‚ β”œβ”€β”€ models/chat.py # ORM models (Session, Message) β”‚ β”‚ └── services/ β”‚ β”‚ β”œβ”€β”€ llm.py # RunPod + Ollama LLM service β”‚ β”‚ β”œβ”€β”€ stt.py # Whisper speech-to-text β”‚ β”‚ └── tts.py # Coqui / gTTS text-to-speech β”‚ β”œβ”€β”€ requirements.txt β”‚ β”œβ”€β”€ Dockerfile β”‚ └── .env.example β”œβ”€β”€ frontend/ β”‚ β”œβ”€β”€ app/ β”‚ β”‚ β”œβ”€β”€ layout.tsx β”‚ β”‚ β”œβ”€β”€ page.tsx # Main chat UI β”‚ β”‚ └── globals.css β”‚ β”œβ”€β”€ components/ β”‚ β”‚ β”œβ”€β”€ ChatMessage.tsx # Message bubble β”‚ β”‚ β”œβ”€β”€ VoiceButton.tsx # Mic record/stop UI β”‚ β”‚ └── AudioPlayer.tsx # TTS audio playback β”‚ β”œβ”€β”€ lib/ β”‚ β”‚ β”œβ”€β”€ api.ts # Axios API client β”‚ β”‚ └── useVoiceRecorder.ts # MediaRecorder hook β”‚ └── .env.example β”œβ”€β”€ deployment/ β”‚ β”œβ”€β”€ runpod_handler.py # RunPod serverless handler β”‚ └── Dockerfile.runpod # RunPod GPU …

Languages