@lssm-tech/integration.provider-voice
Website: https://contractspec.io
Voice, speech, and conversational provider implementations for ContractSpec.
Usage
Import the root entrypoint for the domain surface, or import a concrete implementation from the ./impls/* subpaths.
Compatibility
This package owns the voice implementation slice split out of @lssm-tech/integration.providers-impls. The legacy package continues to re-export these subpaths for existing consumers.
Implementations
GradiumVoiceProvider: Gradium SDK-backed TTS implementation for the configured workspace, with contract metadata covering public REST/WebSocket TTS and STT surfaces.
FalVoiceProvider: official @fal-ai/client-backed Chatterbox TTS implementation with contract metadata covering broader fal media SDK/API/MCP surfaces.
SlngVoiceProvider: API-key fetch implementation for SLNG TTS and STT routes. Route templates are configurable so tenants can target the SLNG provider/model path available to their account.
Secrets are passed explicitly through provider options or secret providers; implementations do not read environment variables directly or serialize secret values.
MistralSttProvider.transcribeMedia accepts encoded audio Blob/byte inputs without requiring guessed sample rates. It supports timestamp granularities, diarization, vocabulary hints, abort signals and bounded deadlines. Provider models and codecs still require deployment qualification.
Untimed basic transcription returns no invented segments. Requests requiring timestamps or diarization reject missing evidence. Mistral language selection cannot be combined with timestamp requests; speaker-count hints are unsupported. Errors omit provider bodies; redirects and automatic POST retries are disabled. Use a pinned model plus approved processing binding for OPA workflows. Captures beyond the provider duration limit require valid audio segmentation.
Vercel AI Gateway transcription
./impls/vercel-gateway-stt exports VercelGatewaySttProvider, using the existing STTProvider contract and AI SDK transcription transport. Configure an explicit model/provider, lazy getApiKey and a host authorize callback. The callback must verify persisted model-specific EU transcription capability, processing approval and separate approval for global Gateway transit; returned reference strings alone are not evidence. Its stable, unexpired decision is checked before credentials, before egress and before releasing the result.
Requests pin EU inference and one provider, require zero data retention/no training, disable SDK retries and reject redirects. Returned routing metadata must prove the approved provider endpoints remained in the EU. Missing proof remains a failure. There is no direct-provider or Mistral fallback. Default media bound is 32 MiB; the total request deadline is at most 180 seconds and response bodies are bounded at 8 MiB.
audio/webm (Opus, as recorded by browser MediaRecorder) is remuxed losslessly into audio/ogg immediately before the Gateway call, because microsoft/mai-transcribe-2 rejects WebM with HTTP 400 and accepts Ogg/Opus. Packets are copied unchanged; the caller's media, digest and authority request are untouched. Malformed or non-Opus WebM fails before egress with STT_MEDIA_REMUX_FAILED; a remux above the media bound fails with STT_MEDIA_LIMIT_EXCEEDED. Other media types are sent as given.
The current SDK path supports timestamped, non-diarized output only. It rejects diarization, speaker counts, word timings and unsupported language/vocabulary overrides before egress. Speaker identities and missing audio duration are never invented. Meeting consumers requiring diarization must remain unavailable until a supported, qualified transport exists.
Official references: Gateway speech to text and regional inference. The documented REST endpoint is /v4/ai/transcription-model with base64 JSON, not an evidenced diarized multipart compatibility route. Regional provider inference does not establish an exclusively regional network path or Gateway processing boundary.
Validation uses the real AI SDK over synthetic mocked HTTP responses; no real audio or provider activation is included (the WebM remux fixture is a 2.5 kB prefix of synthetic text-to-speech). SDK dependencies are ai 7.0.92 and @ai-sdk/gateway 4.0.75 through the workspace AI catalog.