Stack: OpenAI GPT-4o vision → Supabase edge function → Postgres. The prompt does three jobs: extract structured biomarker JSON, explain each in under 60 words, and generate doctor questions tied to abnormal values. Key learnings: temperature 0.2 made explanations robotic and repetitive; 0.4 was the sweet spot. Explicit "never diagnose" rules in the system prompt are non-negotiable for health. Happy to share the actual prompt structure if useful.
How did you manage LLM cost per report ? Also you mean PDF report (not scan) ?
Cost per report is around $0.08-$0.12 depending on report length and complexity. GPT-4o vision is surprisingly efficient, the image token cost is way lower than I expected. We cache the system prompt too which helps. And yeah, both. Started with PDFs but most of our users are uploading images/screenshots of their reports from their phone. Actually works better because the image quality is higher than scanned PDFs a lot of the time. The edge function handles both, we convert PDFs to images first if needed, then send to vision. The real cost saver was dropping down from gp -4 turbo to 4o. Same accuracy, half the price. Temperature tuning also helped, 0.4 kept us consistent without overpaying for higher temps.