# Repository Guidelines ## Project Structure & Module Organization - `elizabeth/deployment_configs/`: API servers (FastAPI), CLIs, deploy scripts, tests. - `elizabeth/checkpoints/`: model artifacts for Elizabeth (large files, do not commit changes here). - `elizabeth/production/`: production-ready configs/placeholders. - `elizabeth/legacy_workspace/`: legacy tools and docs; includes `requirements.txt` and setup scripts. - `base_models/`, `specialized/`, `archived/`: placeholders or historical code. ## Build, Test, and Development Commands - Serve API (OpenAI-compatible): `python3 elizabeth/deployment_configs/openai_endpoints.py` - HF fallback server: `python3 elizabeth/deployment_configs/serve.py` - Deploy helper: `elizabeth/deployment_configs/deploy_elizabeth.sh deploy|status|test|stop` - CLI (local or via Cloudflare): `elizabeth/deployment_configs/elizabeth_cli_wrapper.sh --chat|--test|--cloudflare` - Tests (ad‑hoc): - `python3 elizabeth/deployment_configs/test_api.py` - `python3 elizabeth/deployment_configs/test_model.py` - `python3 elizabeth/deployment_configs/test_vllm_integration.py` ## Coding Style & Naming Conventions - Python 3.x, 4‑space indent, use type hints and docstrings for public functions. - Naming: files/modules `snake_case.py`, classes `PascalCase`, functions/vars `snake_case`, constants `UPPER_SNAKE`. - Lint/format: prefer `black` and `flake8` (see `legacy_workspace/requirements.txt`). - Logging: use `logging` (no prints in libraries). Keep absolute paths only where necessary; prefer env/config. ## Testing Guidelines - Location: quick scripts under `elizabeth/deployment_configs/test_*.py`. - Start the API before network tests: `python3 elizabeth/deployment_configs/openai_endpoints.py`. - Auth header required: `Authorization: Bearer elizabeth-secret-key-2025` (or set `ELIZABETH_API_KEYS`). - For deterministic output, use `temperature=0.1` and small `max_tokens`. - Optional: `pytest elizabeth/deployment_configs -q` for discovery; assertions are minimal. ## Commit & Pull Request Guidelines - Use Conventional Commits style, scoped by area. Examples: - `feat(deployment): add Cloudflare config bootstrap` - `fix(api): handle invalid Authorization header` - `docs(cli): clarify wrapper usage` - PRs include: clear description, linked issues, sample commands/logs, screenshots when UI-like output applies, and doc updates. - Do not commit large checkpoints or secrets. ## Security & Configuration Tips - Secrets: configure via env (`ELIZABETH_API_KEYS`, `API_KEY`) or `.env.cloudflare` (copy from `.env.cloudflare.example`). - Logs: `elizabeth/deployment_configs/logs/`; redact tokens in examples. - Model paths and GPU settings are hardcoded in some scripts—prefer overrides via env vars in new contributions.