diff --git a/.env.example b/.env.example index 33f2321..b26c6ea 100644 --- a/.env.example +++ b/.env.example @@ -39,3 +39,6 @@ EXTRACT_MODEL=nemotron-3.5-bolt:e4b # Days to keep photos after a scan is published. IMAGE_RETENTION_DAYS=90 + +# 1 shows the model and how long it took on each scan's page, for comparing models. Every scan's time is logged either way. +# SHOW_SCAN_STATS=0 diff --git a/CHANGELOG.md b/CHANGELOG.md index 96f5ccb..d250e67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and ### Added - A published scan's photo can still be viewed from its scan page, under "Scanned photo", until it's deleted after `IMAGE_RETENTION_DAYS`. +- A log line for every scan with how long it took, the model and what it found. `SHOW_SCAN_STATS=1` also shows the model and time on each scan's page. - Today stands out on the Lunch screen and in the Calendar list: a filled day number like the month view, a "Today" label and a tinted card. ## [0.0.3] - 2026-11-06 diff --git a/docs/SPEC.md b/docs/SPEC.md index 75ee90c..cd806a2 100644 --- a/docs/SPEC.md +++ b/docs/SPEC.md @@ -105,6 +105,7 @@ Both include `python main.py backup `, which runs SQLite's online b | `EXTRACT_IGNORE` | Comma-separated labels dropped from every source's menu items and event titles. Each source can add its own in `ignore_labels` | Not set; for example `BHS,Milk` | | `HOST`, `PORT` | Bind address | `127.0.0.1`, `8000` | | `IMAGE_RETENTION_DAYS` | Days to keep images after publish | `90` | +| `SHOW_SCAN_STATS` | `1` shows the model and processing time on each scan's page. Every scan's time is logged either way | `0` | **Deployment on the home server** diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 56fbfb4..475bebb 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -10,7 +10,7 @@ export interface Source { ignore_labels: string[]; applies_filter: string | null; prompt_notes: string | null; default_calendar_id: number | null; child_ids: number[]; } -export interface Household { timezone: string; children: Child[]; calendars: Calendar[]; sources: Source[] } +export interface Household { timezone: string; show_scan_stats: boolean; children: Child[]; calendars: Calendar[]; sources: Source[] } export interface CalEvent { id: number; uid: string; scan_id: number | null; source_id: number | null; @@ -32,7 +32,7 @@ export interface Scan { id: number; source_id: number; source_name: string; layout_type: Source['layout_type']; hint_month: string; date_start: string | null; date_end: string | null; image_keys: string[]; status: 'queued' | 'parsed' | 'failed' | 'abandoned' | 'reviewed' | 'published'; - error: string | null; seconds: number | null; created_at: string; published_at: string | null; + error: string | null; seconds: number | null; model: string | null; cost_tokens: number | null; created_at: string; published_at: string | null; events: CalEvent[]; menu_items: MenuItem[]; can_undo: boolean; } export interface ScanSummary { diff --git a/frontend/src/routes/ScanPage.svelte b/frontend/src/routes/ScanPage.svelte index e86fead..9b2b897 100644 --- a/frontend/src/routes/ScanPage.svelte +++ b/frontend/src/routes/ScanPage.svelte @@ -1,6 +1,7 @@