wakewordmodels

package
v0.73.4 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 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 wakewordmodels serves SpeechKit's wake-word MODEL catalog to devices, so a wake phrase trained via SpeechKit can be individualized on both device families from one contract:

  • ESPHome voice satellites and the Kombify-Box firmware consume the microWakeWord v2 manifest (GET .../{id}/manifest.json) + its TFLite (GET .../{id}/model.tflite). The manifest shape is byte-compatible with esphome/micro-wake-word-models so an ESPHome `micro_wake_word:` block can reference the manifest URL directly.
  • Host consumers (desktop, box companion) read the openWakeWord ONNX triplet (GET .../{id}/openwakeword) — the same artifacts the desktop download catalog ships.

Endpoints are PUBLIC (no bearer): a low-power device has no credential to present, and every payload is already-public model metadata / a redirect to already-public model bytes. See internal/server/core/testui.go serverPublicRoutes for the auth carve-out. The activation-collector endpoints (internal/server/wakewordtraining) stay authenticated — do not widen those.

Contract vs. consumer: this package SERVES the manifest/redirect contract. Producing the microWakeWord .tflite (tools/wakeword-training/microwakeword) and consuming it on-device (ESPHome / esp-tflite-micro) are separate workstreams. Until a phrase's microWakeWord variant is published (registry Available flag), the manifest/tflite routes report it as pending.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler is the HTTP mount.

func New

func New(opts Options) *Handler

New returns a ready-to-mount handler.

func (*Handler) Mount

func (h *Handler) Mount(mux *http.ServeMux)

Mount wires the handler onto mux.

GET /v1/wakeword/models                     — list phrases + formats
GET /v1/wakeword/models/{id}/manifest.json  — microWakeWord v2 manifest
GET /v1/wakeword/models/{id}/model.tflite   — redirect to the TFLite bytes
GET /v1/wakeword/models/{id}/openwakeword   — openWakeWord ONNX triplet URLs

type Options

type Options struct {
	// Enabled mounts the routes but, when false, every request returns 503 so
	// a device can detect the operator disabled model serving.
	Enabled bool
	// Author / Website populate the microWakeWord manifest attribution. Default
	// to a framework-neutral name so no product branding leaks into the OSS
	// server surface.
	Author  string
	Website string
	// PublicBaseURL is the externally-reachable origin (scheme://host[:port])
	// used to build absolute manifest/model URLs in the list response. Empty =
	// derive from each request's scheme + Host.
	PublicBaseURL string
	// LocalDir is the directory holding the wake-word model bytes this server
	// serves at /v1/wakeword/files/<name> (synced from Cloudflare R2 at startup).
	// Empty disables local byte serving (the /files route then 404s), which is
	// the case for a self-hosted OSS server without the models — its clients use
	// the kombify-hosted origin the catalog URLs point at.
	LocalDir string
}

Options configures the handler.

Jump to

Keyboard shortcuts

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