Claude 5e2094f2ad
feat(media): local inference sidecar for Media Studio
FastAPI service in infra/media-worker implementing every
MediaInferenceProvider operation behind HTTP API v1, plus capabilities.
Bearer auth, MEDIA_ROOT realpath enforcement, strict request schemas,
cancellation on disconnect, GPU/CPU gates with 503 overflow, input
size/duration limits, lazy SHA256-pinned model downloads, fail-closed
redaction with atomic output, offline pytest suite with fake backends,
CPU/CUDA/ROCm Dockerfile and a license review of every model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0138YqDj3ttfayRwuMKKrqVj
2026-10-03 18:19:47 +00:00

21 lines
706 B
Python

"""synthesizeIdentity: deliberately unavailable.
No generator + face-swap pipeline with a commercial licence exists that this
sidecar can ship, so the operation always answers 501. The request schema
forbids unknown fields, so a target-face image is rejected before this runs.
"""
from __future__ import annotations
import threading
from typing import Any
from ..errors import Unsupported
from ..schemas import SynthesizeIdentityRequest
from .common import Ctx
def run(ctx: Ctx, _body: SynthesizeIdentityRequest, _cancel: threading.Event) -> dict[str, Any]:
spec = ctx.registry.backend("synthesizeIdentity").spec
raise Unsupported(spec.unavailable_reason or "no commercially licensed model")