fiebatt is a prompt-driven video editor for precise, localized edits. It is built for the moment when you do not want to regenerate an entire video, but you do want to change one object, one action, or one short range inside an existing reel.
The product has three surfaces that all talk to the same API:
- a Next.js web editor for reviewing projects, editing timelines, chatting with the agent, comparing variants, and exporting the final reel
- a FastAPI API that owns uploads, projects, timelines, jobs, generation, scoring, propagation, and exports
- a CLI/agent workflow so Codex, Claude, or shell scripts can drive the same editing loop from the terminal
- Upload or reopen a source video.
- Scrub to the moment you want to change.
- Select a region if the edit should stay localized.
- Describe the edit in plain language.
- fiebatt builds a structured request with the active project, playhead, selected region, timeline state, and conversation history.
- The backend plans the edit, runs vision/localization, generates candidate variants, scores the results, and streams progress back to the UI.
- You compare the original and modified output, accept the best variant, and export the final cut.
The full pipeline is captured as an Excalidraw diagram:
Open the fiebatt technical flow diagram
The diagram covers the end-to-end path from editor or CLI input through project context, qwen planning, CLIP retrieval, SAM2 masking, frame inspection, localized generation, scoring, variant storage, compare, timeline refresh, continuity, and export.
Most AI video tools treat generation as the whole product. fiebatt treats generation as one step inside an editable timeline system.
Current tools usually make you choose between two extremes:
- traditional editors, where every mask, keyframe, export, and re-import is manual
- prompt-to-video tools, where the output is detached from the original timeline and hard to revise precisely
fiebatt sits between those extremes. A prompt is not just text. It is tied to project state, selected frame range, region geometry, previous messages, accepted edits, generated variants, scores, and the final export pipeline.
The web app has a project library for reopening existing reels and starting new edits. Projects keep their source media, generated media, saved timeline state, and accepted changes.
The editor includes:
- source video preview
- timeline and clip controls
- chat-based edit requests
- region selection
- variant preview and apply flow
- compare mode for original versus modified output
- export controls
The chat panel sends messages to /api/agent/chat. Each message includes the active project and editor context, so the backend knows what the user means by “this moment,” “the subject,” or “the selected region.”
Responses stream back as SSE events. The UI can show working states, tool details, generation briefs, variant previews, and final text as the backend progresses.
The agent and text planning path can route through Mesh API, which exposes an
OpenAI-compatible gateway for many models. In that mode fiebatt uses the same
tool-calling loop, but points the OpenAI SDK at Mesh with MESH_API_KEY,
MESH_API_BASE_URL, and MESH_MODEL.
The default Mesh model route is deepseek/deepseek-v3.2 for text reasoning,
prompt rewriting, and tool selection. Vision-heavy payloads can still use the
existing vision provider unless a multimodal Mesh model is configured.
Mesh can also be selected as a video gateway by setting
VIDEO_GEN_PROVIDER=meshapi_veo. That path uses MESH_VIDEO_MODEL
(google/veo-3 by default) and MESH_VIDEO_ENDPOINT, so the exact model ID can
be swapped to whatever Veo 3 route is enabled in the Mesh dashboard.
See meshapi/ for the small routing manifest and setup notes.
VIDEO_GEN_PROVIDER=auto is the default. It routes edits of uploaded footage
to Wan so the model receives the source clip and retains temporal context.
HappyHorse remains available as an explicit source-edit fallback. Google Veo
is available for explicit short image-conditioned generation and accepts only
4, 6, or 8 second requests; first/last-frame and reference-image requests must
be 8 seconds. Set VEO_MODEL=veo-3.1-fast-generate-preview for interactive
previews or select the standard Veo model when quality is more important than
latency.
The vision path can use:
- qwen vision for subject identification and prompt planning
- CLIP-style retrieval for matching frames, crops, or similar appearances
- SAM2 masks for turning a rough selected box into a more precise region
- frame inspection for confidence, category, attributes, and crop context
This is what lets fiebatt keep edits localized instead of blindly changing the full frame.
Generation jobs produce candidate variants for a target edit window. Results are tracked with status, URLs, descriptions, errors, prompt adherence, and visual coherence scores.
Scoring helps decide which outputs are worth showing and which should be rejected or retried.
The editor stores a real EDL-style timeline. When a variant is accepted, the backend creates a generated segment and the frontend refreshes the timeline. Manual timeline changes are also saved back to the backend.
After a generated edit is accepted, fiebatt can search for matching appearances and prepare continuity edits. This helps a localized change feel authored across the reel rather than isolated to one frame range.
Export jobs render the current timeline into a final MP4. The backend handles clip rendering, stitching, fps normalization, and final output URLs.
The CLI wraps the same backend API that powers the web editor. That means an agent that can run shell commands can inspect a project, preview footage, generate edits, score variants, accept a result, propagate continuity, and export the final video without a custom integration.
apps/
web/ Next.js app: landing page, project library, editor UI
api/ FastAPI app, AI adapters, prompts, workers, and tests
vision-worker/ Optional SAM2 and CLIP inference service
cli/ Command-line interface for scripting and agent workflows
docs/
demo-clips/ Demo source clips
images/ Documentation images
internal/ Engineering notes and completed task records
plans/ Architecture plans
product/ Product docs
reference/ API and architecture docs
compose.yaml Local and self-hosted service orchestration
scripts/ Development, maintenance, and smoke-test scripts
storage/ Local development media storage
- Node 20+
- Python 3.11+
- ffmpeg on your PATH
- API dependencies installed in your Python environment
cd apps/web
npm installcd apps/web
npm run devThe Next.js app runs on port 3001 by default.
From the repository root:
./scripts/dev_api.shThe API runs on port 8000 by default.
After installing the web, API, and vision-worker dependencies:
bash scripts/dev_all.shThis starts the web app, API, and vision worker together and writes their
logs to .dev-logs/.
Fiebatt is distributed as a public Codex marketplace plugin backed by the hosted Fiebatt service. Users do not need to install the Python CLI or run the backend locally.
codex plugin marketplace add ASAC44/fiebatt
codex plugin add fiebatt@fiebattStart a new Codex thread after installation, then ask to edit a video or invoke
$fiebatt-edit explicitly. Codex opens the Fiebatt browser sign-in flow when
authentication is required. Generation credentials remain managed by the
service and are never requested from users.
To refresh an existing installation:
codex plugin marketplace upgrade fiebatt
codex plugin add fiebatt@fiebattTo remove it:
codex plugin remove fiebatt
codex plugin marketplace remove fiebattdocker compose up --build api dbIf you want the optional vision-worker profile:
docker compose --profile gpu up --build vision-workerStart with:
cp .env.example .envImportant environment groups:
- database:
DATABASE_URL - auth:
AUTH_JWT_SECRET,AUTH_JWT_EXPIRES_MINUTES - media storage:
S3_BUCKETand standard AWS settings, or local media fallback - AI mode:
USE_AI_STUBS - local edit windows:
ADAPTIVE_EDIT_PLANNING(defaults on; fixed-window fallback stays available) - emergency continuity override:
ALLOW_HARD_FAILED_ACCEPTANCE(keep off during normal rollout) - Mesh API gateway:
MESH_API_KEY,MESH_API_BASE_URL,MESH_MODEL,MESH_VIDEO_MODEL,MESH_VIDEO_ENDPOINT - generation provider:
VIDEO_GEN_PROVIDER,VEO_MODEL,VIDEO_GENERATION_TIMEOUT
The web app uses first-party email/password auth. Create an account at
/signup, then log in at /login; the API stores the session in an HttpOnly
cookie rather than exposing the token to browser JavaScript.
- vision worker:
VISION_WORKER_URLfor tracking and embeddings (GPU_WORKER_URLremains a compatibility fallback) - optional segmentation worker:
SAM_SEGMENTATION_URL - provider keys: Mesh API / qwen / Gemini / DashScope / ElevenLabs keys depending on the path being tested
For a Hugging Face ZeroGPU worker, upload apps/api/vision-worker/hf-space/
as a Gradio Space, select ZeroGPU hardware, and set SAM_SEGMENTATION_URL to
its public https://<owner>-<space>.hf.space URL. Keep VISION_WORKER_URL
pointed at the full worker used for bounded tracking and embeddings.
For quick local development, USE_AI_STUBS=true keeps the pipeline testable without paid providers. For real generation, use USE_AI_STUBS=false and configure the required provider keys. If MESH_API_KEY is present, the agent chat loop prefers Mesh API for text planning and tool calls.
Core endpoints:
GET /api/healthchecks backend livenessGET /api/projectslists projectsPOST /api/uploaduploads a source videoGET /api/projects/{id}loads project stateGET /api/timeline/{id}loads timeline statePUT /api/timeline/{id}saves the editor EDLPOST /api/agent/chatstreams agent chat eventsPOST /api/identifyidentifies a selected regionPOST /api/maskreturns a SAM-style mask contourPOST /api/generatestarts a generation jobGET /api/jobs/{id}checks generation statusGET /api/jobs/{id}/streamstreams job eventsPOST /api/acceptapplies a generated variantGET /api/entities/{id}lists matching appearancesPOST /api/propagatestarts continuity propagationPOST /api/narrategenerates narration audioPOST /api/exportstarts final exportGET /api/export/{id}checks export status
The backend exposes lightweight AI observability routes:
curl http://localhost:8000/api/health
curl http://localhost:8000/api/ai/health
curl "http://localhost:8000/api/ai/timeline?last_n=10"There is also an SSE stream:
const events = new EventSource("http://localhost:8000/api/ai/stream");
events.addEventListener("init", (event) => console.log(JSON.parse(event.data)));
events.onmessage = (event) => console.log(JSON.parse(event.data));Web build:
cd apps/web
npm run buildBackend and AI tests:
PYTHONPATH=apps/api pytest apps/api/tests -qSmoke flow:
./scripts/smoke.shDemo source clips live in:
docs/demo-clips/
These are useful for local testing, docs, and repeatable demos.
- Keep the Next.js app in
apps/web; this is the only supported web app. - Prefer backend API changes that preserve the same editor and CLI flow.
- Keep generated media, debug frames, and scratch files out of the repository unless they are intentional documentation assets.
- If you add a new backend capability, update the Excalidraw flow diagram and this README so the product story stays accurate.