A Python project skeleton for developing an LLM-powered chatbot.
Status: Foundational setup complete. The actual chatbot implementation is NOT included (per requirements). This provides a clean, typed, tested base ready for adding LLM features (e.g., using OpenAI, LangChain, Gradio UI, etc.).
- Modern Python packaging with
uv(fast, reliable) andpyproject.toml - src/ layout for the
python_chatpackage - Testing:
pytestwith configuration - Type checking:
mypyin strict mode - Placeholder code:
hello_world()function + passing test - Editor support: VS Code settings for pytest + mypy
- Copilot instructions:
.github/copilot-instructions.mdfor consistent AI assistance - Git ready:
.gitignoretailored for Python/uv/mypy
python-chat/
├── .github/
│ └── copilot-instructions.md
├── .vscode/
│ └── settings.json
├── src/
│ └── python_chat/
│ ├── __init__.py
│ ├── hello.py # Placeholder: hello_world()
│ └── py.typed
├── tests/
│ └── test_hello.py
├── .gitignore
├── pyproject.toml
├── README.md
└── uv.lock (after first sync)
- Python >= 3.11
- uv (v0.4+ recommended)
# Clone or cd into the project
cd python-chat
# Create virtualenv + install project + dev dependencies (pytest, mypy)
uv sync --group dev
# Activate the env (uv will suggest or use `uv run`)
# On Windows PowerShell:
. .venv\Scripts\Activate.ps1This creates .venv/ and uv.lock.
# Using uv (recommended, no manual activate needed)
uv run pytest
# Or with activated venv
pytest
# Verbose / specific
uv run pytest -v tests/test_hello.pyAll tests should pass ✅
uv run mypy src
# or simply
uv run mypyShould report no errors with strict mode.
uv run python
>>> from python_chat.hello import hello_world
>>> hello_world()
'Hello World'Or for package:
uv run python -c "from python_chat import hello_world; print(hello_world())"When ready to implement:
- Add runtime dependencies:
uv add openai langchain-core gradio ... - Create modules under
src/python_chat/(e.g.,llm.py,chatbot.py) - Add corresponding tests in
tests/ - Update
copilot-instructions.mdas needed - For Gradio web app (Supabase deploy): add a
examples/app.pyorsrc/python_chat/app.pythat imports your chatbot logic and launchesgr.Interface(...). Useuv run python -m python_chat.appor add[project.scripts].
Never put actual LLM keys or full chatbot code in the initial skeleton.
| Command | Description |
|---|---|
uv sync --group dev |
Install/update all deps + editable |
uv run pytest |
Run the test suite |
uv run mypy |
Strict static type check |
uv run ruff check . |
(Future) Linting |
uv add <pkg> |
Add runtime dependency |
uv add --group dev <pkg> |
Add dev-only tool |
uv run python -m pytest --cov |
(Future) with coverage |
The .vscode/settings.json configures:
- Pytest as default test runner
- Mypy as type checker
- Python interpreter from
.venv - Format on save, etc.
Open the folder in VS Code and select the interpreter from .venv\Scripts\python.exe if prompted.
This project is unlicensed (or add your license here). For personal/educational use in building LLM chatbots.
Generated as part of initial project scaffolding. Happy coding!