@vargai/sdk 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/.env.example +24 -0
  2. package/CLAUDE.md +118 -0
  3. package/HIGGSFIELD_REWRITE_SUMMARY.md +300 -0
  4. package/README.md +231 -0
  5. package/SKILLS.md +157 -0
  6. package/STRUCTURE.md +92 -0
  7. package/TEST_RESULTS.md +122 -0
  8. package/action/captions/SKILL.md +170 -0
  9. package/action/captions/index.ts +169 -0
  10. package/action/edit/SKILL.md +235 -0
  11. package/action/edit/index.ts +437 -0
  12. package/action/image/SKILL.md +140 -0
  13. package/action/image/index.ts +105 -0
  14. package/action/sync/SKILL.md +136 -0
  15. package/action/sync/index.ts +145 -0
  16. package/action/transcribe/SKILL.md +179 -0
  17. package/action/transcribe/index.ts +210 -0
  18. package/action/video/SKILL.md +116 -0
  19. package/action/video/index.ts +125 -0
  20. package/action/voice/SKILL.md +125 -0
  21. package/action/voice/index.ts +136 -0
  22. package/biome.json +33 -0
  23. package/bun.lock +842 -0
  24. package/cli/commands/find.ts +58 -0
  25. package/cli/commands/help.ts +70 -0
  26. package/cli/commands/list.ts +49 -0
  27. package/cli/commands/run.ts +237 -0
  28. package/cli/commands/which.ts +66 -0
  29. package/cli/discover.ts +66 -0
  30. package/cli/index.ts +33 -0
  31. package/cli/runner.ts +65 -0
  32. package/cli/types.ts +49 -0
  33. package/cli/ui.ts +185 -0
  34. package/index.ts +75 -0
  35. package/lib/README.md +144 -0
  36. package/lib/ai-sdk/fal.ts +106 -0
  37. package/lib/ai-sdk/replicate.ts +107 -0
  38. package/lib/elevenlabs.ts +382 -0
  39. package/lib/fal.ts +467 -0
  40. package/lib/ffmpeg.ts +467 -0
  41. package/lib/fireworks.ts +235 -0
  42. package/lib/groq.ts +246 -0
  43. package/lib/higgsfield/MIGRATION.md +308 -0
  44. package/lib/higgsfield/README.md +273 -0
  45. package/lib/higgsfield/example.ts +228 -0
  46. package/lib/higgsfield/index.ts +241 -0
  47. package/lib/higgsfield/soul.ts +262 -0
  48. package/lib/higgsfield.ts +176 -0
  49. package/lib/remotion/SKILL.md +823 -0
  50. package/lib/remotion/cli.ts +115 -0
  51. package/lib/remotion/functions.ts +283 -0
  52. package/lib/remotion/index.ts +19 -0
  53. package/lib/remotion/templates.ts +73 -0
  54. package/lib/replicate.ts +304 -0
  55. package/output.txt +1 -0
  56. package/package.json +42 -0
  57. package/pipeline/cookbooks/SKILL.md +285 -0
  58. package/pipeline/cookbooks/remotion-video.md +585 -0
  59. package/pipeline/cookbooks/round-video-character.md +337 -0
  60. package/pipeline/cookbooks/talking-character.md +59 -0
  61. package/scripts/produce-menopause-campaign.sh +202 -0
  62. package/service/music/SKILL.md +229 -0
  63. package/service/music/index.ts +296 -0
  64. package/test-import.ts +7 -0
  65. package/test-services.ts +97 -0
  66. package/tsconfig.json +29 -0
  67. package/utilities/s3.ts +147 -0
