Skip to content

dmtr-karan/streamlit-interview-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streamlit Interview Simulator

A minimal, recruiter-friendly Streamlit app that simulates a job interview using the OpenAI API.
It guides the user through a brief setup, runs a short interview with streamed model responses, supports an immediate Stop control (button or ESC), and then generates structured feedback.

Status Python Streamlit OpenAI License CI


Features

  • Guided setup: Candidate details + target role/company.
  • Interview chat: OpenAI Chat Completions with streaming output.
  • Stop control: Button on the UI + ESC key to halt generation mid-stream.
  • Early-stop rule: If stopped before any user message, feedback will not be offered (by design).
  • Post-interview feedback: Score (1–10) + concise feedback using a fixed format.

Quick Start (Local)

  1. Clone the repository and move into it.

  2. Create and activate a Python 3.10+ environment.

  3. Set your OpenAI key.

    Windows (PowerShell):

    setx OPENAI_API_KEY "sk-your-key"

    macOS/Linux (bash/zsh):

    export OPENAI_API_KEY="sk-your-key"
  4. Install dependencies:

    pip install -r requirements.txt
  5. Run the app:

    python -m streamlit run app.py

The app reads OPENAI_API_KEY from env vars locally. In Streamlit Cloud, set it under Advanced settings → Secrets.


Deployment (Streamlit Community Cloud)

  1. Push this repo to public GitHub (required by Community Cloud).
  2. Go to share.streamlit.ioNew app.
  3. Select your repo, branch (main), and file path (app.py).
  4. Under Advanced settings → Secrets, add your OpenAI key in TOML format:
    OPENAI_API_KEY = "sk-your-key"
  5. Deploy. The app will build and provide a shareable URL.

Live Demo

The app is deployed on Streamlit Community Cloud and available here:
👉 Streamlit Interview Simulator


Demo Screenshots

Setup Screen
Candidate provides personal details, experience, skills, and selects target role/company.

Setup screen

Interview in Action
The candidate introduces themselves, the interviewer responds with a contextual question,
and the red Stop button is visible for early-stop control.

Interview demo


Usage Notes (UX)

  • The flow is: Setup → Interview → Stop/Complete → Feedback.
  • Stop:
    • Click Stop (top-right) or press ESC to halt generation.
    • If Stop is pressed before the first user message, the interview ends and no Feedback option appears.
    • If Stop is pressed mid-answer, streaming stops and the session is marked complete.
  • Limits: The interview accepts up to 5 user messages in total.

Configuration & Secrets

  • Local: environment variable OPENAI_API_KEY.
  • Streamlit Cloud: set OPENAI_API_KEY under Advanced settings → Secrets.
  • The app fails fast with a clear error if the key is missing.

Tech Stack

  • Frontend: Streamlit
  • LLM: OpenAI Chat Completions API
  • Language: Python 3.10+
  • State: st.session_state (single-file prototype)

Project Structure

streamlit-interview-simulator/
├─ .github/
│  └─ workflows/
│     └─ ci.yml                       # GitHub Actions workflow (CI)
├─ .idea/                              # IDE config (PyCharm)
├─ assets/
│  ├─ demo_conversation.png           # 1378×1003 conversation view (README demo)
│  ├─ demo_setup.png                  # 877×1134 setup view (README demo)
│  └─ interview_social.png            # 1280×640 conversation view (GitHub/LinkedIn social preview)
├─ tests/                               # Smoke tests
│  └─ test_import.py
├─ .gitignore                           # Keeps secrets & caches out of version control
├─ LICENSE                              # MIT license
├─ README.md                            # Project documentation
├─ app.py                               # Streamlit app (main entrypoint)
└─ requirements.txt                     # Minimal, pinned dependencies


Requirements

Minimal set for fast builds:

streamlit>=1.37
openai>=1.42
streamlit-js-eval>=0.1.7

Add only what you actually import. Keeping this minimal improves reliability and cold-start time.


Known Limitations / Future Considerations

  • This is a lightweight prototype (no database, no authentication).
  • Feedback is model-generated and non-deterministic.
  • If you add embeddings, RAG, or vector search later, update requirements.txt accordingly and document the changes.


Acknowledgments

Originally developed during The AI Engineer Course 2025 (Udemy).
Now actively maintained as a public, open-source project.


License

MIT — see LICENSE

About

Streamlit app that simulates a job interview using OpenAI, with Stop control, early-stop rules, and structured feedback.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages