How ilialarchenko/interviewer works
Project type and purpose
• This is a full-stack, containerized AI interview simulator built with Python and Gradio.
• Purpose: provide a speech-first interface for mock technical interviews by orchestrating LLM calls, speech-to-text (STT), and text-to-speech (TTS).
File structure
• Top level
• app.py: entry point launching the Gradio UI and wiring together modules
• Dockerfile / docker-compose.yml: containerization and multi-service orchestration
• requirements.txt, .env examples: dependency and environment management
• Directories
• api/: modules encapsulating external AI calls (api/llm.py, api/audio.py)
• ui/: UI “controllers” splitting coding prompts and general instructions
• resources/: static prompts or data definitions used by the logic
• utils/: configuration loader, error definitions, parameter helpers, UI helpers
• tests/: end-to-end and unit tests verifying models, prompts, and flows
Extract architecture insights from the README
• The app orchestrates three AI model types: LLM, STT, TTS
• Environment configured via .env (keys, endpoints, model names)
• Supports OpenAI, Hugging Face, Anthropic, or local model endpoints
• Streaming data flows are supported for partial real-time responses
Main components
a. User client
• Web browser or Gradio embed
b. Gradio UI layer (app.py + ui/*)
• Input components: mic button (audio capture), text input
• Output components: text stream, audio playback
c. Controller/orchestration layer
• app.py routes user events to api and utils
• utils/config reads .env, selects model endpoints
• resources/prompts defines templated prompts
d. API adapters
• api/llm.py calls LLM endpoint (OpenAI, HF, Anthropic)
• api/audio.py handles STT and TTS calls (Whisper, tts-1, HF TTS)
e. External Model Services
• OpenAI (LLM, Whisper, TTS)
• Hugging Face inference endpoints or local model servers
f. Testing layer
• tests/* verifies each module independently (models, prompts, flow)
g. Infrastructure
• Docker container for the app
• docker-compose enabling multi-service (if local model servers are added)
Relationships and data flow
• User speaks or types → Gradio UI captures input → app.py
• For audio input: app.py → api/audio.py (STT) → transcribed text → back to app.py
• app.py assembles prompt with resources/prompts → api/llm.py → LLM response stream
• app.py passes LLM text to api/audio.py (TTS) → audio stream → Gradio UI
• All calls use utils/config settings for endpoints, keys, and model names
Architectural patterns and principles
• Layered architecture: UI layer, orchestration layer, adapter layer, external services
• Single-responsibility modules: ui/* only handles UI elements, api/* only calls external services, resources/* only holds static data
• Configuration-driven design via utils/config and .env examples
• Dependency injection via config for model URLs and types