Repository navigation
Description
Summary
The gateway now scores a video on POST /v1/audio/sfx: a multipart/form-data body with a video part returns the sound that fits the clip, with the clip's own speech kept or separated (inference-gateway/inference-gateway#864, spec inference-gateway/schemas#314). The CLI's TextToSFX tool covers text prompts only.
Add a sibling agent tool named after the domain, VideoToSFX, rather than a parameter on TextToSFX: the input, the provider set (Mirelo today) and the privacy profile all differ. It follows the TextToSFX and TextToVideo patterns - the CLI holds no provider key, and the tool is disabled by default because it uploads the user's footage to a third party. While video_to_sfx.enabled is false the definition is not sent to the LLM.
Parameters:
video(required): bare file name of a.mov,.mp4,.m4vor.webmclip, looked up in the working directory, then in theTextToVideooutput directoryprompt(optional): guidance on the sound - the video itself drives the resultsecondsandstart_seconds(optional): the window to score - omitted scores the whole cliptrack(optional):mix(default),sfx(the generated sound alone) orspeech(the clip's dialogue), sent as the gateway'soutputfieldpreserve_speech(optional): keep the clip's dialogue under the generated soundoutput_path(optional): bare file name insidevideo_to_sfx.output_dir- defaults to a timestamped file
Configuration:
video_to_sfx:
enabled: true
# model: mirelo/sfx-2.0
# output_dir: <media root>/sfx
require_approval: false # optional; unset = no approval, like the other media toolsAcceptance Criteria
-
VideoToSFXConfigcarriesenabled,model(defaultmirelo/sfx-2.0),output_dir(defaultMediaDir("sfx")) andrequire_approval, and the tool is registered only whenvideo_to_sfx.enabledis true. - The tool posts
multipart/form-datato/v1/audio/sfxwithmodel,videoand the optionalprompt,duration_seconds,start_offset_seconds,preserve_speechandoutputfields, and saves the audio with the extension matching the responseContent-Type. - The request timeout covers the upload plus the gateway's 150 s job budget, so a long clip is not cut off on the client side.
- A
413names the gateway'sSERVER_MAX_REQUEST_BODY_SIZE, and the gateway's own error message is passed through for other failures (for example a clip without dialogue has nospeechtrack). - An integration test runs against tokenless once [FEATURE] Accept the multipart video form on POST /v1/audio/sfx tokenless#99 lands.
-
docs/tools-reference.mdgains aVideoToSFXrow in the tools table and aVideoToSFX Toolsection.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
[-][FEATURE] Score a video with the sfx command[/-][+][FEATURE] Add a VideoToSFX tool that scores a video through the gateway[/+]inference-gateway-maintainer commentedon Nov 14, 2026
Update from the spec side: inference-gateway/schemas#318 (resolving inference-gateway/schemas#317) folds video-to-sfx into the single
CreateSFXRequestonREST POST /v1/audio/sfx- one JSON body,multipart/form-datais gone. The request gains an optionalvideothat carries either an https URL or a base64data:video/...URI; the video-only fieldsstart_offset_seconds,preserve_speechandoutput(mix,sfx,speech) now sit on the same JSON body, andpromptis required unlessvideois given.Consequences for this issue:
VideoToSFXtool posts a JSON body withvideoset to adata:video/...URI for a local clip (the CLI reads the file and base64-encodes it); there is no multipart form to build.trackparameter still maps to the gateway'soutputfield;seconds/start_secondsstayduration_seconds/start_offset_seconds.SERVER_MAX_REQUEST_BODY_SIZE, and a data URI is about a third larger than the file, so large local clips413- worth surfacing in the tool's error message.edenreich commentedon Nov 15, 2026
@infer can you work on this? use /ponytail:ponytail /go /go-concurrency /domain-driven-design /clean-architecture /clean-code
inference-gateway-maintainer commentedon Nov 15, 2026
Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.8· CLI:v0.261.0· Gateway:v0.66.0· View JobTodos
Pull Request
#1843
✅ Infer Result: Success
All done. The work is complete, pushed, and the PR is ready for review.
Summary
PR #1843 (#1843,
fix/issue-1839, +1625/89) resolves #1839: aVideoToSFXagent tool that scores a video through the gateway'sPOST /v1/audio/sfxmultipart form.What changed:
video_to_sfxblock (enabled,modeldefaulting tomirelo/sfx-2.0,output_dirdefaulting to thesfxmedia shelf,require_approval), validation of the provider/model form,NeedsGatewayAudiojoined, and the tool registered only whenvideo_to_sfx.enabledis true, so the definition is never sent to the LLM while it is off.agentdomain.VideoSoundEffectServicewithInternalport ininternal/agent/domain/media.go; the gateway service ininternal/agent/infrastructure/video_sfx_service.gobuilds themultipart/form-databody itself (the SDK'sCreateSFXposts JSON only and cannot express the video part):modelunprefixed + thevideofile part + optionalprompt,duration_seconds,start_offset_seconds,preserve_speech,output, with?provider=like every other gateway call,Authorization: Bearerand the propagation transport injected via a newGatewayEndpointwired by the container (URL resolution factored into onegatewayBaseURLhelper).413namesSERVER_MAX_REQUEST_BODY_SIZE; other failures pass the gateway's own error message through (string or nested envelope); the saved file's extension follows the responseContent-Type.VideoToSFXmanifest (videorequired;prompt,secondsat least 1,start_seconds,trackmix/sfx/speech,preserve_speech,output_path), clip lookup through the shared media-input rule (working directory, then the TextToVideo output directory), output confined tovideo_to_sfx.output_dir, registry gating tests mirroring the other media tools.go test ./...andtask lintpass, golden regen at 51 built-ins).docs/tools-reference.mdgains the table row and aVideoToSFX Toolsection,docs/configuration-reference.mdthe config block plusINFER_VIDEO_TO_SFX_*env mirrors,cspell.yamlthe provider name.Board and follow-ups: issue added to Roadmap 2026 and moved to QA; the SDK was bumped to v1.46.0 as a separate deps commit; [DOCS] ticket filed for the API/tool documentation (inference-gateway/docs#1218). The integration test can move from the in-test layer to tokenless scenarios once inference-gateway/tokenless#99 releases multipart acceptance.
Skipped: a client-side 10 MiB body pre-check (the gateway's configurable limit and its 413 decide, so the error names the knob); not verified end to end against a live gateway with a real Mirelo key - the wire format was taken from the gateway's own PR #864 tests, which is the residual risk.
Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.8· CLI:v0.261.0· Gateway:v0.66.0· Exit Code:0· Duration: 24m 28sTokens: 23,816,687 in · 147,095 out · 23,963,782 total (101 requests)
Tool calls: 223 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Nov 16, 2026
🎉 This issue has been resolved in version 0.262.0 🎉
The release is available on:
Your semantic-release bot 📦🚀