Add the circuitforge_core.video package implementing the cf-video inference
service managed by cf-orch.
Service endpoints:
GET /health — liveness check; model name + VRAM
POST /caption — dense scene description + timestamped event list
POST /find — temporal grounding of a natural-language event query
Backend hierarchy:
VideoBackend (Protocol)
MarlinBackend — NemoStation/Marlin-2B via transformers>=5.7.0
MockVideoBackend — deterministic stub; no GPU required
Pydantic request/response models enforce parameter bounds at the API
boundary (max_new_tokens ge/le, event min_length=1). Span is serialized
as list[float] | None for JSON compatibility.
MarlinBackend loads eagerly in __init__ so cf-orch's 2-second liveness
poll catches load failures immediately. FORCE_QWENVL_VIDEO_READER env var
defaults to torchcodec (faster than av path) before transformers import.
pyproject.toml extras:
video-marlin — torch, transformers, torchcodec, qwen-vl-utils, av, Pillow
video-service — video-marlin + fastapi + uvicorn
Test coverage: 46 tests across test_mock_backend.py and test_app.py.
All passing without GPU or real video file.
Closes: #71
166 lines
3.2 KiB
TOML
166 lines
3.2 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=68"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "circuitforge-core"
|
|
version = "0.21.0"
|
|
description = "Shared scaffold for CircuitForge products (MIT)"
|
|
requires-python = ">=3.11"
|
|
dependencies = [
|
|
"pyyaml>=6.0",
|
|
"requests>=2.31",
|
|
"openai>=1.0",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
community = [
|
|
"psycopg2>=2.9",
|
|
]
|
|
manage = [
|
|
"platformdirs>=4.0",
|
|
"typer[all]>=0.12",
|
|
]
|
|
text-llamacpp = [
|
|
"llama-cpp-python>=0.2.0",
|
|
]
|
|
text-transformers = [
|
|
"torch>=2.0",
|
|
"transformers>=4.40",
|
|
"accelerate>=0.27",
|
|
]
|
|
text-transformers-4bit = [
|
|
"circuitforge-core[text-transformers]",
|
|
"bitsandbytes>=0.43",
|
|
]
|
|
stt-faster-whisper = [
|
|
"faster-whisper>=1.0",
|
|
]
|
|
stt-service = [
|
|
"circuitforge-core[stt-faster-whisper]",
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
"python-multipart>=0.0.9",
|
|
]
|
|
tts-chatterbox = [
|
|
"chatterbox-tts>=0.1",
|
|
"torchaudio>=2.0",
|
|
]
|
|
tts-service = [
|
|
"circuitforge-core[tts-chatterbox]",
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
"python-multipart>=0.0.9",
|
|
]
|
|
musicgen-audiocraft = [
|
|
"audiocraft>=1.3.0",
|
|
"torch>=2.0",
|
|
"torchaudio>=2.0",
|
|
"einops>=0.7",
|
|
"flashy>=0.0.1",
|
|
"num2words>=0.5",
|
|
]
|
|
musicgen-service = [
|
|
"circuitforge-core[musicgen-audiocraft]",
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
"python-multipart>=0.0.9",
|
|
]
|
|
video-marlin = [
|
|
"torch>=2.11",
|
|
"transformers>=5.7.0",
|
|
"torchcodec",
|
|
"qwen-vl-utils>=0.0.14",
|
|
"av",
|
|
"Pillow>=10.0",
|
|
"accelerate>=0.27",
|
|
]
|
|
video-service = [
|
|
"circuitforge-core[video-marlin]",
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
]
|
|
vision-siglip = [
|
|
"torch>=2.0",
|
|
"transformers>=4.40",
|
|
"Pillow>=10.0",
|
|
]
|
|
vision-vlm = [
|
|
"torch>=2.0",
|
|
"transformers>=4.40",
|
|
"Pillow>=10.0",
|
|
"accelerate>=0.27",
|
|
]
|
|
vision-service = [
|
|
"circuitforge-core[vision-siglip]",
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
"python-multipart>=0.0.9",
|
|
]
|
|
reranker-bge = [
|
|
"FlagEmbedding>=1.2",
|
|
]
|
|
reranker-qwen3 = [
|
|
"torch>=2.0",
|
|
"transformers>=4.40",
|
|
"accelerate>=0.27",
|
|
]
|
|
reranker-cross-encoder = [
|
|
"sentence-transformers>=3.0",
|
|
]
|
|
reranker-cohere = [
|
|
"cohere>=5.0",
|
|
]
|
|
reranker-service = [
|
|
"circuitforge-core[reranker-qwen3]",
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
]
|
|
gestures-mediapipe = [
|
|
"mediapipe>=0.10",
|
|
"opencv-python>=4.8",
|
|
"numpy>=1.24",
|
|
]
|
|
pdf = [
|
|
"pdfplumber>=0.11",
|
|
"pytesseract>=0.3",
|
|
"Pillow>=10.0",
|
|
]
|
|
vector = [
|
|
"sqlite-vec>=0.1",
|
|
]
|
|
mqtt = [
|
|
"aiomqtt>=2.0",
|
|
]
|
|
meshtastic-serial = [
|
|
"meshtastic>=2.5",
|
|
"pypubsub>=4.0",
|
|
]
|
|
meshtastic-service = [
|
|
"circuitforge-core[mqtt,meshtastic-serial]",
|
|
"fastapi>=0.110",
|
|
"uvicorn[standard]>=0.29",
|
|
]
|
|
dev = [
|
|
"circuitforge-core[manage]",
|
|
"pytest>=8.0",
|
|
"pytest-asyncio>=0.23",
|
|
"fastapi>=0.110",
|
|
"httpx>=0.27",
|
|
"ruff>=0.4",
|
|
"mypy>=1.10",
|
|
]
|
|
|
|
[project.scripts]
|
|
cf-manage = "circuitforge_core.manage.cli:app"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["."]
|
|
include = ["circuitforge_core*"]
|
|
|
|
[tool.setuptools.package-data]
|
|
"circuitforge_core.community.migrations" = ["*.sql"]
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests"]
|
|
asyncio_mode = "auto"
|