The large language model (LLM) — also referred to as generative AI — is the decision-making center. It takes the text from the speech-to-text engine, generates a response, and sends it to the text-to-speech engine to be spoken back. It can also take actions via tool/function calling.
Run language models entirely on your machine. No API keys, no data leaving your network. The quality and speed of local models will depend on how powerful your machine is — more RAM and a dedicated GPU allow you to run larger, more capable models.
# llama.cpp is pre-built at /opt/llama.cpp # Chat with a local LLM in the terminal /opt/llama.cpp/build/bin/llama-cli \ -m /opt/llama.cpp/models/Llama-3.2-1B-Instruct-Q4_K_M.gguf \ -cnv -p "You are a helpful assistant." # Try a smaller model /opt/llama.cpp/build/bin/llama-cli \ -m /opt/llama.cpp/models/qwen2.5-0.5b-instruct-q4_k_m.gguf \ -cnv -p "You are a helpful assistant." # Run with built-in web chat UI (like Ollama) /opt/llama.cpp/build/bin/llama-server \ -m /opt/llama.cpp/models/Llama-3.2-1B-Instruct-Q4_K_M.gguf \ --jinja --host 0.0.0.0 --port 8080 -c 0 # Open http://localhost:8080 in your browser for a full chat interface # Run as OpenAI-compatible API server (no chat UI) /opt/llama.cpp/build/bin/llama-server \ -m /opt/llama.cpp/models/Llama-3.2-1B-Instruct-Q4_K_M.gguf \ --host 0.0.0.0 --port 8080 -c 4096 # Any framework that works with OpenAI API works with this! # Use with Open WebUI, LibreChat, or your own applications
Have a suggestion for a cloud LLM provider to include here? Email us at [email protected]
A system prompt is the set of instructions you give to an LLM before it interacts with a user. It defines the model's personality, rules, capabilities, and boundaries — essentially telling it who it is and how to behave. Every LLM-powered application uses one, whether it's a chatbot, a coding assistant, or a voice agent. For voice agents specifically, system prompts need extra considerations because the output is spoken aloud, not read on a screen.
Earlier, we used -p "You are a helpful assistant." when chatting with llama.cpp — that's a system prompt too, just an extremely simple one. For a general-purpose chat, that's fine. But for a voice agent handling real calls, you need much more detail: rules about how to speak, what tools are available, guardrails for safety, and instructions for when things go wrong.
Voice agent system prompts need special considerations compared to text chatbots. Hover over each section to learn why it matters.
For a deeper dive into voice agent prompting, see the ElevenLabs Prompting Guide.
The secret to fast voice agents is streaming everywhere. Don't wait for the LLM to finish generating before sending to TTS. Stream token-by-token.
By streaming token-by-token, the TTS can start generating audio before the LLM has finished its response. This dramatically reduces the time-to-first-token — the caller starts hearing a response in under 500ms, even though the full phrase takes 1-2 seconds to finish saying. Without streaming, the caller would have to wait for the entire LLM response before hearing anything.
These examples chain an LLM response directly into TTS. Notice how you have to wait for the full LLM generation to complete before you hear anything:
# LLM → Piper TTS (non-streaming, fast but lower quality) time /opt/llama.cpp/build/bin/llama-simple \ -m /opt/llama.cpp/models/llama-3.2-3b-instruct-q4_k_m.gguf \ -p "Tell me a funny joke not about a chicken" \ 2>/dev/null \ | tail -n +2 \ | piper --model /opt/piper/models/en_US-lessac-medium.onnx --output_raw \ | aplay -r 22050 -f S16_LE # LLM → Kokoro TTS (non-streaming, slower but much higher quality) time /opt/llama.cpp/build/bin/llama-simple \ -m /opt/llama.cpp/models/llama-3.2-3b-instruct-q4_k_m.gguf \ -p "Tell me a funny joke not about a chicken" \ 2>/dev/null \ | tail -n +2 \ | kokoro \ | aplay -r 24000 -f S16_LE
On these laptops, you'll experience a 10-13 second delay of silence before hearing anything — imagine being on a phone call and waiting that long for a response.