---
source_path: "models/tpl/index.md"
canonical_url: "https://doc.sensory.com/tnl/7.8/models/tpl/"
---

# Templates

Task templates are models that use composition to add behavior to
[basic model types](https://doc.sensory.com/tnl/7.8/models/types/index.md#model-types). Templates have _slots_ that you can fill with any
model that has a [task-type](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#task-type) that matches what the slot expects.

The [tpl-spot-vad-lvscr](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-spot-vad-lvcsr.md#tpl-spot-vad-lvcsr-type) template, for example,
waits for the [wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type)
in slot [0](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#0), then runs the [LVCSR](https://doc.sensory.com/tnl/7.8/models/types/lvcsr.md#lvcsr-type) or [STT](https://doc.sensory.com/tnl/7.8/models/types/stt.md#stt-type) model in slot [1](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#1).
The composed model has [task-type](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#task-type) `==` [phrasespot](https://doc.sensory.com/tnl/7.8/api/setting-keys/values.md#phrasespot) and implements all of the
events and settings expected of such a model type. You can use it as a drop-in replacement
for a wake word in (say) [live-spot.c](https://doc.sensory.com/tnl/7.8/api/sample/c/live-spot.md#live-spotc) without any code changes.

Compose new template-based models with [snsr-edit](https://doc.sensory.com/tnl/7.8/tools/snsr-edit.md#snsr-edit), on the fly with [snsr-eval](https://doc.sensory.com/tnl/7.8/tools/snsr-eval.md#snsr-eval), or
by using the [setStream](https://doc.sensory.com/tnl/7.8/api/inference.md#setters) function at runtime.

## Composed models

[tpl-spot-concurrent](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-spot-concurrent.md#tpl-spot-concurrent-type)

- Runs two [wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) models at the same time. It provides a convenient way to create a single
  wake word model that has the combined vocabulary of two other models.

[tpl-spot-debug](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-spot-debug.md#tpl-spot-debug-type)

- Adds runtime data collection to a [wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) model. Use this to collect audio and event timings
  from an embedded model, [snsr-log-split](https://doc.sensory.com/tnl/7.8/tools/snsr-log-split.md#snsr-log-split) to extract audio, event logs, and the model itself from the generated
  log file, and [audio-check](https://doc.sensory.com/tnl/7.8/tools/audio-check.md#audio-check) to verify audio recording quality.

[tpl-spot-select](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-spot-select.md#tpl-spot-select-type)

- Allows you to dynamically select which of the two embedded [wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) models to run.

[tpl-spot-sequential](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-spot-sequential.md#tpl-spot-sequential-type)

- Runs two [wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) models in sequence. Use this to listen for a trigger phrase followed by
  a command, for example: "Voice genie, play music."

[tpl-spot-vad](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-spot-vad.md#tpl-spot-vad-type)

- Runs the [wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) in slot [0](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#0) until it detects, then does start- and endpoint detection
  with a [VAD](https://doc.sensory.com/tnl/7.8/models/types/vad.md#vad-type) on the audio stream following the wake word.

[tpl-opt-spot-vad-lvcsr](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-opt-spot-vad-lvcsr.md#tpl-opt-spot-vad-lvcsr-type) _(TrulyNatural only)_

- _Optionally_ runs the [wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) in slot [0](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#0) until it detects, then segments the audio
  following the wake word with a [VAD](https://doc.sensory.com/tnl/7.8/models/types/vad.md#vad-type) and sends the segmented audio to the [LVCSR](https://doc.sensory.com/tnl/7.8/models/types/lvcsr.md#lvcsr-type) or
  [STT](https://doc.sensory.com/tnl/7.8/models/types/stt.md#stt-type) recognizer in slot [1](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#1).

[tpl-spot-vad-lvcsr](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-spot-vad-lvcsr.md#tpl-spot-vad-lvcsr-type) _(TrulyNatural only)_

- Runs the [wake word](https://doc.sensory.com/tnl/7.8/models/types/wake-word.md#wake-word-type) in slot [0](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#0) until it detects, segments the audio following the wake
  word with a [VAD](https://doc.sensory.com/tnl/7.8/models/types/vad.md#vad-type), and sends the segmented audio to the [LVCSR](https://doc.sensory.com/tnl/7.8/models/types/lvcsr.md#lvcsr-type) or [STT](https://doc.sensory.com/tnl/7.8/models/types/stt.md#stt-type)
  recognizer in slot [1](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#1).

[tpl-vad-lvcsr](https://doc.sensory.com/tnl/7.8/models/tpl/tpl-vad-lvcsr.md#tpl-vad-lvcsr-type) _(TrulyNatural only)_

- Detects speech with a [VAD](https://doc.sensory.com/tnl/7.8/models/types/vad.md#vad-type) and sends the segmented audio to the [LVCSR](https://doc.sensory.com/tnl/7.8/models/types/lvcsr.md#lvcsr-type)
  or [STT](https://doc.sensory.com/tnl/7.8/models/types/stt.md#stt-type) recognizer in slot [0](https://doc.sensory.com/tnl/7.8/api/setting-keys/configuration.md#0).

<!-- Abbreviation definitions from includes/abbreviations.md -->
*[API]: Application Programming Interface
*[LVCSR]: Large Vocabulary Continuous Speech Recognition model, feed-forward neural net acoustic model with FST decoder
*[STT]: Speech To Text: transformers with language model and CTC decoding
*[TNL]: TrulyNatural, Sensory's large-vocabulary speech recognition technology
*[VAD]: Voice Activity Detector
