### Quickstart: Generate First Text-to-Speech with Python SDK Source: https://docs.smallest.ai/llms.txt Get started quickly with generating your first text-to-speech using Python and the Smallest AI API. This snippet demonstrates basic API usage. ```python from smallest_ai.waves import Client client = Client(api_key="YOUR_API_KEY") response = client.text_to_speech.create( model="aura", voice="en-US/male-1", text="Hello, this is a test.", ) with open("output.wav", "wb") as f: f.write(response.audio) ``` -------------------------------- ### Setup and Connect to vLLM Source: https://docs.smallest.ai/atoms/developer-guide/build/agents/llm/byom.mdx Instructions for installing vLLM and starting the inference server, followed by the Python configuration to connect an Atoms agent. ```bash pip install vllm python -m vllm.entrypoints.openai.api_server \ --model meta-llama/Llama-3-8B-Instruct \ --port 8000 ``` ```python from smallestai.atoms.agent.clients.openai import OpenAIClient llm = OpenAIClient( model="meta-llama/Llama-3-8B-Instruct", base_url="http://localhost:8000/v1", api_key="vllm" ) ``` -------------------------------- ### Waves TTS - Introduction and Quickstart Source: https://docs.smallest.ai/llms.txt Introduction to the Waves platform for real-time hyper-realistic text-to-speech and a quickstart guide for generating your first text-to-speech using the API. ```APIDOC ## Introduction to Waves TTS ### Description Waves is a platform designed to deliver real-time, hyper-realistic text-to-speech synthesis. ### Endpoint N/A (Conceptual Overview) ## Quickstart for Waves TTS ### Description This guide helps you get started quickly with generating your first text-to-speech output using the Smallest AI API, typically with Python. ### Method N/A (Conceptual Guide) ### Endpoint N/A (Conceptual Guide) ``` -------------------------------- ### Start Outbound Call (Python) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/start-an-outbound-call.mdx Example of how to start an outbound call using the Smallest AI Python SDK. ```APIDOC ## POST /atoms/v1/conversation/outbound ### Description Initiates an outbound call to a specified phone number using a designated agent. ### Method POST ### Endpoint /atoms/v1/conversation/outbound ### Parameters #### Request Body - **agent_id** (string) - Required - The ID of the agent to use for the call. - **phone_number** (string) - Required - The phone number to call. ### Request Example ```python from smallest_ai import SmallestAI client = SmallestAI( token="YOUR_TOKEN_HERE", ) client.atoms.calls.start_an_outbound_call( agent_id="60d0fe4f5311236168a109ca", phone_number="+1234567890", ) ``` ### Response #### Success Response (200) Details of the successful call initiation (specific fields not provided in example). #### Response Example (Response structure not detailed in the provided examples) ``` -------------------------------- ### Start Outbound Call (Go) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/start-an-outbound-call.mdx Example of how to start an outbound call using a direct HTTP POST request in Go. ```APIDOC ## POST /atoms/v1/conversation/outbound ### Description Initiates an outbound call to a specified phone number using a designated agent. ### Method POST ### Endpoint https://api.smallest.ai/atoms/v1/conversation/outbound ### Parameters #### Request Body - **agentId** (string) - Required - The ID of the agent to use for the call. - **phoneNumber** (string) - Required - The phone number to call. ### Request Example ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.smallest.ai/atoms/v1/conversation/outbound" payload := strings.NewReader("{\n \"agentId\": \"60d0fe4f5311236168a109ca\",\n \"phoneNumber\": \"+1234567890\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ### Response #### Success Response (200) Details of the successful call initiation (specific fields not provided in example). #### Response Example (Response structure not detailed in the provided examples) ``` -------------------------------- ### Start Outbound Call (Swift) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/start-an-outbound-call.mdx Example of how to start an outbound call using Swift's URLSession. ```APIDOC ## POST /atoms/v1/conversation/outbound ### Description Initiates an outbound call to a specified phone number using a designated agent. ### Method POST ### Endpoint https://api.smallest.ai/atoms/v1/conversation/outbound ### Parameters #### Request Body - **agentId** (string) - Required - The ID of the agent to use for the call. - **phoneNumber** (string) - Required - The phone number to call. ### Request Example ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = [ "agentId": "60d0fe4f5311236168a109ca", "phoneNumber": "+1234567890" ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/conversation/outbound")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Response #### Success Response (200) Details of the successful call initiation (specific fields not provided in example). #### Response Example (Response structure not detailed in the provided examples) ``` -------------------------------- ### Proper agent session setup with wait_until_complete Source: https://docs.smallest.ai/atoms/developer-guide/operate/testing-debugging/common-issues.mdx Ensure the agent session is properly started and completed by calling `await session.start()` and `await session.wait_until_complete()` in the setup function to prevent conversations from ending prematurely. ```python async def setup(session: AgentSession): agent = MyAgent() session.add_node(agent) await session.start() await session.wait_until_complete() # Do not forget this ``` -------------------------------- ### Start Outbound Call (Ruby) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/start-an-outbound-call.mdx Example of how to start an outbound call using Ruby's Net::HTTP library. ```APIDOC ## POST /atoms/v1/conversation/outbound ### Description Initiates an outbound call to a specified phone number using a designated agent. ### Method POST ### Endpoint https://api.smallest.ai/atoms/v1/conversation/outbound ### Parameters #### Request Body - **agentId** (string) - Required - The ID of the agent to use for the call. - **phoneNumber** (string) - Required - The phone number to call. ### Request Example ```ruby require 'uri' require 'net/http' url = URI("https://api.smallest.ai/atoms/v1/conversation/outbound") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"agentId\": \"60d0fe4f5311236168a109ca\",\n \"phoneNumber\": \"+1234567890\"\n}" response = http.request(request) puts response.read_body ``` ### Response #### Success Response (200) Details of the successful call initiation (specific fields not provided in example). #### Response Example (Response structure not detailed in the provided examples) ``` -------------------------------- ### Start Outbound Call (TypeScript) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/start-an-outbound-call.mdx Example of how to start an outbound call using the Smallest AI TypeScript SDK. ```APIDOC ## POST /atoms/v1/conversation/outbound ### Description Initiates an outbound call to a specified phone number using a designated agent. ### Method POST ### Endpoint /atoms/v1/conversation/outbound ### Parameters #### Request Body - **agentId** (string) - Required - The ID of the agent to use for the call. - **phoneNumber** (string) - Required - The phone number to call. ### Request Example ```typescript import { SmallestAIClient } from "smallest-ai"; async function main() { const client = new SmallestAIClient({ token: "YOUR_TOKEN_HERE", }); await client.atoms.calls.startAnOutboundCall({ agentId: "60d0fe4f5311236168a109ca", phoneNumber: "+1234567890", }); } main(); ``` ### Response #### Success Response (200) Details of the successful call initiation (specific fields not provided in example). #### Response Example (Response structure not detailed in the provided examples) ``` -------------------------------- ### Start Outbound Call (Java) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/start-an-outbound-call.mdx Example of how to start an outbound call using the Unirest library in Java. ```APIDOC ## POST /atoms/v1/conversation/outbound ### Description Initiates an outbound call to a specified phone number using a designated agent. ### Method POST ### Endpoint https://api.smallest.ai/atoms/v1/conversation/outbound ### Parameters #### Request Body - **agentId** (string) - Required - The ID of the agent to use for the call. - **phoneNumber** (string) - Required - The phone number to call. ### Request Example ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.smallest.ai/atoms/v1/conversation/outbound") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"agentId\": \"60d0fe4f5311236168a109ca\",\n \"phoneNumber\": \"+1234567890\"\n}") .asString(); ``` ### Response #### Success Response (200) Details of the successful call initiation (specific fields not provided in example). #### Response Example (Response structure not detailed in the provided examples) ``` -------------------------------- ### Install EBS CSI Driver for Kubernetes Source: https://docs.smallest.ai/waves/self-host/kubernetes-setup/aws/eks-setup.mdx Guides for installing the Amazon EBS CSI (Container Storage Interface) driver, which is necessary for persistent volumes in Kubernetes. It provides instructions for installation using eksctl and through the AWS Management Console. ```bash eksctl create addon \ --name aws-ebs-csi-driver \ --cluster smallest-cluster \ --region us-east-1 ``` ```bash kubectl get pods -n kube-system -l app=ebs-csi-controller ``` -------------------------------- ### Install Pipecat with Full Voice Agent Support Source: https://docs.smallest.ai/waves/documentation/integrations/pipecat.mdx Install pipecat-ai with extras for Smallest AI, Daily, OpenAI, Deepgram, and Silero to run the full voice-agent example. ```bash pip install "pipecat-ai[smallest,daily,openai,deepgram,silero]" ``` -------------------------------- ### Complete AgentSession Setup and Lifecycle Management Source: https://docs.smallest.ai/atoms/developer-guide/get-started/core-concepts/sessions.mdx A comprehensive example illustrating node initialization, graph construction, event hook registration, and launching the application using AtomsApp. ```python from smallestai.atoms.agent.session import AgentSession from smallestai.atoms.agent.server import AtomsApp async def setup(session: AgentSession): # 1. Initialize Nodes agent = SalesAgent() tracker = StatsTracker() # 2. Build Graph session.add_node(tracker) session.add_node(agent) session.add_edge(tracker, agent) # Events go Tracker -> Agent # 3. Register Hooks @session.on_event("system.control.interrupt") async def on_interrupt(session, event): print("User interrupted the agent!") # 4. Launch await session.start() await session.wait_until_complete() if __name__ == "__main__": app = AtomsApp(setup_handler=setup) app.run() ``` -------------------------------- ### Install and Verify AWS CLI, eksctl, and kubectl Source: https://docs.smallest.ai/waves/self-host/kubernetes-setup/aws/eks-setup.mdx Commands to install and verify the necessary command-line tools for managing AWS EKS clusters on macOS. ```bash aws --version aws configure brew install eksctl eksctl version brew install kubectl ``` -------------------------------- ### Setup and Connect to Ollama Source: https://docs.smallest.ai/atoms/developer-guide/build/agents/llm/byom.mdx Instructions for installing and running Ollama locally, followed by the Python configuration to connect an Atoms agent to the Ollama server. ```bash # Install Ollama curl -fsSL https://ollama.com/install.sh | sh # Pull a model ollama pull llama3 # Start the server (runs on port 11434) ollama serve ``` ```python from smallestai.atoms.agent.clients.openai import OpenAIClient llm = OpenAIClient( model="llama3", base_url="http://localhost:11434/v1", api_key="ollama" # Doesn't require a real key ) ``` -------------------------------- ### Start Outbound Call (PHP) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/start-an-outbound-call.mdx Example of how to start an outbound call using Guzzle HTTP client in PHP. ```APIDOC ## POST /atoms/v1/conversation/outbound ### Description Initiates an outbound call to a specified phone number using a designated agent. ### Method POST ### Endpoint https://api.smallest.ai/atoms/v1/conversation/outbound ### Parameters #### Request Body - **agentId** (string) - Required - The ID of the agent to use for the call. - **phoneNumber** (string) - Required - The phone number to call. ### Request Example ```php request('POST', 'https://api.smallest.ai/atoms/v1/conversation/outbound', [ 'body' => '{ "agentId": "60d0fe4f5311236168a109ca", "phoneNumber": "+1234567890" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ### Response #### Success Response (200) Details of the successful call initiation (specific fields not provided in example). #### Response Example (Response structure not detailed in the provided examples) ``` -------------------------------- ### Install Docker Engine Source: https://docs.smallest.ai/waves/self-host/docker-setup/stt-deployment/prerequisites/software-requirements.mdx Installation scripts for Docker Engine and associated plugins on Ubuntu and CentOS/RHEL systems. Includes repository setup, package installation, and user group configuration. ```bash # Ubuntu sudo apt-get update sudo apt-get install -y ca-certificates curl gnupg sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo usermod -aG docker $USER newgrp docker ``` ```bash # CentOS/RHEL sudo yum install -y yum-utils sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo systemctl start docker sudo systemctl enable docker sudo usermod -aG docker $USER newgrp docker ``` -------------------------------- ### Install Atoms MCP Server via Shell Script Source: https://docs.smallest.ai/atoms/mcp/getting-started/manual-setup.mdx Automated installation scripts for macOS/Linux and Windows to set up the MCP server without external dependencies. ```bash curl -fsSL https://raw.githubusercontent.com/smallest-inc/mcp-server/main/install.sh | bash ``` ```powershell irm https://raw.githubusercontent.com/smallest-inc/mcp-server/main/install.ps1 | iex ``` -------------------------------- ### Install NVIDIA Device Plugin for Kubernetes Source: https://docs.smallest.ai/waves/self-host/kubernetes-setup/aws/eks-setup.mdx Instructions for installing the NVIDIA device plugin, which enables GPU scheduling in Kubernetes. It covers installation via Helm by enabling the gpu-operator in values.yaml and a manual installation using a YAML manifest. ```yaml gpu-operator: enabled: true ``` ```bash kubectl create -f https://raw.githubusercontent.com/NVIDIA/k8s-device-plugin/v0.14.0/nvidia-device-plugin.yml ``` ```bash kubectl get pods -n kube-system | grep nvidia ``` -------------------------------- ### Start Outbound Call (C#) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/start-an-outbound-call.mdx Example of how to start an outbound call using RestSharp in C#. ```APIDOC ## POST /atoms/v1/conversation/outbound ### Description Initiates an outbound call to a specified phone number using a designated agent. ### Method POST ### Endpoint https://api.smallest.ai/atoms/v1/conversation/outbound ### Parameters #### Request Body - **agentId** (string) - Required - The ID of the agent to use for the call. - **phoneNumber** (string) - Required - The phone number to call. ### Request Example ```csharp using RestSharp; var client = new RestClient("https://api.smallest.ai/atoms/v1/conversation/outbound"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"agentId\": \"60d0fe4f5311236168a109ca\",\n \"phoneNumber\": \"+1234567890\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ### Response #### Success Response (200) Details of the successful call initiation (specific fields not provided in example). #### Response Example (Response structure not detailed in the provided examples) ``` -------------------------------- ### Install Node.js Websockets Source: https://docs.smallest.ai/waves/documentation/speech-to-text-pulse/realtime-web-socket/code-examples.mdx Install the ws library for Node.js. ```bash npm install ws ``` -------------------------------- ### Install Project Requirements Source: https://docs.smallest.ai/waves/documentation/integrations/live-kit.mdx Install all necessary Python packages listed in the requirements.txt file. ```bash pip install -r requirements.txt ``` -------------------------------- ### Retrieve Knowledge Base Items via HTTP GET (Go) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/knowledge-base/get-all-knowledge-base-items.mdx This Go example illustrates how to retrieve knowledge base items using a direct HTTP GET request to the Smallest AI API. It requires a Bearer token for authentication and specifies the knowledge base ID in the URL. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.smallest.ai/atoms/v1/knowledgebase/id/items" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Fetch Knowledge Bases using HTTP Requests Source: https://docs.smallest.ai/atoms/api-reference/api-reference/knowledge-base/get-all-knowledge-bases.mdx Examples showing how to fetch knowledge bases using direct HTTP GET requests. These snippets require an authorization token and handle the HTTP communication directly. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.smallest.ai/atoms/v1/knowledgebase" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.smallest.ai/atoms/v1/knowledgebase") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.smallest.ai/atoms/v1/knowledgebase") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.smallest.ai/atoms/v1/knowledgebase', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.smallest.ai/atoms/v1/knowledgebase"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/knowledgebase")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Install Smallest AI SDK Source: https://docs.smallest.ai/atoms/developer-guide/get-started/quickstart.mdx Install the necessary package via pip. ```bash pip install smallestai ``` -------------------------------- ### Install Python Websockets Source: https://docs.smallest.ai/waves/documentation/speech-to-text-pulse/realtime-web-socket/code-examples.mdx Install the websockets library for Python. ```bash pip install websockets ``` -------------------------------- ### Fetch Organization Details via HTTP Request (Go) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/organization/get-organization-details.mdx This Go example makes a direct HTTP GET request to the Smallest AI API to retrieve organization details. It uses the standard Go 'net/http' package and requires an API token. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.smallest.ai/atoms/v1/organization" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Retrieve Webhooks via HTTP GET Request (Go) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/webhooks/get-webhooks.mdx Provides a Go example for making a direct HTTP GET request to the Smallest AI API to retrieve webhooks. This method requires manual header management and response parsing. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.smallest.ai/atoms/v1/webhook" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` -------------------------------- ### Run Voice Agent Example with Specific Daily Room Source: https://docs.smallest.ai/waves/documentation/integrations/pipecat.mdx Connect the voice agent example to a specific Daily room by providing its URL. ```bash python examples/foundational/07zl-interruptible-smallest.py --url https://your-domain.daily.co/your-room ``` -------------------------------- ### Retrieve Webhooks via HTTP GET Request (Java) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/webhooks/get-webhooks.mdx A Java example using the Unirest library to make an HTTP GET request to fetch webhooks from the Smallest AI API. Demonstrates setting the Authorization header. ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.smallest.ai/atoms/v1/webhook") .header("Authorization", "Bearer ") .asString(); ``` -------------------------------- ### System Diagnostic Checklists Source: https://docs.smallest.ai/waves/self-host/troubleshooting/debugging-guide.mdx Standardized commands for troubleshooting pod startup failures, resource allocation issues, and performance bottlenecks. ```bash kubectl describe pod | grep -A 10 "Events" kubectl get secrets -n smallest kubectl describe secret kubectl describe node | grep "Allocated resources" -A 10 kubectl logs --all-containers=true kubectl top pods -n smallest kubectl top nodes kubectl exec -- nvidia-smi kubectl get hpa kubectl describe hpa lightning-asr ``` -------------------------------- ### Verify Installation Source: https://docs.smallest.ai/waves/self-host/docker-setup/tts-deployment/quick-start.mdx Check the status of running containers. ```bash docker compose ps ``` ```text NAME IMAGE STATUS api-server quay.io/smallestinc/self-hosted-api-server Up license-proxy quay.io/smallestinc/license-proxy Up lightning-tts quay.io/smallestinc/lightning-tts Up redis-server redis:7-alpine Up (healthy) ``` -------------------------------- ### Install EFS CSI Driver for Kubernetes Source: https://docs.smallest.ai/waves/self-host/kubernetes-setup/aws/eks-setup.mdx Steps to install the Amazon EFS CSI driver, recommended for shared model storage across pods. This involves creating an IAM policy, creating an IAM service account with the necessary permissions, and deploying the driver. ```bash curl -o iam-policy.json https://raw.githubusercontent.com/kubernetes-sigs/aws-efs-csi-driver/master/docs/iam-policy-example.json aws iam create-policy \ --policy-name AmazonEKS_EFS_CSI_Driver_Policy \ --policy-document file://iam-policy.json ``` ```bash eksctl create iamserviceaccount \ --cluster smallest-cluster \ --region us-east-1 \ --namespace kube-system \ --name efs-csi-controller-sa \ --attach-policy-arn arn:aws:iam::YOUR_ACCOUNT_ID:policy/AmazonEKS_EFS_CSI_Driver_Policy \ --approve ``` -------------------------------- ### Install Livekit Plugin Source: https://docs.smallest.ai/waves/documentation/integrations/live-kit.mdx Make the install_plugin.sh script executable and run it to set up the Livekit plugin. ```bash chmod +x install_plugin.sh ./install_plugin.sh ``` -------------------------------- ### Create a Knowledge Base with SmallestAI Source: https://docs.smallest.ai/atoms/api-reference/api-reference/knowledge-base/create-a-knowledge-base.mdx Demonstrates how to initialize a client and create a new knowledge base. This operation requires authentication and accepts a name parameter for the new resource. ```typescript import { SmallestAIClient } from "smallest-ai"; async function main() { const client = new SmallestAIClient({ token: "YOUR_TOKEN_HERE", }); await client.atoms.knowledgeBase.createAKnowledgeBase({ name: "string", }); } main(); ``` ```python from smallest_ai import SmallestAI client = SmallestAI( token="YOUR_TOKEN_HERE", ) client.atoms.knowledge_base.create_a_knowledge_base( name="string", ) ``` ```go package main import ( "fmt" "strings" "net/http" "io" ) func main() { url := "https://api.smallest.ai/atoms/v1/knowledgebase" payload := strings.NewReader("{\n \"name\": \"string\"\n}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Authorization", "Bearer ") req.Header.Add("Content-Type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.smallest.ai/atoms/v1/knowledgebase") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/json' request.body = "{\n \"name\": \"string\"\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://api.smallest.ai/atoms/v1/knowledgebase") .header("Authorization", "Bearer ") .header("Content-Type", "application/json") .body("{\n \"name\": \"string\"\n}") .asString(); ``` ```php request('POST', 'https://api.smallest.ai/atoms/v1/knowledgebase', [ 'body' => '{ "name": "string" }', 'headers' => [ 'Authorization' => 'Bearer ', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.smallest.ai/atoms/v1/knowledgebase"); var request = new RestRequest(Method.POST); request.AddHeader("Authorization", "Bearer "); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"name\": \"string\"\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "Bearer ", "Content-Type": "application/json" ] let parameters = ["name": "string"] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/knowledgebase")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Install Docker on CentOS/RHEL (Bash) Source: https://docs.smallest.ai/waves/self-host/docker-setup/tts-deployment/prerequisites/software-requirements.mdx Installs Docker Engine, CLI, containerd.io, and plugins on CentOS/RHEL systems. Requires `sudo` privileges and internet access. Starts and enables the Docker service. ```bash sudo yum install -y yum-utils sudo yum-config-manager --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo sudo yum install -y docker-ce docker-ce-cli containerd.io \ docker-buildx-plugin docker-compose-plugin sudo systemctl start docker sudo systemctl enable docker sudo usermod -aG docker $USER newgrp docker ``` -------------------------------- ### Create Project Directory Source: https://docs.smallest.ai/waves/self-host/docker-setup/tts-deployment/quick-start.mdx Initialize the working directory for the deployment. ```bash mkdir -p ~/smallest-tts cd ~/smallest-tts ``` -------------------------------- ### Fetch Organization Details via HTTP Request (Ruby) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/organization/get-organization-details.mdx This Ruby example uses the 'net/http' library to perform an HTTP GET request for organization details from the Smallest AI API. An API token is necessary for authentication. ```ruby require 'uri' require 'net/http' url = URI("https://api.smallest.ai/atoms/v1/organization") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Retrieve Knowledge Base Items via HTTP GET (Ruby) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/knowledge-base/get-all-knowledge-base-items.mdx This Ruby example shows how to fetch knowledge base items using an HTTP GET request. It requires a Bearer token for authentication and includes the knowledge base ID in the API endpoint. ```ruby require 'uri' require 'net/http' url = URI("https://api.smallest.ai/atoms/v1/knowledgebase/id/items") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` -------------------------------- ### Setup agent with tool discovery and schema Source: https://docs.smallest.ai/atoms/developer-guide/operate/testing-debugging/common-issues.mdx Discover tools using `ToolRegistry` and pass their schemas to the LLM's chat call to enable tool usage. Ensure the tool has a clear docstring and a descriptive name. ```python def __init__(self): super().__init__(name="my-agent") self.tool_registry = ToolRegistry() self.tool_registry.discover(self) # Must call this self.tool_schemas = self.tool_registry.get_schemas() # Must get schemas async def generate_response(self): response = await self.llm.chat( messages=self.context.messages, tools=self.tool_schemas, # Must pass schemas stream=True ) ``` -------------------------------- ### Deploy Agent to Platform Source: https://docs.smallest.ai/atoms/developer-guide/get-started/quickstart.mdx Commands for authentication, initialization, and deployment to the Smallest AI cloud. ```bash smallestai auth login ``` ```bash smallestai agent init ``` ```bash smallestai agent deploy --entry-point main.py ``` -------------------------------- ### Retrieve Events via HTTP GET Request (Python, JavaScript, Go, Ruby, Java, PHP, C#, Swift) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/calls/subscribe-to-live-call-events-sse.mdx These examples demonstrate how to make an HTTP GET request to the Smallest AI API to retrieve events. They cover multiple programming languages and show how to include the necessary authentication token and call ID in the request. Ensure you replace '' with your actual API token. ```python import requests url = "https://api.smallest.ai/atoms/v1/events" querystring = {"callId":"CALL-1758124225863-80752e"} headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript const url = 'https://api.smallest.ai/atoms/v1/events?callId=CALL-1758124225863-80752e'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.smallest.ai/atoms/v1/events?callId=CALL-1758124225863-80752e" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.smallest.ai/atoms/v1/events?callId=CALL-1758124225863-80752e") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.smallest.ai/atoms/v1/events?callId=CALL-1758124225863-80752e") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.smallest.ai/atoms/v1/events?callId=CALL-1758124225863-80752e', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ?> ``` ```csharp using RestSharp; var client = new RestClient("https://api.smallest.ai/atoms/v1/events?callId=CALL-1758124225863-80752e"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/events?callId=CALL-1758124225863-80752e")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Implement Pre-Call API Request Source: https://docs.smallest.ai/atoms/atoms-platform/conversational-flow-agents/workflow-tab/node-types.mdx An example of a GET request to a CRM endpoint and the corresponding response mapping to variables for agent personalization. ```http GET https://crm.example.com/lookup?phone={{caller_phone}} Response Mapping: $.customer_name → customer_name $.last_ticket → last_issue $.tier → account_tier ``` -------------------------------- ### Fetch Organization Details via HTTP Request (Swift) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/organization/get-organization-details.mdx This Swift example shows how to make an HTTP GET request to retrieve organization details using URLSession. It sets up the request headers, including the authorization token. ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/organization")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Wire Application Entry Point Source: https://docs.smallest.ai/atoms/developer-guide/get-started/quickstart.mdx Initialize the AtomsApp and define the startup handler to register the agent. ```python from smallestai.atoms.agent.server import AtomsApp from smallestai.atoms.agent.session import AgentSession from my_agent import MyAgent async def on_start(session: AgentSession): session.add_node(MyAgent()) await session.start() await session.wait_until_complete() if __name__ == "__main__": app = AtomsApp(setup_handler=on_start) app.run() ``` -------------------------------- ### Example WebSocket URL for Fast Turn-Taking Source: https://docs.smallest.ai/waves/documentation/speech-to-text-pulse/features/end-of-utterance-timeout.mdx This example demonstrates a WebSocket URL configured for aggressive turn-taking, suitable for voice agents that require immediate responses after short silences. ```bash wss://api.smallest.ai/waves/v1/pulse/get_text?language=en&encoding=linear16&sample_rate=16000&eou_timeout_ms=300 ``` -------------------------------- ### Lead Qualification Example Source: https://docs.smallest.ai/atoms/atoms-platform/conversational-flow-agents/workflow-tab/conditions.mdx Example of routing leads based on budget. Uses variable-based conditions and a fallback. ```text [Ask Budget] "What's your approximate budget for this project?" → Store response as {{budget}} Branches: ├── {{budget}} >= 50000 → [Enterprise Path] ├── {{budget}} >= 10000 → [Professional Path] ├── {{budget}} >= 1000 → [Starter Path] └── "Anything else" → [Self-Serve Resources] ``` -------------------------------- ### Fetch Organization Details via HTTP Request (PHP) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/organization/get-organization-details.mdx This PHP example uses the Guzzle HTTP client to send a GET request for organization details. It requires the Guzzle library and your API token for authorization. ```php request('GET', 'https://api.smallest.ai/atoms/v1/organization', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` -------------------------------- ### Fetch Organization Details using Smallest AI SDK (Python) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/organization/get-organization-details.mdx This Python example demonstrates initializing the Smallest AI client and fetching organization details. It depends on the 'smallest-ai' library and requires an API token. ```python from smallest_ai import SmallestAI client = SmallestAI( token="YOUR_TOKEN_HERE", ) client.atoms.organization.get_organization_details() ``` -------------------------------- ### Fetch Organization Details via HTTP Request (C#) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/organization/get-organization-details.mdx This C# example demonstrates fetching organization details using the RestSharp library. It involves creating a RestClient, a GET request, and adding the authorization header with your token. ```csharp using RestSharp; var client = new RestClient("https://api.smallest.ai/atoms/v1/organization"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` -------------------------------- ### Get Campaign by ID using HTTP Requests (Go, Ruby, Java, PHP, C#, Swift) Source: https://docs.smallest.ai/atoms/api-reference/api-reference/campaigns/get-a-campaign.mdx Demonstrates how to retrieve campaign data by making direct HTTP GET requests to the Smallest AI API endpoint. These examples cover various languages and show how to set the 'Authorization' header with a bearer token. ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.smallest.ai/atoms/v1/campaign/id" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.smallest.ai/atoms/v1/campaign/id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://api.smallest.ai/atoms/v1/campaign/id") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'https://api.smallest.ai/atoms/v1/campaign/id', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.smallest.ai/atoms/v1/campaign/id"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://api.smallest.ai/atoms/v1/campaign/id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` -------------------------------- ### Support Routing Example Source: https://docs.smallest.ai/atoms/atoms-platform/conversational-flow-agents/workflow-tab/conditions.mdx Example of routing a support call based on the user's issue type. Includes natural language and fallback conditions. ```text [Ask Issue Type] "I'm here to help! Are you calling about billing, technical support, or something else?" Branches: ├── "User asks about billing" → [Billing Flow] ├── "User has technical issue" → [Technical Flow] ├── "User wants to speak to someone" → [Transfer Call] └── "Anything else" → [Clarify and Re-ask] ``` -------------------------------- ### Fetch Knowledge Bases using Smallest AI SDKs Source: https://docs.smallest.ai/atoms/api-reference/api-reference/knowledge-base/get-all-knowledge-bases.mdx Examples demonstrating how to retrieve all knowledge bases using the official Smallest AI SDKs. These snippets require authentication with a valid token. ```typescript import { SmallestAIClient } from "smallest-ai"; async function main() { const client = new SmallestAIClient({ token: "YOUR_TOKEN_HERE", }); await client.atoms.knowledgeBase.getAllKnowledgeBases(); } main(); ``` ```python from smallest_ai import SmallestAI client = SmallestAI( token="YOUR_TOKEN_HERE", ) client.atoms.knowledge_base.get_all_knowledge_bases() ``` -------------------------------- ### Keyword Boosting Examples Source: https://docs.smallest.ai/waves/documentation/speech-to-text-pulse/features/keyword-boosting.mdx Examples of boosting specific domain terms or names in the WebSocket connection URL. ```text wss://api.smallest.ai/waves/v1/pulse/get_text?language=en&encoding=linear16&sample_rate=16000&keywords=Jensen:4,NVIDIA:5,Blackwell:6,CUDA:3 ``` ```text wss://api.smallest.ai/waves/v1/pulse/get_text?language=en&encoding=linear16&sample_rate=16000&keywords=Anthropic:5,Claude:4,Sonnet:3 ``` -------------------------------- ### Configure Environment Variables Source: https://docs.smallest.ai/waves/documentation/integrations/vonage.mdx Create a .env file in the project directory to store necessary API keys for Smallest.ai and Vonage. ```bash SMALLEST_API_KEY=... VONAGE_APPLICATION_ID=... ```