Dependencies
The Speech to Text service connects to standard FlowX infrastructure services that should already be configured in your environment:- Kafka — async job processing for transcription requests from Integration Designer, plus subscription to the AI Providers cache invalidation topic
- S3-compatible storage (MinIO or AWS S3) — audio file retrieval and result storage
- organization-manager — resolves OpenAI credentials and model assignments from the AUDIO capability configured in AI Providers
- OpenAI API key (fallback) — used for local development, MCP usage, or when no tenant context is available on a request
- ffmpeg — required for audio decoding (included in Docker image)
The local Whisper transcription engine runs on-device and does not require any OpenAI credentials. Only cloud transcription (
/transcribe/openai) and TTS (/tts/openai) need credentials, which are resolved from the organization’s AUDIO capability when tenant headers are present on the request.Capabilities
What it can do
- Local transcription: On-device transcription using any Whisper model (
base,small,medium,large,turbo) with automatic language detection - Cloud transcription: OpenAI Whisper API with automatic chunking of long audio into 10-minute segments
- Text-to-speech: OpenAI TTS API with multiple models (
tts-1,tts-1-hd,gpt-4o-mini-tts) and voice options - Segment-level timing: Returns word-level segments with start/end timestamps
- Language detection: Automatic source language detection with confidence probabilities
- Long audio support: Kafka-based async processing for files over 15 minutes
Supported audio formats
API endpoints
All endpoints are prefixed with theURL_PREFIX value (default: /speech-to-text).
Configuration
Server configuration
Whisper model configuration
The primary source for OpenAI credentials and the transcription model is the AUDIO capability configured under Organization Settings → AI Settings → Defaults & Fallbacks. The env vars above are used only when tenant context is missing or AUDIO is not configured for the organization. See AI providers and model configuration.
Text-to-speech configuration
TTS is configured per-request via the API. Available options:The
gpt-4o-mini-tts model supports additional voices: ballad, verse, marin, cedar.Tenant context
The Speech to Text service resolves OpenAI credentials per organization via thellm-config library. To route a request to the correct organization’s AUDIO capability, the caller must propagate tenant context.
REST requests
Integration Designer and other upstream services must include these headers on every call to/transcribe/openai and /tts/openai:
The
TenantContextMiddleware reads these headers and sets the tenant context for the duration of the request. When neither header is present, the service falls back to the OPENAI_API_KEY env var.
Kafka jobs
Transcription requests published toai.flowx.ai-platform.speech-to-text.job.request.v1 must include organizationId and workspaceId fields in the payload. The job consumer reads these fields and sets the tenant context before invoking the transcription resolver.
Cache invalidation for AI provider configuration changes is delivered via Kafka. The service subscribes to
ai.flowx.llm.config.changed.v1 automatically on startup — no manual topic creation is required for invalidation, but the topic must exist in the cluster.Kafka configuration (optional)
The Speech to Text service supports Kafka for async job processing of long-running audio files (15+ minutes) that would timeout via REST. The request, response, and DLQ topics are declared in the standard FlowX Kafka topics values (kafka-topics.yaml.gotmpl) and are provisioned automatically with the standard deployment.
If you run a non-standard Kafka setup that does not use the FlowX-managed topic provisioning, create the request and response topics manually before enabling the consumer.
Core Kafka settings
Topic configuration
The Speech to Text service uses the FlowX async job-processing library (
flx-job-lib). On startup, the service verifies Kafka connectivity and starts a background consumer.Storage configuration (MinIO / S3)
The Speech to Text service reads audio files from and writes results to S3-compatible storage.Observability (optional)
FLEURS evaluation (optional)
The service can optionally download Google FLEURS datasets at startup for language evaluation and benchmarking.FLEURS datasets are used for evaluating transcription accuracy across languages. This is not required for production use — skip this configuration unless you are benchmarking transcription quality.
Kafka job processing
The Speech to Text service processes transcription requests asynchronously via Kafka. Integration Designer sends requests to the job request topic, and the service writes results to S3 and responds through the job response topic.Request payload
Response flow
- Integration Designer publishes a transcription request to
ai.flowx.ai-platform.speech-to-text.job.request.v1 - Speech to Text downloads the audio file from S3, transcribes it, and stores the result in S3
- Speech to Text publishes a response with the result path to
ai.flowx.ai-platform.speech-to-text.job.response.v1 - Integration Designer retrieves the result (text, language, segments with timestamps) from S3
Deployment and sizing
Docker
- Base image: Python 3.13
- Port:
8080 - Health check:
/speech-to-text/api/v1/speech-to-text/info/health - Requires ffmpeg (included in Docker image)
Kubernetes configuration
- Turbo model (recommended)
- Large model (high accuracy)
Verify your setup
The Speech to Text pod is running:
kubectl get pods -l app=speech-to-textThe health endpoint returns HTTP 200:
curl http://speech-to-text:8080/api/v1/speech-to-text/info/healthWhisper model loaded successfully — check pod logs for model initialization messages at startup
Kafka consumer is connected — check pod logs for
Kafka consumer started message at startupIntegration Designer can reach the service — verify
FLOWX_SPEECHTOTEXT_BASEURL is set in Integration Designer setupTroubleshooting
Pod fails to start or crashes
Pod fails to start or crashes
Symptoms: Pod stays in CrashLoopBackOff or never becomes ready.Solutions:
- Check that memory limits are sufficient for the configured Whisper model
- Verify ffmpeg is available (included in Docker image, may need manual install for local dev)
- Review pod logs for model download or loading errors
- Ensure the S3/MinIO endpoint is reachable if Kafka consumer is enabled
Transcription jobs not being processed
Transcription jobs not being processed
Symptoms: Integration Designer sends transcription requests but no results are returned.Solutions:
- Verify
KAFKA_CONSUMER_ENABLEDis set to1 - Check that
KAFKA_JOB_REQUEST_TOPICmatches the topic Integration Designer publishes to - Ensure the Kafka consumer group (
KAFKA_CONSUMER_GROUPID) has no conflicting consumers - Review pod logs for Kafka connection or authentication errors
Transcription quality is poor
Transcription quality is poor
Symptoms: Transcription text is inaccurate or contains many errors.Solutions:
- Upgrade to a larger Whisper model (
turboorlargeinstead ofbase) - Check audio quality — low bitrate or noisy recordings reduce accuracy
- For non-English audio, use the
largemodel which has better multilingual support - Try the OpenAI Whisper API (
provider: openai) for comparison
Consumer rebalancing during long transcriptions
Consumer rebalancing during long transcriptions
Symptoms: Kafka consumer drops out mid-transcription, causing job failures.Solutions:
- Increase
KAFKA_MAX_POLL_INTERVAL_MSbeyond the expected transcription time - For very long audio files (30+ minutes), set to
1800000(30 minutes) - Consider splitting long audio files before submitting
OOM kills with large Whisper models
OOM kills with large Whisper models
Symptoms: Pods restart with OOMKilled status.Solutions:
- Reduce
GUNICORN_WORKERSto1— each worker loads its own model copy - Increase memory limits (4 Gi minimum for
turbo, 8 Gi forlarge) - Use a smaller model (
smallorbase) if accuracy requirements allow - Scale horizontally with more single-worker pods
OpenAI API errors
OpenAI API errors
Symptoms: Cloud transcription or TTS requests fail with API errors.Solutions:
- Confirm the request includes
Fx-Organization-Id(REST) ororganizationId(Kafka). Without tenant context, the service falls back toOPENAI_API_KEY, which may not be set in production deployments. - Verify the organization’s AUDIO capability is configured under Organization Settings → AI Settings → Defaults & Fallbacks. Pod logs show
no AUDIO capability configured for org, falling back to envwhen missing. - If falling back to env, verify
OPENAI_API_KEYis set and valid. - Check API rate limits on your OpenAI account.
- For large files, the service automatically chunks audio into 10-minute segments — ensure network is stable.
- Review pod logs for specific API error messages.
AI Providers cache not refreshing
AI Providers cache not refreshing
Symptoms: Organization admin updates the AUDIO model in Defaults & Fallbacks, but the service continues to use the previous model.Solutions:
- Verify the Kafka topic
ai.flowx.llm.config.changed.v1exists in the cluster and the service has consumer permissions. - Check pod logs at startup for
LLM config resolver initialized. If this line is missing or followed byfalling back to env vars, the resolver did not start — the service is permanently in fallback mode and will not pick up AI Providers changes. - Restart the pods to force a cache refresh if the Kafka topic is unreachable.
Related resources
Integration Designer setup
Configure Integration Designer, which orchestrates Speech to Text jobs
Speech to Text node
Configure the Speech to Text workflow node in Integration Designer
Kafka Authentication
Configure Kafka security and authentication
Web Crawler setup
Configure the Web Crawler service for web page extraction

