Text Generation
Transformers
Safetensors
English
speech
duplex
voice-assistant
streaming
tool-calling
qwen
text-to-speech
Instructions to use sadmN/aiden-duplex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sadmN/aiden-duplex with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sadmN/aiden-duplex")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sadmN/aiden-duplex", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sadmN/aiden-duplex with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sadmN/aiden-duplex" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sadmN/aiden-duplex", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sadmN/aiden-duplex
- SGLang
How to use sadmN/aiden-duplex with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sadmN/aiden-duplex" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sadmN/aiden-duplex", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sadmN/aiden-duplex" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sadmN/aiden-duplex", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sadmN/aiden-duplex with Docker Model Runner:
docker model run hf.co/sadmN/aiden-duplex
Download scripts/check_server.sh from sadmN/aiden-duplex: direct link, hf CLI and curl.
- Browser
- Download file 3.8 kB
-
https://huggingface.co/sadmN/aiden-duplex/resolve/main/scripts/check_server.sh
- Command line
-
hf download hf://sadmN/aiden-duplex/scripts/check_server.sh
-
curl -L -o check_server.sh https://huggingface.co/sadmN/aiden-duplex/resolve/main/scripts/check_server.sh
3.8 kB
| # Check a running Aiden server. Run it in a second terminal after starting run.sh: | |
| # bash scripts/check_server.sh | |
| # Optional: PORT=8999 HOST=0.0.0.0 bash scripts/check_server.sh | |
| set -uo pipefail | |
| ROOT=$(cd "$(dirname "$0")/.." && pwd) | |
| HOST=${HOST:-127.0.0.1} | |
| PORT=${PORT:-8998} | |
| BASE="http://$HOST:$PORT" | |
| FAIL=0 | |
| report() { printf '%-34s %s\n' "$1" "$2"; } | |
| # 1. Is anything listening on the port? | |
| if ss -lnt 2>/dev/null | grep -q ":$PORT "; then | |
| report "listening on port $PORT" "PASS" | |
| else | |
| report "listening on port $PORT" "FAIL - server is not running (see the run.sh terminal)" | |
| FAIL=1 | |
| fi | |
| # 2. Health endpoint: ready means thinker + ASR + TTS workers are alive. | |
| HEALTH=$(curl -fsS --max-time 5 "$BASE/health" 2>/dev/null) | |
| case "$HEALTH" in | |
| *'"ready": true'*|*'"ready":true'*) | |
| report "health endpoint" "PASS ($HEALTH)" ;; | |
| "") | |
| report "health endpoint" "FAIL - no response from $BASE" ; FAIL=1 ;; | |
| *) | |
| report "health endpoint" "WAIT - still loading: $HEALTH" ; FAIL=1 ;; | |
| esac | |
| # 3. The demo page is served and contains the UI. | |
| PAGE=$(mktemp) | |
| CODE=$(curl -s -o "$PAGE" -w '%{http_code}' --max-time 5 "$BASE/" 2>/dev/null) | |
| if [ "$CODE" = "200" ] && grep -q 'Enable mic' "$PAGE"; then | |
| report "demo page" "PASS (HTTP 200)" | |
| else | |
| report "demo page" "FAIL (HTTP ${CODE:-none})" | |
| FAIL=1 | |
| fi | |
| rm -f "$PAGE" | |
| # 4. GPU memory, for information only. | |
| if command -v nvidia-smi >/dev/null 2>&1; then | |
| report "GPU memory used" "$(nvidia-smi --query-gpu=memory.used,memory.total \ | |
| --format=csv,noheader 2>/dev/null | head -1)" | |
| fi | |
| # 5. One real turn over the same WebSocket the browser uses. | |
| PY="$ROOT/.venv-thinker/bin/python" | |
| [ -x "$PY" ] || PY=$(command -v python3 || true) | |
| if [ -n "$PY" ]; then | |
| if AIDEN_URL="ws://$HOST:$PORT/ws" "$PY" - <<'PY' | |
| import asyncio, json, os, sys | |
| import aiohttp | |
| URL = os.environ['AIDEN_URL'] | |
| headers = {'Origin': os.environ['AIDEN_ORIGIN']} if os.environ.get('AIDEN_ORIGIN') else {} | |
| async def main(): | |
| async with aiohttp.ClientSession() as s: | |
| async with s.ws_connect(URL, headers=headers) as ws: | |
| await ws.send_json({'type': 'text', 'text': 'look up the movie Obsession'}) | |
| tools, said = [], [] | |
| try: | |
| while len(said) < 2: | |
| m = await asyncio.wait_for(ws.receive(), 60) | |
| if m.type != aiohttp.WSMsgType.TEXT: | |
| continue | |
| d = json.loads(m.data) | |
| if d.get('type') == 'tool': | |
| tools.append('%s %s' % (d.get('name'), d.get('stage'))) | |
| elif d.get('type') == 'audio': | |
| said.append(d.get('text', '')) | |
| await ws.send_json({'type': 'playing', 'seq': d['seq'], | |
| 'epoch': d['epoch']}) | |
| await ws.send_json({'type': 'played', 'seq': d['seq'], | |
| 'epoch': d['epoch']}) | |
| elif d.get('type') == 'error': | |
| print('turn: FAIL - ' + str(d.get('message'))) | |
| return 1 | |
| except asyncio.TimeoutError: | |
| print('turn: FAIL - no audio within 60 s') | |
| return 1 | |
| print('turn: PASS - tools=%s' % (tools or ['none'])) | |
| print(' speech=%s' % (' '.join(said)[:120])) | |
| return 0 | |
| sys.exit(asyncio.run(main())) | |
| PY | |
| then :; else FAIL=1; fi | |
| else | |
| report "one live turn" "SKIP - no python found" | |
| fi | |
| echo | |
| if [ "$FAIL" = 0 ]; then | |
| echo "RESULT: server is healthy. Open $BASE in a browser and click Enable mic." | |
| else | |
| echo "RESULT: not ready yet. Re-run this check in 30 s; if it still fails, read" | |
| echo " the terminal where run.sh is running." | |
| fi | |
| exit "$FAIL" | |