Enhanced Robotics (Tenniix Official)Company & role details

AI Sports Agent with Streaming Voice and Native Audio

A voice-driven sports-planning agent with streaming recognition, acoustic and semantic turn detection, local or API planning, and native-audio alternatives sharing MCU capability checks and inspectable routine previews.

Sports-agent summary illustration showing streaming ASR, Silero VAD, Smart Turn, Qwen or DeepSeek planning, Kokoro or Breeze speech, local NemotronLabs VoiceChat, and the Qwen Omni realtime API with MCU capability checks and a routine preview.
Streaming voice, native audio, and realtime API · owner-provided project illustration

Tools & Skills

  • LLM Systems Engineering
  • LLM Harness Engineering
  • Streaming ASR
  • Voice Activity Detection
  • Semantic Turn Detection
  • Native Audio Models
  • Tool Calling
  • Speech Recognition
  • Text-to-Speech
  • Inference Optimization
  • Python
  • llama.cpp
  • Qwen
  • GGUF
  • DeepSeek API
  • Nemotron Speech
  • Moonshine
  • Qwen3-ASR
  • Silero VAD
  • Smart Turn
  • Faster-Whisper
  • Kokoro ONNX
  • ONNX Runtime
  • Breeze TTS 2
  • NemotronLabs VoiceChat
  • Qwen Omni Realtime API
  • qwen3.8-omni-flash-realtime
  • vLLM
  • WebSockets
  • INT8 Quantization
  • Prompt Caching
  • Speculative Decoding
  • Structured Generation
  • Schema Validation
  • Persistent Workers
  • Observability

LLM Systems Engineering

Engineering at a glance

Explore the evidence

The Challenge

Interpret spoken sports instructions without losing pauses, corrections, counts, or device constraints, while keeping conversation responsive and reviewable.

The Solution

A shared planning contract connects streaming ASR and turn detection, local Qwen or DeepSeek planning, and native-audio backends to independent MCU checks, clarification history, and controlled spoken responses.

Results and Impact

Streaming voice → validated routine previews

The modular pipeline and Qwen Omni API integration support inspectable voice interactions. Local VoiceChat is an experimental alternative whose semantic reliability still needs improvement.

Project Status

Working prototype

The PC demo includes streaming speech, native-audio integrations, and Qwen Omni playback interruption. Machine state is simulated; physical launcher execution and production deployment remain separate integration work.

My contribution

Designed the streaming speech controller, capability-bound planning and clarification workflows, local and API model integrations, validated speech output, run inspection, and inference optimizations across the voice pipeline.

Project overview

I built an AI sports agent that turns spoken or typed training requests into structured, capability-validated routine previews. The engineering problem spans speech recognition, conversation timing, instruction interpretation, and the boundary between a proposed routine and a machine action.

A player may pause to think, correct a count halfway through a sentence, or answer a clarification with only a few words. The agent must preserve those details, recognize when the turn is actually finished, and interpret the request using the selected sport and device capabilities. It also needs a responsive voice interface without hiding invalid output behind a fluent spoken response.

For example, “Serve three baseline balls, wait five seconds, then serve two volley balls” should retain both serving blocks and the wait. “Actually, make the first part five balls” should revise the relevant count while preserving the rest of that preview. A new request should start with its own requirements. These distinctions drive the speech controller, planning contracts, and conversation-state design.

The demo runs on a development PC with simulated machine context. Accepted routines are console previews; the application does not send commands to a physical launcher.

LLM systems engineering

I designed the planning harness around explicit context, structured output, runtime orchestration, and independent validation. Three interchangeable voice paths explore where recognition, turn-taking, planning, and speech generation should live:

Path Implemented design Purpose
Modular speech pipeline Streaming ASR + Silero VAD + Smart Turn v3.2 → local Qwen or DeepSeek planner → Kokoro or Breeze TTS 2 Inspect and tune recognition, endpointing, planning, and synthesis independently
Local native audio NemotronLabs VoiceChat 11B in a resident native process → constrained JSON → validation → its own speech generator Explore local audio-to-plan and speech without separate ASR, planner, and TTS workers
Native audio API Qwen Omni realtime audio/text input → planning tool JSON → validation → spoken response from the same model Simplify application-side model orchestration and support provider turn detection and playback interruption

The modular path remains the default speech architecture. Streaming recognizers are selectable alternatives to the retained Faster-Whisper baseline. VoiceChat is an opt-in experiment; the Qwen Omni API is a separate opt-in integration. Each path keeps application-owned request identity, capability binding, validation, and run inspection.

Modular voice and text pipeline

For continuous microphone sessions, a local Hi Tenniix wake-word model activates capture. Wake audio is kept separate from command audio. Streaming recognition begins while the user speaks; acoustic activity and semantic completion are evaluated alongside it. Clarification replies enter capture directly after the question, without requiring another wake word.

