# Video Model Gateway — Capability Store & Censorship Pre-Check Service

## PURPOSE
A small internal service that (1) stores the capability matrix of each AI video
model in a SQL database and (2) screens an incoming prompt against the censorship
policy observed in the source video *before* spending credits. In the transcript,
Kling 4.0 rejects prompts naming celebrities (a shot of "Tom Cruise"), fails on
Donald Trump, and blocks famous branded characters such as Mickey Mouse, while
allowing graphic violence but "toning down some of the liquids"; mildly sensual
requests pass. Encoding that policy up front stops teams burning credits on
guaranteed rejections and keeps a searchable record of which model supports what.

## WHY THIS MATTERS
The comparison in the video is as much about *policy* as pixels: Kling 4 is ~70%
cheaper and supports 10 key frames, 30 seconds, 10-bit colour, a 21:9 aspect
ratio, HDR, 8,000-token prompts and German/French/Hindi — but its refusal
behaviour differs from Seedance 2.5's. A gateway that persists capabilities and
applies a pre-flight filter turns scattered marketing claims into a queryable
contract and makes cost/feature decisions auditable.

## HOW TO BUILD
1. `pip install sqlalchemy httpx pydantic fastapi`
2. Define ORM models `Model` and `Capability`, create the SQLite engine, seed the
   rows with values from the transcript.
3. Implement `screen_prompt()` — a deny-list of celebrity/brand terms plus an
   allow-list for mild content, returning `allowed` and `reasons`.
4. Add an `httpx` client method `submit_job()` that posts to the provider and is
   stubbed deterministically in the starter.

```python
def screen_prompt(prompt: str, policy: Policy) -> Decision:
    hits = [t for t in policy.blocked_terms if t.lower() in prompt.lower()]
    if hits:
        return Decision(allowed=False, code="E_CELEBRITY_OR_BRAND", hits=hits)
    if any(t in prompt.lower() for t in policy.sensual_terms):
        return Decision(allowed=True, code="W_MILD", hits=[])
    return Decision(allowed=True, code="OK", hits=[])
```

## WHEN TO USE IN PRODUCTION
Use it as a policy front-end for any team routing prompts to multiple vendors, or
as the durable capability registry that other services query. Do NOT use it as a
guaranteed moderation layer (models update their own filters), and avoid it where
a human reviewer must approve sensitive content regardless of automated rules.

## HOW IT HELPS STUDENTS
Learners practise SQLAlchemy ORM modelling and migrations, seeded reference data,
httpx client design, and translating a fuzzy "what does this model block?"
question into explicit, testable policy code.

## STARTER CODE
`starter/main.py` builds an in-memory SQLite catalog, runs the censorship screen
on sample prompts, and shows a stubbed httpx submit path with `# TODO` markers.
