Skip to content

🚀 Quickstart

We will use APIs from AliCloud to demonstrate the basic capability of X-Talk.

Step 1. Install dependencies

Install dependencies for AliCloud and server script:

pip install "xtalk[ali,example] @ git+https://github.com/xcc-zach/xtalk.git@main"

For developers, clone the repository, create a branch and use pip install -e . under the repository.

Step 2. Obtain an API key

Obtain an API key from AliCloud Bailian Platform. We will be using free-tier (currently) service from AliCloud.

Online service may be unstable and of high latency. We recommend using locally deployed models for better user experience. We recommend ASR models from SherpaOnnx (setup tutorial) and IndexTTS (setup tutorial).See server config tutorial and sample config for fully local deployment for details.

Step 3. Create the config file

Create a JSON config specifying the models to use, and fill in with the key you obtained:

{
    "asr": {
        "type": "Qwen3ASRFlashRealtime",
        "params": {
            "api_key": "<API_KEY>"
        }
    },
    "llm_agent": {
        "type": "DefaultAgent",
        "params": {
            "model": {
                "api_key": "<API_KEY>",
                "model": "qwen-plus-2025-12-01",
                "base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1"
            }
        }
    },
    "tts": {
        "type": "CosyVoice",
        "params": {
            "api_key": "<API_KEY>"
        }
    }
}

Step 4. Start the server

A sample server script is ready at examples/sample_app/configurable_server.py. We simply need to start the server with the config file (fill in .json with the path to the config file we just created) and a custom port:

git clone https://github.com/xcc-zach/xtalk.git
cd xtalk
python examples/sample_app/configurable_server.py  --port 7635 --config <PATH_TO_CONFIG>.json

Finally, our demo is ready at http://localhost:7635. View it in the browser!