Modular streaming voice and text planning
Microphone or file audio feeds streaming ASR, Silero speech activity detection, and Smart Turn audio-based completion checks. The endpoint controller commits one final transcript; partial text is provisional. Typed input joins the same router. Exact predefined commands bypass the LLM; other requests use local Qwen or DeepSeek with explicit capabilities and dialogue history. Independent validation produces a routine preview or conversational response, with optional Kokoro or Breeze speech.Microphone or file audio feeds streaming ASR, Silero speech activity detection, and Smart Turn audio-based completion checks. The endpoint controller commits one final transcript; partial text is provisional. Typed input joins the same router. Exact predefined commands bypass the LLM; other requests use local Qwen or DeepSeek with explicit capabilities and dialogue history. Independent validation produces a routine preview or conversational response, with optional Kokoro or Breeze speech.

The diagram shows the streaming path. The baseline Whisper path records the turn using WebRTC VAD and then transcribes it; typed input bypasses speech recognition.

Recognizing words and recognizing a finished turn

Recognition and turn detection solve different problems. ASR estimates the words. Silero VAD estimates whether speech is present. Smart Turn v3.2 estimates whether the recent audio sounds like a completed turn, using acoustic context rather than the transcript. This allows “Give me … ten baseline balls” to remain one request across a thinking pause.

The implemented streaming recognizers are Nemotron Speech Streaming 0.6B, Moonshine Medium Streaming, and Qwen3-ASR in 0.6B and 1.7B variants. Nemotron uses a cache-aware native C++ runtime with CUDA support. Moonshine uses a quantized CPU runtime and can revise an active hypothesis as context grows. Qwen3-ASR uses its vLLM streaming interface with accumulated audio and limited rollback of recent text. Their streaming and revision behavior differs; a shared adapter lets the application compare them without rewriting the conversation flow.

I designed the endpoint controller to combine a candidate pause, Smart Turn’s audio-based completion score, speech-duration checks, and a small guard for clearly unfinished transcript endings. Smart Turn runs in a background inference thread while capture continues. If speech resumes during that check, its result becomes stale and cannot close the turn; queued microphone audio must also be consumed before acceptance.

Partial transcripts remain provisional display output. Only one finalized, nonempty transcript reaches planning. Speech-start and capture limits reject incomplete attempts. Detected speech is required even at file boundaries, preventing silence alone from becoming an accepted command when a recognizer invents text. The controller retains pauses and quiet context instead of deleting every frame classified as nonspeech.

From language to a validated routine

The modular planner supports a local Qwen3.8-27B-UD-Q4_K_XL GGUF model through llama.cpp and a DeepSeek API backend. Both receive explicit system instructions, a sport/hardware-filtered MCU capability view, the result contract, and a user request containing simulated context and clarification history. Model-specific prompts share the same application contract.

A hybrid router avoids unnecessary model work: an exact predefined command takes a deterministic path. Other inputs use one model call to recover a command identity, ask a short confirmation, or plan the complete request. Counts, settings, and waits must remain in a full plan. An explicit answer to a pending command-identity question can resolve locally without another inference call.

Python checks JSON parsing, duplicate keys, schema structure, request identity, capability-profile binding, and applicable machine constraints. The semantic capability view exposes supported actions and limits; raw motor targets and wire opcodes stay outside the planner’s interface. Accepted results become routine previews, clarification questions, queries, or refusals. The execution assessment keeps unresolved calibration and compilation requirements visible.

Malformed text-planner output can receive a bounded structural repair. Planner-call, clarification, and time budgets prevent an unbounded retry loop. A valid JSON object still needs semantic evaluation: structural checks cannot establish that the model preserved every spoken requirement.

Local native audio with VoiceChat

I integrated NemotronLabs VoiceChat 11B as a local audio-to-JSON and spoken-response experiment. A patched CUDA runtime keeps its speech encoder, embedded language model, and native speech generator resident. The application supplies capabilities, simulated context, command names, and a grammar derived from the existing result schema.

The integration accepts complete recorded audio turns, generates a structured result, validates it in Python, and then uses the same native model bundle to synthesize the accepted short response. I added constrained text generation and per-turn grammar handling because free-running tool output did not reliably satisfy the planning contract. Its current integration does not implement continuous full-duplex capture, automatic endpointing, or playback interruption.

VoiceChat remains experimental because semantic review exposed omitted requirements and invented details despite schema-valid output. This makes model interpretation and plan correctness separate review targets. It is a working integration, with further quality work needed before replacing the modular pipeline.

I also considered Qwen3-Omni-30B-A3B-Instruct, Fun-Audio-Chat-8B, Step-Audio-2-mini, MiniCPM-o 4.5, and LFM3-Audio-2B as alternatives. These remain research candidates; VoiceChat is the implemented local native-audio backend.

Qwen Omni realtime API and interruption handling

The qwen3.8-omni-flash-realtime integration sends microphone audio, recorded audio, or typed input directly to the native model through a WebSocket API. Session instructions include the planner policy, capability view, command catalog, and dialogue context. The model returns a submit_planner_result tool call containing its interpretation and structured result. Provider transcription is provisional display and diagnostic evidence; it is not the input to a separate text planner.

