@open-vibe-ai/stt-sdk
v0.2.0
Published
Voice Typer provider-communication library: one normalized interface for local runtime endpoints and cloud STT APIs.
Maintainers
Readme
@open-vibe-ai/stt-sdk
Voice Typer provider-communication library. One normalized TypeScript interface for local STT runtime endpoints (Faster Whisper, Whisper.cpp) and cloud STT APIs (Deepgram, OpenAI, Groq) — without taking on server lifecycle responsibilities.
This package is the sole public provider contract for the Voice Typer product.
It is independently versioned and published; it never depends on stt-server and
contains no hardware detection, installation, model lifecycle, process supervision,
or inference.
Install
npm install @open-vibe-ai/stt-sdkNode.js >= 18.18 (fetch/WebSocket globals) or any modern browser. The public entry
point uses only standard platform APIs (fetch, WebSocket, FormData, Blob);
no Node-only APIs are required.
Quick start
Local batch transcription (Faster Whisper runtime)
import { FasterWhisperProvider } from "@open-vibe-ai/stt-sdk";
const provider = new FasterWhisperProvider({ baseUrl: "http://127.0.0.1:8000" });
const result = await provider.transcribe({ file, filename: "recording.webm", prompt: "context" });
console.log(result.text); // -> { text: "..." } preserved from the runtimeLocal streaming (protocol v1)
import { FasterWhisperProvider } from "@open-vibe-ai/stt-sdk";
const provider = new FasterWhisperProvider({ baseUrl: "http://127.0.0.1:8000" });
const session = await provider.createStream({
language: "en",
model: "auto",
encoding: "pcm_s16le",
sampleRate: 48000,
channels: 1,
});
session.onEvent = (event) => console.log(event.type, event);
session.sendAudio(pcmBytes); // raw int16 little-endian PCM
await session.stop(); // flushes final, server sends closedCloud (Deepgram) — no server required
import { DeepgramProvider } from "@open-vibe-ai/stt-sdk";
const provider = new DeepgramProvider({ apiKey: process.env.DEEPGRAM_API_KEY! });
const result = await provider.transcribe({ file, filename: "recording.webm" });
const session = await provider.createStream({
language: "en",
model: "nova-2",
encoding: "pcm_s16le",
sampleRate: 16000,
channels: 1,
});From a server-issued runtime descriptor
import { createProvider } from "@open-vibe-ai/stt-sdk";
// descriptor: RuntimeConnectionDescriptor issued by stt-server for a local runtime
const provider = createProvider(descriptor);Public API
- Provider interface —
SttProviderwithid,info,listModels(),transcribe(),createStream(). Local and cloud adapters expose the same contract. - Capabilities —
ProviderInfo/ProviderCapabilitynormalized across adapters. - Runtime descriptors —
RuntimeConnectionDescriptor(versioned, server-issued). - Models —
ModelInfo. - Batch —
BatchTranscriptionRequest,TranscriptionResult,TranscriptionSegment. - Streaming —
StreamConfig,StreamSession,SessionState, and protocol-v1TranscriptEventunion (ready,partial,final,lagging,error,closed). - Timestamps —
TranscriptWordwithstartMs/endMs/probability. - Errors —
SttErrorhierarchy with machinecodeandretryableflags;UnsupportedCapabilityErrormarks explicit adapter seams.
Adapters
| Adapter | Status | Transport |
|---|---|---|
| FasterWhisperProvider | implemented | HTTP batch (POST /v1/audio/transcriptions) + WS stream (WS /v1/audio/stream) |
| DeepgramProvider | implemented (cloud proof) | REST POST /v1/listen + WS wss://api.deepgram.com/v1/listen |
| WhisperCppProvider | seam (typed, not implemented) | — |
| OpenAIProvider | seam (typed, not implemented) | — |
| GroqProvider | seam (typed, not implemented) | — |
Seam adapters are named public entry points. Constructing them succeeds and reports
provider info; transcribe/createStream/listModels throw
UnsupportedCapabilityError so unimplemented behavior is explicit and typed.
Delivery decisions (2026-08-12)
- Package name / versioning:
@open-vibe-ai/stt-sdkv0.1.0, independently versioned with semantic versioning.0.xis initial development; compatibility is preserved within a major version perCONVENTIONS.md. Publishing to a registry requires the@voice-typernpm org and publish credentials (not configured yet). - Cloud proof: Deepgram is the first cloud adapter contract proof. It was
chosen because the Voice Typer protocol already maps Deepgram semantics
(
is_finalfalse/true →partial/final), it offers batch + streaming parallel to the local contract, and it is verifiable with fixtures without a server or credentials. OpenAI and Groq remain typed seams. - Browser/Node compatibility: the public entry point is isomorphic — standard
fetch/WebSocket/FormData/Blobonly. No Node-only APIs insrc/.
Protocol preservation
- Batch: multipart
POST /v1/audio/transcriptionswithfile+ optionalprompt; response{ text }— the OpenDora-compatible contract. - Stream:
WS /v1/audio/stream,start(protocolVersion 1) →ready→ binary PCM →partial/final/lagging/error→stop/abort→closed. Unknown event types and unknown fields are tolerated; events are forwarded toonEvent. - The streaming client buffers audio until the server confirms
ready, exactly like the historical App provider.
Non-goals
- No hardware detection, provider install/update/removal, model download, runtime
start/stop/health supervision, or recommendations (those are
stt-server). - No new provider services or changes to existing runtime endpoints/events.
- No App UX or Server control-plane implementation.
Development
npm install
npm run typecheck
npm test
npm run build
npm run verify:consumer # pack + install into a blank consumer fixture + typecheckReconcile note
Historical contract sources (whisper-vibes/packages/shared,
whisper-vibes/apps/web/src/lib/api.ts, whisper-vibes/apps/web/src/providers/voice-typer-ws-provider.ts,
stt-server/sdk) are legacy duplicates. Their owning repositories must migrate to
consume this published package and remove the duplicated contract source; this
repository does not import from them by path, workspace link, or copy.
