Skip to content

Instantly share code, notes, and snippets.

View bajajcodes's full-sized avatar
🏠
Working from home

shubhambajaj bajajcodes

🏠
Working from home
View GitHub Profile
  1. Configuration in Assistant

    When creating or updating an assistant, you need to configure the voice parameter with a custom voice provider:

    {
      "voice": {
        "provider": "custom-voice",
        "server": {

"url": "https://your-custom-voice-service.com/endpoint",

A custom knowledge base in VAPI works by setting up an external endpoint (your server) that will receive webhook requests. When a user interacts with VAPI, the system will send knowledge base queries to your endpoint, and your server will need to respond with either relevant documents or a direct response message.

Detailed Solution

Step 1: Create a Custom Knowledge Base in VAPI

  1. In the VAPI API, create a new knowledge base
  2. Select "custom-knowledge-base" as the provider
  3. Configure the server details (URL endpoint that will receive webhook requests)

Step 2: Set Up Your Webhook Server

[Identity]
You are an AI virtual assistant designed to assist users by providing information and answering questions in various domains.
[Style]
- Maintain a friendly, conversational, and professional tone.
- Be concise, yet provide complete and relevant answers whenever possible.
- Use everyday language to ensure clarity.
[Response Guidelines]
- Limit responses to essential details while remaining informative.
[Identity]
You are an AI virtual assistant designed to assist users by providing information and answering questions in various domains.
[Style]
- Maintain a friendly, conversational, and professional tone.
- Be concise, yet provide complete and relevant answers whenever possible.
- Use everyday language to ensure clarity.
[Response Guidelines]
- Limit responses to essential details while remaining informative.
{
"message": {
"timestamp": 1739985064316,
"type": "tool-calls",
"tool_calls": [
{
"id": "call_hgKwprivWNkJU6To3oQUCSec",
"type": "function",
"function": {
"name": "sendSMS2",

LLM-Generated Output Formatting Guide

This document outlines the functionality and configuration of the LLM-generated output formatting system, designed to optimize text-to-speech conversion. The utility ensures natural pronunciation, consistent formatting across voice providers, and enhanced handling of technical content through customizable processing rules.


Key Components

  1. Format Plan
  • Enabled: Master toggle for formatting (default: true). Required for formatters to work, even when formattersEnabled is specified.
Squad Transfer Modes
Squad transfer modes determine how conversation history is handled when transferring between assistants within a squad.
## Available Modes
### 1. Rolling History (Default)
- Maintains the entire conversation history
- Appends the new assistant's system message after transfer
- Best for maintaining context continuity
{
"voice": {
"model": "eleven_flash_v2_5",
"voiceId": "",
"provider": "11labs"
},
"functions": null,
"model": {
"model": "gpt-3.5-turbo",

1. What Is Endpointing?

Imagine you’re talking to a virtual assistant. The system needs to know when you’ve finished speaking so it can process your request. That moment is called endpointing or "end of thought detection." Typically, the system waits a fixed amount of time after it senses silence, but sometimes you want it to be smarter.


2. Why Custom Endpointing Rules?

Sometimes the default waiting time isn’t ideal. For instance:

  • Shorter Wait: If the assistant asks a quick yes/no question like “Are you interested in a loan?”, you might want a very short pause.

Custom LLM with Vapi Integration: Setup, Tools Calling, and Testing

This guide walks you through what a Custom LLM is, why it’s awesome, and how to set it up with Vapi. We’ll cover how to generate content, trigger tool calls using three different methods, and test everything with simple cURL examples. Plus, you'll find a link to the complete code at the end.

1. What Is a Custom LLM and Why Use It?

A Custom LLM is more than just a text generator—it’s a conversational assistant that can call external functions, trigger processes, and handle special logic, all while chatting with your users. Think of it as your smart helper that not only answers questions but also takes actions.

Why use a Custom LLM?

  • Enhanced Functionality: It mixes natural language responses with actionable functions.