TEN-framework: Simplifying Real-Time Voice AI Agents


TEN-framework: Simplifying Real-Time Voice AI Agents

TEN-framework/ten-framework

2025-09-19

The TEN-framework is a powerful tool for engineers who want to build real-time conversational voice AI agents. It simplifies the complex process of creating these applications by providing a pre-built structure. This means you don't have to start from scratch, saving a huge amount of development time. It's particularly useful for

Prototyping
Quickly build and test new ideas for AI voice agents.

Reduced Complexity
It handles the difficult parts like real-time audio processing, synchronization, and integrating different AI models (like speech-to-text, LLMs, and text-to-speech).

Modular Design
The framework's modular nature allows you to easily swap out components. For example, if you want to use a different speech-to-text service, you can do it without overhauling your entire application.

Focus on Core Logic
You can focus on building the unique business logic of your application instead of worrying about low-level infrastructure.

Getting the framework up and running is pretty straightforward. You'll need to have Python and pip installed. The best way to install it is using pip.

First, you need to clone the repository from GitHub

git clone https://github.com/TEN-framework/ten-framework.git
cd ten-framework

Next, you can install the necessary packages. It's a good practice to use a virtual environment to manage dependencies.

python -m venv venv
source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
pip install -r requirements.txt

After installation, you'll need to configure your API keys for the different services you want to use, such as OpenAI, ElevenLabs, etc. You can do this by setting them as environment variables.

export OPENAI_API_KEY="your-api-key"
export ELEVENLABS_API_KEY="your-api-key"

Here’s a simple example of how you can use the TEN-framework to create a basic conversational AI agent. This code will set up a listener for a wake word, and when detected, it will start a conversation.

import asyncio
from ten_framework.core.pipeline import Pipeline
from ten_framework.components.input.mic import MicInput
from ten_framework.components.stt.whisper import WhisperSTT
from ten_framework.components.llm.openai import OpenAILLM
from ten_framework.components.tts.elevenlabs import ElevenLabsTTS
from ten_framework.components.output.speaker import SpeakerOutput

async def main():
    # Set up the pipeline components
    mic_input = MicInput(
        wake_word="hey framework",
        wake_word_threshold=0.5
    )
    stt = WhisperSTT()
    llm = OpenAILLM(
        model_name="gpt-4o",
        system_prompt="You are a helpful conversational AI assistant."
    )
    tts = ElevenLabsTTS()
    speaker_output = SpeakerOutput()

    # Build the pipeline
    pipeline = Pipeline(
        input_component=mic_input,
        stt_component=stt,
        llm_component=llm,
        tts_component=tts,
        output_component=speaker_output
    )

    # Start the conversation loop
    print("Agent is listening...")
    await pipeline.run()

if __name__ == "__main__":
    asyncio.run(main())

Imports
We import the necessary classes from the framework, such as Pipeline, and the specific components for input, STT (Speech-to-Text), LLM (Large Language Model), TTS (Text-to-Speech), and output.

Component Initialization
We create instances of each component. For example, MicInput is set up to listen for the wake word "hey framework."

Pipeline Assembly
The Pipeline class acts as the orchestrator. We pass the initialized components to it in the correct order
input -> stt -> llm -> tts -> output.

Running the Pipeline
The pipeline.run() method starts the main loop. The framework takes care of passing the data (audio, text, etc.) between the components in real-time.


TEN-framework/ten-framework




The Developer’s Blueprint for Multimodal AI Agents with LiveKit

Think of this framework as the "connective tissue" between high-end AI brains (like LLMs) and the real-world plumbing of low-latency video and audio


TT-Metal: Programming Tenstorrent Hardware from a Developer's Perspective

TT-Metal is a software stack designed to program Tenstorrent hardware, which is a new type of AI accelerator. Think of it as the CUDA or ROCm for Tenstorrent's hardware


Code Consistency & Speed: Customizing Your Code Assistant with Community Prompts

Here is a friendly and clear breakdown of how this resource is useful, how to get started, and some examples.From a software engineer's perspective


Unleash Your Models: A Software Engineer's Guide to Unsloth

Unsloth is useful because it dramatically reduces the time and resources needed for a very common and important task fine-tuning


x1xhlol/system-prompts-and-models-of-ai-tools

Let's dive in!As a software engineer, I see x1xhlol/system-prompts-and-models-of-ai-tools as a fantastic open-source repository that acts as a central hub for understanding and utilizing the "brains" behind many popular AI-powered development tools


Supercharging Claude Code: Building an Autonomous "Inner Loop" for Faster Shipping

If you’ve used Claude Code (Anthropic’s command-line tool), you know it’s powerful for editing files and running commands


A Software Engineer's Guide to Hugging Face aisheets

Huggingface/aisheets is a library that allows you to easily build, enrich, and transform datasets using AI models, without writing any code


Navigating the World of AI and ML Servers with awesome-mcp-servers

Hello there, fellow software engineers!Let's talk about a very useful resource that you might find interesting, especially if you're involved in machine learning


Beyond the Terminal: Managing Claude Code and Goose via AionUi

In the current landscape, we have dozens of powerful CLI (Command Line Interface) tools for coding, like Claude Code, Goose


Real-Time AI: A Software Engineer's Guide to Deep-Live-Cam Integration and Optimization

For a software engineer, projects like Deep-Live-Cam are more than just "deepfake" tools; they're excellent examples of real-time computer vision and machine learning inference in action