Documentation
¶
Index ¶
- Constants
- func FindWhisperBinary() (string, error)
- func SetSubprocessPriorityLowered(bool)
- func ValidateModelPath(path string) error
- type InstallStatus
- type Provider
- func (*Provider) Capabilities() []speechkit.Capability
- func (p *Provider) Health(ctx context.Context) error
- func (p *Provider) IsReady() bool
- func (p *Provider) Name() string
- func (p *Provider) RuntimeDone() <-chan struct{}
- func (p *Provider) RuntimeError() error
- func (p *Provider) StartServer(ctx context.Context) error
- func (p *Provider) StopServer()
- func (p *Provider) Transcribe(ctx context.Context, audioData []byte, opts stt.TranscribeOpts) (*stt.Result, error)
- func (p *Provider) VerifyInstallation() InstallStatus
Constants ¶
const MinWhisperModelBytes = 50_000_000
MinWhisperModelBytes is the minimum file size we expect for a valid ggml model. ggml-base.bin is ~150 MB; anything under 50 MB is clearly corrupt/truncated.
Variables ¶
This section is empty.
Functions ¶
func FindWhisperBinary ¶
FindWhisperBinary exposes the local whisper runtime lookup for callers that need to reflect runtime readiness without starting the subprocess.
func SetSubprocessPriorityLowered ¶
func SetSubprocessPriorityLowered(bool)
SetSubprocessPriorityLowered is a no-op outside Windows; subprocess priority classes are a Windows scheduling concept.
func ValidateModelPath ¶
ValidateModelPath verifies that path points at a whisper.cpp ggml model file with a safe filename. It rejects path traversal, non-absolute paths, and filenames that don't match the ggml-*.bin pattern.
Types ¶
type InstallStatus ¶
type InstallStatus struct {
BinaryFound bool `json:"binaryFound"`
BinaryPath string `json:"binaryPath"`
ModelFound bool `json:"modelFound"`
ModelPath string `json:"modelPath"`
ModelBytes int64 `json:"modelBytes"`
ServerReady bool `json:"serverReady"`
Problems []string `json:"problems,omitempty"`
}
InstallStatus describes what's present and what's missing for local STT.
type Provider ¶
type Provider struct {
BaseURL string // e.g. "http://127.0.0.1:8080"
Port int
ModelPath string
GPU string
Validation netsec.ValidationOptions
// LowerSubprocessPriority overrides the process-wide default set via
// SetSubprocessPriorityLowered for this provider only. nil keeps the
// default (true on Windows). Ignored outside Windows.
LowerSubprocessPriority *bool
// contains filtered or unexported fields
}
Provider implements stt.STTProvider for Tier 1: localhost whisper.cpp server.
func New ¶
New creates the built-in whisper.cpp provider. The process is not started; lifecycle stays with the host.
func (*Provider) Capabilities ¶ added in v0.64.3
func (*Provider) Capabilities() []speechkit.Capability
Capabilities reports the speech-to-text baseline every provider satisfies.
func (*Provider) IsReady ¶ added in v0.64.3
IsReady returns true if the whisper-server subprocess is running and responding.
func (*Provider) RuntimeDone ¶ added in v0.64.3
func (p *Provider) RuntimeDone() <-chan struct{}
RuntimeDone closes whenever the owned whisper-server subprocess exits. RuntimeError then reports an unexpected exit and stays nil for an explicit StopServer call or process-context cancellation.
func (*Provider) RuntimeError ¶ added in v0.64.3
func (*Provider) StartServer ¶ added in v0.64.3
StartServer starts the whisper.cpp server subprocess. Blocks until ready or context cancelled.
func (*Provider) StopServer ¶ added in v0.64.3
func (p *Provider) StopServer()
StopServer terminates the whisper-server subprocess.
func (*Provider) Transcribe ¶ added in v0.64.3
func (*Provider) VerifyInstallation ¶ added in v0.64.3
func (p *Provider) VerifyInstallation() InstallStatus
VerifyInstallation checks binary and model availability without starting the server.