Documentation
¶
Overview ¶
Package v1 defines version 1 of the voice gateway config.toml and voice-choices.toml schemas.
The gateway only reads these files; package voicegateway converts them to its runtime configuration and validates the result. WebRTC is also the fragment a host embeds in its own TOML section.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASR ¶
type ASR struct {
ID string `toml:"id"`
Label string `toml:"label"`
Engine string `toml:"engine"`
Provider string `toml:"provider"`
Remote string `toml:"remote"`
Model string `toml:"model"`
ContextSize int `toml:"context_size"`
Slots int `toml:"slots"`
}
ASR is one [[asr]] entry.
type Choices ¶
type Choices struct {
Runtime Runtime `toml:"local_stack_runtime"`
Realtime []Realtime `toml:"realtime"`
ASR []ASR `toml:"asr"`
LLM []LLM `toml:"llm"`
TTS []TTS `toml:"tts"`
Voice []Voice `toml:"voice"`
}
Choices is voice-choices.toml, or the same tables in a host's configuration directory.
type Debug ¶
type Debug struct {
Trace string `toml:"trace"`
}
Debug is the config.toml [debug] table.
type File ¶
type File struct {
AutoUpdate string `toml:"auto_update"`
Server Server `toml:"server"`
TrustedIssuers []TrustedIssuer `toml:"trusted_issuers"`
Debug Debug `toml:"debug"`
}
File is the standalone gateway config.toml. Voice declarations live in Choices.
type LLM ¶
type LLM struct {
ID string `toml:"id"`
Label string `toml:"label"`
ModelSettings
ContextSize int `toml:"context_size"`
Slots int `toml:"slots"`
}
LLM is one [[llm]] entry.
type ModelSettings ¶
type ModelSettings struct {
LlamaCPPServer bool `toml:"llamacppsrv"`
Provider string `toml:"provider"`
Auth string `toml:"auth"`
Remote string `toml:"remote"`
Model string `toml:"model"`
Effort string `toml:"effort"`
OpenRouterSort string `toml:"openrouter_sort"`
APIKeyName string `toml:"api_key_name"`
}
ModelSettings are the model keys shared by [[realtime]] and [[llm]] entries.
type Realtime ¶
type Realtime struct {
ID string `toml:"id"`
Label string `toml:"label"`
ModelSettings
Staged bool `toml:"staged"`
CacheDir string `toml:"cache_dir"`
Threads int `toml:"threads"`
Slots int `toml:"slots"`
ContextSize int `toml:"context_size"`
MaxOutputTokens int64 `toml:"max_output_tokens"`
}
Realtime is one [[realtime]] entry.
type Runtime ¶
type Runtime struct {
IdleTimeoutSeconds int `toml:"idle_timeout_seconds"`
MaxInstances int `toml:"max_instances"`
}
Runtime is the [local_stack_runtime] table.
type Server ¶
type Server struct {
GeoDB string `toml:"geo_db"`
AllowOrigins []string `toml:"allow_origins"`
WebRTC
HTTP string `toml:"http"`
ExternalURL string `toml:"external_url"`
TrustedProxies []string `toml:"trusted_proxies"`
DebugFrontend bool `toml:"debug_frontend"`
LogLevel slog.Level `toml:"log_level"`
}
Server is the config.toml [server] table.
type TTS ¶
type TTS struct {
ID string `toml:"id"`
Label string `toml:"label"`
Engine string `toml:"engine"`
Provider string `toml:"provider"`
Remote string `toml:"remote"`
Model string `toml:"model"`
Voice string `toml:"voice"`
ContextSize int `toml:"context_size"`
Slots int `toml:"slots"`
}
TTS is one [[tts]] entry.
type TrustedIssuer ¶
type TrustedIssuer struct {
Service string `toml:"service"`
Issuer string `toml:"issuer"`
PublicKey string `toml:"public_key"`
OAuth bool `toml:"oauth"`
Scope string `toml:"scope"`
}
TrustedIssuer is one config.toml [[trusted_issuers]] entry.
type Voice ¶
type Voice struct {
ID string `toml:"id"`
Label string `toml:"label"`
ASR string `toml:"asr"`
LLM string `toml:"llm"`
TTS string `toml:"tts"`
}
Voice is one [[voice]] preset entry.
type WebRTC ¶
type WebRTC struct {
// UDPPort is the ICE UDP mux port; 0 selects an ephemeral port.
UDPPort int `toml:"webrtc_udp_port"`
// STUNServers lists the stun: or stuns: URLs WebRTC clients use to learn
// their public address. The gateway advertises them in its voice choices
// and runs no STUN itself. Empty means clients gather host candidates only,
// which suffices when clients can reach the gateway's advertised UDP
// endpoint: the gateway learns each client's address from its checks.
STUNServers []string `toml:"stun_servers"`
// DisableUPnP skips the UPnP UDP mapping the gateway otherwise requests
// from the LAN router at startup, along with its SSDP search of up to two
// seconds. Disable it when clients reach the UDP port without it, or when
// the router must not open ports on the gateway's behalf.
DisableUPnP bool `toml:"disable_upnp"`
}
WebRTC configures the gateway's WebRTC media listener and the STUN servers its clients use. The standalone gateway reads it from [server]; a host embeds it in its own TOML section, starting from voicegateway.NewWebRTCConfig so an omitted key keeps its default.