A self-hosted automated outbound dialer phone bot
Project description
Autodial is a production-grade, highly-scalable, self-hosted outbound and inbound phone automation engine. It leverages state-of-the-art Local Speech-to-Text (STT), multi-provider Large Language Models (LLMs), and Local Text-to-Speech (TTS) to create intelligent, human-like phone interactions.
Whether you need a dynamic AI receptionist, a high-volume outbound lead qualifier, or a system to navigate complex IVR menus with DTMF tones, Autodial is the ultimate developer tool. It natively bridges Twilio and Telnyx media streams with zero friction.
🚀 Why Autodial?
- Multi-LLM Cloud & Local Support: Power your conversations with OpenAI, Google Gemini, MistralAI, or keep it 100% private and offline using Ollama.
- Bidirectional Calling: Trigger automated outbound calls via Python or handle inbound calls instantly by pointing your Twilio/Telnyx webhook to the
/incomingendpoint. - Provider Agnostic: Native auto-detection and WebSocket formatting for Twilio and Telnyx. Drop in your API keys and go.
- Natural Language CLI: Execute phone calls from your terminal using plain English (
autodial call bob and ask...). The CLI automatically extracts parameters using your configured LLM. - Local Transcription Engine: Powered by
Faster-Whisper(STT). Optimized for GPU (RTX series) with automatic CPU fallback for lightning-fast voice transcription. - Intelligent Call Termination: Built-in intent recognition for phrases like "stop calling me" or "goodbye," ensuring polite and immediate hang-ups.
- Webhooks & Transcripts: Every call generates a detailed JSON transcript. Configure a
callback_urlto pipe data directly into your CRM.
🛠 Quickstart Installation
Core Requirements
- TTS Engine: The
piperbinary should be in your system PATH, along with its.onnxmodels. - LLM Provider: An API key for OpenAI/Gemini/Mistral, OR a local Ollama instance serving a chat-ready model (e.g.,
llama3.2). - Telephony: An active Account SID/API Key, Auth Token, and a verified Phone Number from Twilio or Telnyx.
Install via PyPI
pip install autodial
⚙️ Configuration (.env)
Autodial consumes configuration via environment variables. Create a .env file in the directory where you run the server:
PORT=8000
TWILIO_ACCOUNT_SID=your_sid_here
TWILIO_AUTH_TOKEN=your_token_here
TWILIO_PHONE_NUMBER=+1234567890
# --- LLM Provider Selection ---
# Options: ollama (default), openai, gemini, mistral
LLM_PROVIDER=openai
LLM_MODEL=gpt-4o
# Cloud API Keys (Required if using cloud provider)
OPENAI_API_KEY=sk-your-key
# GEMINI_API_KEY=AIza...
# MISTRAL_API_KEY=...
# Local Ollama URL (used only if provider is ollama)
OLLAMA_CHAT_URL=http://localhost:11434/api/chat
# --- Local TTS Settings ---
PIPER_MODEL=./en_US-lessac-medium.onnx
(Note: If using Telnyx, provide your Telnyx API keys within the Twilio env vars for drop-in compatibility).
🖥 1. Zero-to-One Web GUI
You don't need to manually configure .env files or write code to start making calls. Autodial ships with a sleek, native Web Dashboard!
autodial gui
This instantly starts the server and opens http://localhost:8000 in your browser. From the dashboard, you can:
- Configure your Twilio/Telnyx keys and select your LLM Provider (OpenAI, Gemini, Mistral, Ollama).
- Initiate Calls visually by typing in the target number, context, and goals.
- View Transcripts of your AI's interactive sessions in real-time.
🗣 2. Natural Language CLI
You don't even need to write Python code to place intelligent calls. Autodial includes a powerful NLP-driven CLI that translates plain English into API actions!
Ensure your Autodial server is running in the background, then simply type:
autodial call bob at 613-444-0101 and ask how his day is going
The CLI uses your configured LLM to instantly extract the target phone number, the conversation context, and the goals, and then dispatches the call automatically.
🐍 3. Full Python Demo (The API Client)
The library includes a professional AutodialClient to make programmatic orchestration seamless.
demo.py
import time
from autodial import AutodialClient
# Connect to your local Autodial server
client = AutodialClient("http://localhost:8000")
def run_outbound_demo():
print("📞 Placing intelligent outbound call...")
# Scenario: Appointment Reminder with Guardrails
response = client.dial(
target_number="+15551234567",
context="Reminder for Dr. Smith's dental clinic.",
goals="Confirm the 2:00 PM slot today. Ask if they need directions.",
system_instructions="Always be polite. If the user is busy, offer to call back later. Keep responses short.",
callback_url="https://api.yourclinic.com/webhooks/call-results"
)
print(f"✅ Call Initiated: {response}")
def run_broadcast_demo():
print("📢 Initiating Mass Broadcast...")
# Scenario: Emergency Alert Broadcast
response = client.broadcast(
numbers=["+15550001", "+15550002", "+15550003"],
message="This is an automated alert from the city. Please evacuate immediately.",
callback_url="https://api.city.gov/logs"
)
print(f"✅ Broadcast Initiated: {response}")
if __name__ == "__main__":
run_outbound_demo()
time.sleep(5)
run_broadcast_demo()
📞 4. Handling Inbound Calls (Bidirectional)
Autodial isn't just for outbound dialing. It exposes an /incoming REST endpoint that automatically generates the required TwiML/TeXML to connect callers to your AI bot.
Setup Instructions:
- Log in to your Twilio or Telnyx Console.
- Navigate to your active Phone Number settings.
- Find the Webhook URL for incoming calls.
- Set it to
POST https://your-autodial-server.com/incoming
When a user dials your number, the provider hits the endpoint, receives the Media Stream instructions, and the AI answers immediately using your configured LLM_PROVIDER.
📡 API Reference
POST /dial
Initiates a single interactive AI session.
| Parameter | Type | Description |
|---|---|---|
to_number |
string |
Required. The target phone number in E.164 format. |
context |
string |
Detailed background info for the AI to understand the call's nature. |
goals |
string |
Specific outcomes or data points the AI should strive to achieve. |
keywords |
string |
Focus phrases for the transcription engine to prioritize. |
system_instructions |
string |
High-priority guardrails and behavioral rules for the session. |
callback_url |
string |
POST endpoint to receive the final JSON transcript and status. |
POST /incoming
A webhook endpoint for Twilio/Telnyx. Do not call this manually. It automatically returns <Connect><Stream .../> XML to start a bidirectional session.
⚡ Performance & Benchmarks
Autodial is built for extremely low-latency interactive voice response. When configured with GPU acceleration:
| Component | Pipeline | Typical Latency (End-to-End) |
|---|---|---|
| STT Engine | Faster-Whisper (base.en / int8 CUDA) |
~150 - 250ms |
| Intelligence | Local Ollama (llama3.2:3b) |
~300 - 600ms (Time to First Token) |
| Intelligence | Cloud (OpenAI gpt-4o) |
~400 - 800ms |
| TTS Engine | Local Piper TTS (ONNX) | ~50 - 100ms |
| Total Response Time | End-of-Speech to Audio Playback | < 1.0 Second Average |
Note: Benchmarks taken on an NVIDIA RTX 3050 Ti Laptop GPU. CPU fallback will add approximately 500-1000ms depending on processor generation.
🛡 License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file autodial-0.7.2.tar.gz.
File metadata
- Download URL: autodial-0.7.2.tar.gz
- Upload date:
- Size: 24.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
131e38d64f111eb0de6f05fb1db365c6ede64ca349d0982ba641818aea83813d
|
|
| MD5 |
4cb79a8f3dc6150184798b2eebe7caec
|
|
| BLAKE2b-256 |
7698584aec4eb1e2cabbdd025f36b8220209b574736dd361ffdc29bdd06a7a65
|
File details
Details for the file autodial-0.7.2-py3-none-any.whl.
File metadata
- Download URL: autodial-0.7.2-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b171a8de4e5b7f343abf339ccc3a18d0d9b4ea7582543088fba205a6768e1d1d
|
|
| MD5 |
8e408887bef255d55b11a330cd4ca55c
|
|
| BLAKE2b-256 |
1e6258d747159c2f691e1a834dc8b7dfd7879d17138ea7b8256a32ff9d1366ab
|