@@ -0,0 +1,140 @@
1
+ ---
2
+ name: image-generation
3
+ description: generate ai images using fal (flux models) or higgsfield soul characters. use when user wants to create images, headshots, character portraits, or needs image generation with specific models.
4
+ allowed-tools: Read, Bash
5
+ ---
6
+
7
+ # image generation
8
+
9
+ generate ai images using multiple providers with automatic s3 upload support.
10
+
11
+ ## providers
12
+
13
+ ### fal (flux models)
14
+ - high quality image generation
15
+ - supports flux-pro, flux-dev, and other flux models
16
+ - configurable model selection
17
+ - automatic image opening on generation
18
+
19
+ ### higgsfield soul
20
+ - character headshot generation
21
+ - consistent character style
22
+ - professional portrait quality
23
+ - custom style references
24
+
25
+ ## usage
26
+
27
+ ### generate with fal
28
+ ```bash
29
+ bun run service/image.ts fal "a beautiful sunset over mountains" [model] [upload]
30
+ ```
31
+
32
+ **parameters:**
33
+ - `prompt` (required): text description of the image
34
+ - `model` (optional): fal model to use (default: flux-pro)
35
+ - `upload` (optional): "true" to upload to s3
36
+
37
+ **example:**
38
+ ```bash
39
+ bun run service/image.ts fal "professional headshot, studio lighting" true
40
+ ```
41
+
42
+ ### generate with soul
43
+ ```bash
44
+ bun run service/image.ts soul "friendly person smiling" [styleId] [upload]
45
+ ```
46
+
47
+ **parameters:**
48
+ - `prompt` (required): character description
49
+ - `styleId` (optional): custom higgsfield style reference
50
+ - `upload` (optional): "true" to upload to s3
51
+
52
+ **example:**
53
+ ```bash
54
+ bun run service/image.ts soul "professional business woman" true
55
+ ```
56
+
57
+ ## as library
58
+
59
+ ```typescript
60
+ import { generateWithFal, generateWithSoul } from "./service/image"
61
+
62
+ // fal generation
63
+ const falResult = await generateWithFal("sunset over ocean", {
64
+ model: "fal-ai/flux-pro/v1.1",
65
+ upload: true
66
+ })
67
+ console.log(falResult.imageUrl)
68
+ console.log(falResult.uploaded) // s3 url if upload=true
69
+
70
+ // soul generation
71
+ const soulResult = await generateWithSoul("friendly character", {
72
+ upload: true
73
+ })
74
+ console.log(soulResult.imageUrl)
75
+ ```
76
+
77
+ ## output
78
+
79
+ returns `ImageGenerationResult`:
80
+ ```typescript
81
+ {
82
+ imageUrl: string, // direct image url
83
+ uploaded?: string // s3 url if upload requested
84
+ }
85
+ ```
86
+
87
+ ## when to use
88
+
89
+ use this skill when:
90
+ - generating images from text descriptions
91
+ - creating character headshots or portraits
92
+ - need consistent character style (use soul)
93
+ - need high quality photorealistic images (use fal)
94
+ - preparing images for video generation pipeline
95
+
96
+ ## nsfw filtering and content moderation
97
+
98
+ fal.ai has content safety filters that may flag images as nsfw:
99
+
100
+ **common triggers:**
101
+ - prompts mentioning "athletic wear", "fitted sportswear", "gym clothes"
102
+ - certain body descriptions even when clothed
103
+ - prompts that could be interpreted as revealing clothing
104
+
105
+ **symptoms:**
106
+ - image generation returns but file is empty (often 7.6KB)
107
+ - no error message, just an unusable file
108
+ - happens inconsistently across similar prompts
109
+
110
+ **solutions:**
111
+ - specify modest, full-coverage clothing explicitly:
112
+ - ✅ "long sleeve athletic top and full length leggings"
113
+ - ✅ "fully covered in modest workout attire"
114
+ - ❌ "athletic wear" (too vague, may trigger filter)
115
+ - ❌ "fitted sportswear" (may trigger filter)
116
+ - add "professional", "modest", "appropriate" to descriptions
117
+ - if multiple images in batch get flagged, adjust prompts to be more explicit about coverage
118
+ - always check output file sizes - empty files (< 10KB) indicate nsfw filtering
119
+
120
+ **example:**
121
+ ```bash
122
+ # ❌ may get flagged as nsfw
123
+ bun run service/image.ts fal "woman in athletic wear"
124
+
125
+ # ✅ less likely to trigger filter
126
+ bun run service/image.ts fal "woman wearing long sleeve athletic top and full length leggings"
127
+ ```
128
+
129
+ ## environment variables
130
+
131
+ required:
132
+ - `FAL_API_KEY` - for fal image generation
133
+ - `HIGGSFIELD_API_KEY` - for soul character generation
134
+ - `HIGGSFIELD_SECRET` - for higgsfield authentication
135
+
136
+ optional (for s3 upload):
137
+ - `CLOUDFLARE_R2_API_URL`
138
+ - `CLOUDFLARE_ACCESS_KEY_ID`
139
+ - `CLOUDFLARE_ACCESS_SECRET`
140
+ - `CLOUDFLARE_R2_BUCKET`
@@ -0,0 +1,105 @@
1
+ #!/usr/bin/env bun
2
+ /**
3
+ * image generation service combining fal and higgsfield
4
+ * usage: bun run service/image.ts <command> <args>
5
+ */
6
+
7
+ import type { ActionMeta } from "../../cli/types";
8
+ import { generateImage } from "../../lib/fal";
9
+ import { generateSoul } from "../../lib/higgsfield";
10
+ import { uploadFromUrl } from "../../utilities/s3";
11
+
12
+ export const meta: ActionMeta = {
13
+ name: "image",
14
+ type: "action",
15
+ description: "generate image from text",
16
+ inputType: "text",
17
+ outputType: "image",
18
+ schema: {
19
+ input: {
20
+ type: "object",
21
+ required: ["prompt"],
22
+ properties: {
23
+ prompt: { type: "string", description: "what to generate" },
24
+ size: {
25
+ type: "string",
26
+ enum: [
27
+ "square_hd",
28
+ "landscape_4_3",
29
+ "portrait_4_3",
30
+ "landscape_16_9",
31
+ ],
32
+ default: "landscape_4_3",
33
+ description: "image size/aspect",
34
+ },
35
+ },
36
+ },
37
+ output: { type: "string", format: "file-path", description: "image path" },
38
+ },
39
+ async run(options) {
40
+ const { prompt, size } = options as { prompt: string; size?: string };
41
+ return generateWithFal(prompt, { model: size });
42
+ },
43
+ };
44
+
45
+ export interface ImageGenerationResult {
46
+ imageUrl: string;
47
+ uploaded?: string;
48
+ }
49
+
50
+ export async function generateWithFal(
51
+ prompt: string,
52
+ options: { model?: string; upload?: boolean } = {},
53
+ ): Promise<ImageGenerationResult> {
54
+ console.log("[service/image] generating with fal");
55
+
56
+ const result = await generateImage({ prompt, model: options.model });
57
+
58
+ const imageUrl = result.data?.images?.[0]?.url;
59
+ if (!imageUrl) {
60
+ throw new Error("no image url in result");
61
+ }
62
+
63
+ let uploaded: string | undefined;
64
+ if (options.upload) {
65
+ const timestamp = Date.now();
66
+ const objectKey = `images/fal/${timestamp}.png`;
67
+ uploaded = await uploadFromUrl(imageUrl, objectKey);
68
+ console.log(`[service/image] uploaded to ${uploaded}`);
69
+ }
70
+
71
+ return { imageUrl, uploaded };
72
+ }
73
+
74
+ export async function generateWithSoul(
75
+ prompt: string,
76
+ options: { styleId?: string; upload?: boolean } = {},
77
+ ): Promise<ImageGenerationResult> {
78
+ console.log("[service/image] generating with higgsfield soul");
79
+
80
+ const result = await generateSoul({
81
+ prompt,
82
+ styleId: options.styleId,
83
+ });
84
+
85
+ const imageUrl = result.jobs?.[0]?.results?.raw?.url;
86
+ if (!imageUrl) {
87
+ throw new Error("no image url in result");
88
+ }
89
+
90
+ let uploaded: string | undefined;
91
+ if (options.upload) {
92
+ const timestamp = Date.now();
93
+ const objectKey = `images/soul/${timestamp}.png`;
94
+ uploaded = await uploadFromUrl(imageUrl, objectKey);
95
+ console.log(`[service/image] uploaded to ${uploaded}`);
96
+ }
97
+
98
+ return { imageUrl, uploaded };
99
+ }
100
+
101
+ // cli
102
+ if (import.meta.main) {
103
+ const { runCli } = await import("../../cli/runner");
104
+ runCli(meta);
105
+ }
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: video-lipsync
3
+ description: sync video with audio using wav2lip ai model or simple audio overlay. use when creating talking videos, matching lip movements to audio, or combining video with voiceovers.
4
+ allowed-tools: Read, Bash
5
+ ---
6
+
7
+ # video lipsync
8
+
9
+ sync video with audio using ai-powered lipsync or simple overlay.
10
+
11
+ ## methods
12
+
13
+ ### wav2lip (ai-powered)
14
+ - uses replicate wav2lip model
15
+ - matches lip movements to audio
16
+ - works with url inputs
17
+ - processing time: 30-60 seconds
18
+ - best for: talking character videos
19
+
20
+ ### overlay (simple)
21
+ - adds audio track to video using ffmpeg
22
+ - no lip movement matching
23
+ - works with local files
24
+ - processing time: instant
25
+ - best for: background music, voiceovers
26
+
27
+ ## usage
28
+
29
+ ### sync with method selection
30
+ ```bash
31
+ bun run service/sync.ts sync <videoUrl> <audioUrl> [method] [output]
32
+ ```
33
+
34
+ **parameters:**
35
+ - `videoUrl` (required): video file path or url
36
+ - `audioUrl` (required): audio file path or url
37
+ - `method` (optional): "wav2lip" or "overlay" (default: overlay)
38
+ - `output` (optional): output path (default: output-synced.mp4)
39
+
40
+ **example:**
41
+ ```bash
42
+ bun run service/sync.ts sync video.mp4 audio.mp3 overlay output.mp4
43
+ ```
44
+
45
+ ### wav2lip direct
46
+ ```bash
47
+ bun run service/sync.ts wav2lip <videoUrl> <audioUrl>
48
+ ```
49
+
50
+ **example:**
51
+ ```bash
52
+ bun run service/sync.ts wav2lip https://example.com/character.mp4 https://example.com/voice.mp3
53
+ ```
54
+
55
+ ### overlay direct
56
+ ```bash
57
+ bun run service/sync.ts overlay <videoPath> <audioPath> [output]
58
+ ```
59
+
60
+ **example:**
61
+ ```bash
62
+ bun run service/sync.ts overlay character.mp4 narration.mp3 final.mp4
63
+ ```
64
+
65
+ ## as library
66
+
67
+ ```typescript
68
+ import { lipsync, lipsyncWav2Lip, lipsyncOverlay } from "./service/sync"
69
+
70
+ // flexible sync
71
+ const result = await lipsync({
72
+ videoUrl: "video.mp4",
73
+ audioUrl: "audio.mp3",
74
+ method: "wav2lip",
75
+ output: "synced.mp4"
76
+ })
77
+
78
+ // wav2lip specific
79
+ const lipsynced = await lipsyncWav2Lip({
80
+ videoUrl: "https://example.com/video.mp4",
81
+ audioUrl: "https://example.com/audio.mp3"
82
+ })
83
+
84
+ // overlay specific
85
+ const overlayed = await lipsyncOverlay(
86
+ "video.mp4",
87
+ "audio.mp3",
88
+ "output.mp4"
89
+ )
90
+ ```
91
+
92
+ ## when to use each method
93
+
94
+ ### use wav2lip when:
95
+ - creating talking character videos
96
+ - lip movements must match speech
97
+ - have urls for video and audio
98
+ - quality is more important than speed
99
+
100
+ ### use overlay when:
101
+ - adding background music
102
+ - audio doesn't require lip sync
103
+ - working with local files
104
+ - need instant processing
105
+
106
+ ## typical workflow
107
+
108
+ 1. generate character image (image service)
109
+ 2. animate character (video service)
110
+ 3. generate voiceover (voice service)
111
+ 4. sync with wav2lip (this service)
112
+ 5. add captions (captions service)
113
+
114
+ ## tips
115
+
116
+ **for wav2lip:**
117
+ - use close-up character shots for best results
118
+ - ensure audio is clear and well-paced
119
+ - video should show face clearly
120
+ - works best with 5-10 second clips
121
+
122
+ **for overlay:**
123
+ - match audio length to video length
124
+ - ffmpeg will loop short audio or trim long audio
125
+ - preserves original video quality
126
+
127
+ ## environment variables
128
+
129
+ required (for wav2lip):
130
+ - `REPLICATE_API_TOKEN` - for wav2lip model
131
+
132
+ no special requirements for overlay method (ffmpeg must be installed)
133
+
134
+ ## error handling
135
+
136
+ if wav2lip fails, the service automatically falls back to overlay method with a warning message.
@@ -0,0 +1,145 @@
1
+ #!/usr/bin/env bun
2
+
3
+ /**
4
+ * lipsync service - combines video with audio using various methods
5
+ * supports wav2lip, synclabs, and simple audio overlay
6
+ */
7
+
8
+ import type { ActionMeta } from "../../cli/types";
9
+ import { addAudio } from "../../lib/ffmpeg";
10
+ import { runModel } from "../../lib/replicate";
11
+
12
+ export const meta: ActionMeta = {
13
+ name: "sync",
14
+ type: "action",
15
+ description: "sync audio to video (lipsync)",
16
+ inputType: "video+audio",
17
+ outputType: "video",
18
+ schema: {
19
+ input: {
20
+ type: "object",
21
+ required: ["video", "audio"],
22
+ properties: {
23
+ video: {
24
+ type: "string",
25
+ format: "file-path",
26
+ description: "input video file or url",
27
+ },
28
+ audio: {
29
+ type: "string",
30
+ format: "file-path",
31
+ description: "audio file or url to sync",
32
+ },
33
+ method: {
34
+ type: "string",
35
+ enum: ["wav2lip", "overlay"],
36
+ default: "overlay",
37
+ description: "sync method (wav2lip requires urls)",
38
+ },
39
+ output: {
40
+ type: "string",
41
+ format: "file-path",
42
+ description: "output video path",
43
+ },
44
+ },
45
+ },
46
+ output: { type: "string", format: "file-path", description: "video path" },
47
+ },
48
+ async run(options) {
49
+ const { video, audio, method, output } = options as {
50
+ video: string;
51
+ audio: string;
52
+ method?: "wav2lip" | "overlay";
53
+ output?: string;
54
+ };
55
+ return lipsync({ videoUrl: video, audioUrl: audio, method, output });
56
+ },
57
+ };
58
+
59
+ // types
60
+ export interface LipsyncOptions {
61
+ videoUrl: string;
62
+ audioUrl: string;
63
+ method?: "wav2lip" | "synclabs" | "overlay";
64
+ output?: string;
65
+ }
66
+
67
+ export interface Wav2LipOptions {
68
+ videoUrl: string;
69
+ audioUrl: string;
70
+ }
71
+
72
+ // core functions
73
+ export async function lipsync(options: LipsyncOptions) {
74
+ const { videoUrl, audioUrl, method = "overlay", output } = options;
75
+
76
+ if (!videoUrl || !audioUrl) {
77
+ throw new Error("videoUrl and audioUrl are required");
78
+ }
79
+
80
+ console.log(`[sync] syncing video with audio using ${method}...`);
81
+
82
+ switch (method) {
83
+ case "wav2lip":
84
+ return await lipsyncWav2Lip({ videoUrl, audioUrl });
85
+
86
+ case "synclabs":
87
+ console.log(
88
+ `[sync] synclabs not yet implemented, falling back to overlay`,
89
+ );
90
+ return await lipsyncOverlay(videoUrl, audioUrl, output);
91
+
92
+ case "overlay":
93
+ return await lipsyncOverlay(videoUrl, audioUrl, output);
94
+
95
+ default:
96
+ throw new Error(`unknown lipsync method: ${method}`);
97
+ }
98
+ }
99
+
100
+ export async function lipsyncWav2Lip(options: Wav2LipOptions) {
101
+ const { videoUrl, audioUrl } = options;
102
+
103
+ console.log(`[sync] using wav2lip model...`);
104
+
105
+ try {
106
+ const output = await runModel("devxpy/cog-wav2lip", {
107
+ face: videoUrl,
108
+ audio: audioUrl,
109
+ });
110
+
111
+ console.log(`[sync] wav2lip completed`);
112
+ return output;
113
+ } catch (error) {
114
+ console.error(`[sync] wav2lip error:`, error);
115
+ throw error;
116
+ }
117
+ }
118
+
119
+ export async function lipsyncOverlay(
120
+ videoPath: string,
121
+ audioPath: string,
122
+ output: string = "output-synced.mp4",
123
+ ) {
124
+ console.log(`[sync] overlaying audio on video...`);
125
+
126
+ try {
127
+ const result = await addAudio({
128
+ videoPath,
129
+ audioPath,
130
+ output,
131
+ });
132
+
133
+ console.log(`[sync] overlay completed`);
134
+ return result;
135
+ } catch (error) {
136
+ console.error(`[sync] overlay error:`, error);
137
+ throw error;
138
+ }
139
+ }
140
+
141
+ // cli
142
+ if (import.meta.main) {
143
+ const { runCli } = await import("../../cli/runner");
144
+ runCli(meta);
145
+ }
@@ -0,0 +1,179 @@
1
+ ---
2
+ name: audio-transcription
3
+ description: transcribe audio to text or subtitles using groq whisper or fireworks with srt/vtt support. use when converting speech to text, generating subtitles, or need word-level timestamps for captions.
4
+ allowed-tools: Read, Bash
5
+ ---
6
+
7
+ # audio transcription
8
+
9
+ convert audio to text or subtitle files using ai transcription.
10
+
11
+ ## providers
12
+
13
+ ### groq (ultra-fast)
14
+ - uses whisper-large-v3
15
+ - fastest transcription (~5-10 seconds)
16
+ - plain text output
17
+ - sentence-level timing
18
+ - best for: quick transcripts, text extraction
19
+
20
+ ### fireworks (word-level)
21
+ - uses whisper-v3
22
+ - word-level timestamps
23
+ - outputs srt or vtt format
24
+ - precise subtitle timing
25
+ - best for: captions, subtitles, timed transcripts
26
+
27
+ ## usage
28
+
29
+ ### basic transcription
30
+ ```bash
31
+ bun run service/transcribe.ts <audioUrl> <provider> [outputPath]
32
+ ```
33
+
34
+ **example:**
35
+ ```bash
36
+ bun run service/transcribe.ts media/audio.mp3 groq
37
+ bun run service/transcribe.ts media/audio.mp3 fireworks output.srt
38
+ ```
39
+
40
+ ### with output format
41
+ ```bash
42
+ bun run lib/fireworks.ts <audioPath> <outputPath>
43
+ ```
44
+
45
+ **example:**
46
+ ```bash
47
+ bun run lib/fireworks.ts media/audio.mp3 output.srt
48
+ ```
49
+
50
+ ## as library
51
+
52
+ ```typescript
53
+ import { transcribe } from "./service/transcribe"
54
+
55
+ // groq transcription
56
+ const groqResult = await transcribe({
57
+ audioUrl: "media/audio.mp3",
58
+ provider: "groq",
59
+ outputFormat: "text"
60
+ })
61
+ console.log(groqResult.text)
62
+
63
+ // fireworks with srt
64
+ const fireworksResult = await transcribe({
65
+ audioUrl: "media/audio.mp3",
66
+ provider: "fireworks",
67
+ outputFormat: "srt",
68
+ outputPath: "subtitles.srt"
69
+ })
70
+ console.log(fireworksResult.text)
71
+ console.log(fireworksResult.outputPath) // subtitles.srt
72
+ ```
73
+
74
+ ## output formats
75
+
76
+ ### text (groq default)
77
+ ```
78
+ This is the transcribed text from the audio file.
79
+ All words in plain text format.
80
+ ```
81
+
82
+ ### srt (subtitle format)
83
+ ```
84
+ 1
85
+ 00:00:00,000 --> 00:00:02,500
86
+ This is the first subtitle
87
+
88
+ 2
89
+ 00:00:02,500 --> 00:00:05,000
90
+ This is the second subtitle
91
+ ```
92
+
93
+ ### vtt (web video text tracks)
94
+ ```
95
+ WEBVTT
96
+
97
+ 00:00:00.000 --> 00:00:02.500
98
+ This is the first subtitle
99
+
100
+ 00:00:02.500 --> 00:00:05.000
101
+ This is the second subtitle
102
+ ```
103
+
104
+ ## when to use
105
+
106
+ use this skill when:
107
+ - converting speech to text
108
+ - generating subtitles for videos
109
+ - creating accessible content
110
+ - need word-level timing for captions
111
+ - extracting dialogue from media
112
+ - preparing transcripts for analysis
113
+
114
+ ## provider comparison
115
+
116
+ | feature | groq | fireworks |
117
+ |---------|------|-----------|
118
+ | speed | ultra-fast (5-10s) | moderate (15-30s) |
119
+ | output | plain text | srt/vtt with timestamps |
120
+ | timing | sentence-level | word-level |
121
+ | use case | quick transcripts | precise subtitles |
122
+
123
+ ## typical workflows
124
+
125
+ ### for captions
126
+ 1. record or generate audio (voice service)
127
+ 2. transcribe with fireworks (this service)
128
+ 3. add captions to video (captions service)
129
+
130
+ ### for transcripts
131
+ 1. extract audio from video
132
+ 2. transcribe with groq (this service)
133
+ 3. use text for analysis or documentation
134
+
135
+ ## tips
136
+
137
+ **provider selection:**
138
+ - use **groq** when you just need the text fast
139
+ - use **fireworks** when you need subtitle files
140
+ - use **fireworks** for captions on social media videos
141
+
142
+ **audio quality:**
143
+ - clear audio transcribes more accurately
144
+ - reduce background noise when possible
145
+ - supports mp3, wav, m4a, and most audio formats
146
+
147
+ **timing accuracy:**
148
+ - fireworks provides word-level timestamps
149
+ - perfect for lip-sync verification
150
+ - great for precise subtitle placement
151
+
152
+ ## integration with other services
153
+
154
+ perfect companion for:
155
+ - **captions service** - auto-generate video subtitles
156
+ - **voice service** - transcribe generated speech
157
+ - **sync service** - verify audio timing
158
+
159
+ ## environment variables
160
+
161
+ required:
162
+ - `GROQ_API_KEY` - for groq provider
163
+ - `FIREWORKS_API_KEY` - for fireworks provider
164
+
165
+ ## processing time
166
+
167
+ - **groq**: 5-10 seconds (any audio length)
168
+ - **fireworks**: 15-30 seconds (depending on audio length)
169
+
170
+ ## supported formats
171
+
172
+ input audio:
173
+ - mp3, wav, m4a, ogg, flac
174
+ - video files (extracts audio automatically)
175
+
176
+ output formats:
177
+ - text (plain text)
178
+ - srt (subtitles)
179
+ - vtt (web video text tracks)