OpenAI Whisper speech-to-text via Hot Box containers.

Runs the whisper CLI inside onerahmet/openai-whisper-asr-webservice (or a custom image) to transcribe or translate audio referenced by hot:// URLs. Outputs are written back to Hot storage.

Quick Start

out ::whisper/transcribe("hot://uploads/recording.mp3")
tap(out.text)
tap(out.url)

// With explicit output path
out ::whisper/transcribe("hot://uploads/recording.mp3", {
    model: "small",
    output: "hot://transcripts/recording.json",
})

Container Requirements

Minimum Size small

Values

DEFAULT_IMAGE

DEFAULT_IMAGE: Str "onerahmet/openai-whisper-asr-webservice:v1.9.1"

Functions

build-transcribe-args

fn (input-path: Str, output-dir: Str, opts: TranscribeOpts): Vec<Str>

Build whisper CLI arguments after the whisper executable name.

Example

opts ::whisper/TranscribeOpts({model: "small", language: "en"})
::whisper/build-transcribe-args("/data/in.mp3", "/data/out", opts)  // ["/data/in.mp3", "--model", "small", "--output_format", "json", "--output_dir", "/data/out", "--language", "en"]

parse-transcribe-output

fn (stdout: Any): Map

Parse whisper JSON output (full transcript, segments, detected language).

Example

::whisper/parse-transcribe-output("{\"text\": \"Hello\", \"language\": \"en\"}")  // {text: "Hello", language: "en"}
::whisper/parse-transcribe-output("")  // {}

start-transcribe

fn (input: Str): Map
fn (input: Str, opts: TranscribeOpts): Map

Start a Whisper transcription in a container without waiting for completion.

Returns the box task info from ::hot::box/start. Use ::hot::task/await on the returned id to wait for the result.

Example

info ::whisper/start-transcribe("hot://uploads/voice.mp3", {model: "small", language: "en"})
result ::hot::task/await(info.id)
Container: small

transcribe

fn (input: Str): Map
fn (input: Str, opts: TranscribeOpts): Map

Transcribe (or translate) audio to text using OpenAI Whisper in a container.

Returns {text: Str, language: Str?, segments: Vec?, url: Str}. With format: "json" (default), text is the full transcript, segments holds timed segments, and language is the detected or forced language code. url is the hot:// URL of the output file (same format as requested).

Box size defaults from the model: tiny/base use large, small uses xlarge, medium uses 2xlarge, and large uses 4xlarge.

Example

out ::whisper/transcribe("hot://uploads/voice.mp3")
out ::whisper/transcribe("hot://uploads/voice.mp3", {
    model: "small",
    language: "en",
    format: "json",
})
Container: small

Types

TranscribeOpts

TranscribeOpts type {
    model: Str?,
    language: Str?,
    format: Str?,
    task: Str?,
    temperature: Str?,
    word-timestamps: Bool?,
    initial-prompt: Str?,
    output: Str?,
    image: Str?,
    size: Str?,
    timeout: Int?
}

Options for Whisper transcription.

Fields

  • model — Model size: "tiny", "base", "small", "medium", "large" (default: "base")
  • language — Language code, e.g. "en", "fr" (omit for auto-detect)
  • format — Output file format: "txt", "json", "srt", "vtt" (default: "json")
  • task — "transcribe" or "translate" (default: whisper default / transcribe)
  • temperature — Sampling temperature as string, e.g. "0"
  • output — Output hot:// URL (default: auto-generated)
  • image — Custom Docker image with whisper CLI
  • size — Box size override (default: derived from model)