vllmrealtime

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package vllmrealtime adapts vLLM's realtime transcription WebSocket (/v1/realtime) to the stable OpenRealtime perception interface.

vLLM serves natively streaming recognisers on that route - Voxtral Mini 4B Realtime and Qwen3-ASR among them - by feeding audio into one running generation and returning text deltas as the decoder emits them. The route is append-only: a delta is never withdrawn, so every word it reports is already committed. The adapter therefore reports all text as StableText, and names that as a property of this serving route (decoder-policy commitment) rather than as a claim about the checkpoint.

One adapter is one utterance and one socket. The socket opens on the first frame and closes after Finalize.

Index

Constants

View Source
const (
	// DefaultURL is the realtime route of a local vLLM server. The port is the
	// one the duplex deployment profiles give Voxtral; the room's :8001 stays
	// the start/chunk/finish Qwen service.
	DefaultURL = "ws://127.0.0.1:9101/v1/realtime"
	// DefaultModel is the served model name the deployment profiles use.
	DefaultModel = "voxtral-realtime"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	// contains filtered or unexported fields
}

Adapter owns one realtime transcription socket for one utterance.

func New

func New(config Config) (*Adapter, error)

New validates the configuration without opening a socket.

func (*Adapter) Close

func (adapter *Adapter) Close() error

Close releases the socket of an utterance that never finalized.

func (*Adapter) Descriptor

func (adapter *Adapter) Descriptor() v1.Descriptor

Descriptor implements api/v1.PerceptionProvider.

func (*Adapter) Finalize

func (adapter *Adapter) Finalize(ctx context.Context, sourceSample uint64) (v1.PerceptionRevision, error)

Finalize ends the audio, waits for the decoder to finish the delayed tail, and returns one final revision.

func (*Adapter) PushFrame

func (adapter *Adapter) PushFrame(ctx context.Context, frame v1.AudioFrame) ([]v1.PerceptionRevision, error)

PushFrame resamples a frame to 16 kHz, appends it to the running generation, and returns a revision when the decoder has emitted new text.

type Config

type Config struct {
	URL             string
	Model           string
	BearerToken     string
	Header          http.Header
	HTTPClient      *http.Client
	DialTimeout     time.Duration
	FinalizeTimeout time.Duration
}

Config configures one realtime transcription utterance.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL