## Turn 1

*   `app/main.py`: FastAPI app, registers proxy routes and dashboard pages. (Entry point)
    *   `app/proxy.py`: Handles `/v1/chat/completions`, records metadata, forwards to llama.cpp. (Logic/Proxy)
    *   `app/store.py`: SQLite operations (inserts runs and llm_requests). (Data Persistence)
    *   `app/reports.py`: Aggregates stats from SQLite for dashboard. (Reporting/Read)
    *   `app/redaction.py`: Removes secrets before previews. (Security/Utility)

    *   *Entry Points:*
        *   `/v1/chat/completions` (via `app/proxy.py` registered in `app/main.py`).
        *   Dashboard pages (via `app/reports.py` registered in `app/main.py`).

    *   *Data Flow:*
        1.  User Request $\rightarrow$ `app/main.py` $\rightarrow$ `app/proxy.py`.
        2.  `app/proxy.py` $\rightarrow$ `app/store.py` (save metadata/request).
        3.  `app/proxy.py` $\rightarrow$ Upstream llama.cpp (forward request).
        4.  Upstream llama.cpp $\rightarrow$ `app/proxy.py` $\rightarrow$ User.
        5.  User $\rightarrow$ `app/main.py` $\rightarrow$ `app/reports.py` $\rightarrow$ `app/store.py` (query) $\rightarrow$ `app/redaction.py` (clean) $\rightarrow$ User.

    *   *Risky Modules:*
        *   `app/proxy.py`: Handles external input, forwards to another service (potential for injection or SSRF if not handled correctly, though it's a proxy).
        *   `app/store.py`: SQLite interactions (potential for SQL injection if queries aren't parameterized).
        *   `app/redaction.py`: If redaction fails, secrets are leaked in the dashboard.

    *   `entry_points`: List of endpoints/interfaces.
    *   `data_flow`: Description of how data moves.
    *   `risks`: List of potential vulnerabilities or critical modules.