wakewordmodels

package
v0.51.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

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