This path removes local ASR, Silero, Smart Turn, LLM, and TTS workers from application-side inference orchestration. The provider handles speech activity and turn completion. Python still validates the tool result and enforces the planning budgets and capability checks.

Native audio planning with validation before speech
Local VoiceChat receives a completed audio turn and emits constrained JSON. The Qwen Omni API receives streaming audio or typed input and emits a planning tool call. Both receive explicit capabilities and dialogue context, pass independent application validation, and produce console previews. Accepted short text is synthesized by the selected native model. VoiceChat uses its resident speech generator; Qwen uses a fresh speech session and a text consistency check before playback.Local VoiceChat receives a completed audio turn and emits constrained JSON. The Qwen Omni API receives streaming audio or typed input and emits a planning tool call. Both receive explicit capabilities and dialogue context, pass independent application validation, and produce console previews. Accepted short text is synthesized by the selected native model. VoiceChat uses its resident speech generator; Qwen uses a fresh speech session and a text consistency check before playback.

I separated Qwen’s planning and speech sessions after observing that direct continuations could invent a reply or describe a preview as an executed action. The same model reads an explicit short response derived from the accepted result. Its returned speech text must match the intended wording before playback; the response is buffered to perform that check. This is a deliberate correctness/latency tradeoff, and text matching does not independently verify every audio sample.

During realtime microphone playback, barge-in opens a listening planning session and stops local speech when the provider detects the user speaking. That connection retains the start of the utterance. The next tool result distinguishes a new command, a correction, a clarification reply, or unclear intent, so the application carries forward only the relevant history. This uses the planning response itself rather than adding a separate intent-classifier call.

Interruption currently applies to playback, with no acoustic echo cancellation; it does not cancel an in-flight planning or speech-generation request. Future physical execution will need authoritative device status: stopping spoken audio cannot establish whether a machine action has started, finished, or been cancelled.

ASR optimization

I moved model loading and warm-up into reusable workers so repeated commands and clarification replies avoid process initialization. Streaming overlaps recognition with recording, and the endpoint controller schedules semantic checks without blocking audio capture. Nemotron runs through an in-process native binding; Moonshine provides a CPU alternative; Qwen’s separate worker environment isolates its vLLM and dependency requirements.

Domain vocabulary is applied at the recognizer’s supported interface: native phrase/keyterm bias for Nemotron and Moonshine, optional text context for Qwen3-ASR. Raw hypotheses are retained. Vocabulary hints are neither hardcoded transcript replacements nor permission to execute an action. The retained Whisper baseline uses INT8/FP16 inference with a resident worker for controlled comparisons.

LLM optimization

The local planner combines quantized GGUF weights, automatic GPU offload, a persistent server, prompt warm-up, and cached stable prompt prefixes. Capabilities and policy precede variable request fields; runtime permissions remain independently checked. Cache reuse depends on the selected context and capability view.

Compact prompt serialization and JSON generation reduce formatting work. N-gram speculative decoding reuses repeated token patterns without loading another draft model. Exact-command routing, local confirmation resolution, and lazy planner startup avoid model work when a deterministic path suffices. Remote and native-audio backends provide additional deployment choices, with their connection and validation overhead included when comparing response time.

TTS optimization

Kokoro ONNX on CPU is the modular default, with Breeze TTS 2 as an alternative. Resident Kokoro workers load and warm once, use a tuned CPU thread budget, and disable idle thread spinning so synthesis workers do not compete unnecessarily with recognition or planning.

Speech is generated from the accepted result: a concise plan goal, clarification question, or query/refusal response. Pronunciation normalization makes numbers and units explicit. VoiceChat and Qwen Omni use their own native speech generation instead of invoking these modular TTS backends. Playback readiness remains distinct from the first generated audio chunk, especially when a complete response must be checked first.

Inspection, evaluation, and continued development

I built saved-run dashboards that connect each input to its exact prompt or native session configuration, provisional recognition, endpoint decisions, candidate output, validation assessment, accepted preview, and speech artifacts. Session history makes clarification and interruption relationships visible rather than presenting every turn as an unrelated request.

Timing separates startup, recognition during capture, endpointing, planning, synthesis, playback, and user waits. Overlapping streaming work is recorded separately from exclusive wall time; native-model timings are not presented as fabricated independent ASR/LLM/TTS measurements. This supports identifying where response latency actually comes from.

Evaluation combines contract tests, source-authored semantic scenarios, audio replay, clarification/correction checks, silence/noise rejection, and inspection of failed cases. Expected actions come from the original instruction rather than the model’s own transcription. These development tools support comparison and iteration; broader human speech, court conditions, and deployment acceptance remain future validation work.

The shared contract lets the system grow with additional recognizers, native-audio models, and capability profiles. New sports or machine actions require corresponding capability definitions, prompt/schema changes where needed, and scenario review. Physical launcher integration remains a separate milestone involving calibrated compilation, finite-shot accounting, device transport, and live feedback.

Project diagram

100%Drag or scroll to explore

Project image

Click outside the image or press Escape to close.