File size: 1,937 Bytes
7a8a5c8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
title: Farient DeckCheck API
emoji: πŸ“Š
colorFrom: blue
colorTo: indigo
sdk: docker
app_port: 8000
pinned: false
short_description: AI-powered brand-compliance review for executive decks.
---

# Farient DeckCheck β€” API

FastAPI backend for the DeckCheck multi-agent audit pipeline.

## Endpoints

- `POST /api/audits` β€” upload a `.pptx`, get a `job_id`
- `GET  /api/audits` β€” list audits
- `GET  /api/audits/{job_id}` β€” poll status
- `GET  /api/audits/{job_id}/events` β€” Server-Sent Events stream
- `GET  /api/audits/{job_id}/slides` β€” slides + findings
- `GET  /api/audits/{job_id}/slides/{n}/image` β€” rendered slide PNG
- `GET  /api/audits/{job_id}/export?fmt=md|json|pdf|pptx` β€” export
- `DELETE /api/audits/{job_id}` β€” cancel + remove
- `GET  /health` β€” liveness probe
- `GET  /health/preflight` β€” environment readiness checks

## Required environment variables (set in Space settings)

| Var | Purpose | Required |
|---|---|---|
| `OPENAI_API_KEY` | OpenAI API access | βœ… |
| `WEB_ORIGINS` | CORS allowlist, comma-separated origins (e.g. your Vercel URL) | βœ… |
| `OPENAI_MODEL_SLIDE` | Per-slide reviewer model (default `gpt-4o-mini`) | optional |
| `OPENAI_MODEL_DECK` | Deck consistency model (default `gpt-4o`) | optional |
| `OPENAI_MODEL_MERGE` | Lead auditor merge model (default `gpt-4o`) | optional |
| `OPENAI_REVIEW_CONCURRENCY` | Per-slide review concurrency (default `2`) | optional |
| `MAX_UPLOAD_MB` | Upload size cap (default `60`) | optional |

## Architecture

Pipeline: **parse β†’ render** (LibreOffice, headless) β†’ **review** (per-slide
single-shot `gpt-4o-mini` with deterministic safety-net injection) β†’
**deck consistency** (`gpt-4o`) β†’ **lead auditor merge** (`gpt-4o`) β†’ **finalize**.

Realtime UX via SSE. Job state persists at `/tmp/audits/{job_id}/` during
the Space's container lifetime.

Frontend: separate Next.js app deployed to Vercel that talks to this API.