### Start Ollama Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-ollama.md Starts the Ollama server process, making it available to serve AI models. This command should be run after installation. ```bash ollama serve ``` -------------------------------- ### Install Project Dependencies and Start Development Server Source: https://github.com/semperai/amica/blob/master/docs/contributing/setup-dev-env.md Installs Node.js dependencies for the Amica project and starts the development server. Requires nvm to be installed and configured. ```shell npm install npm run dev ``` -------------------------------- ### Manual Setup: Install and Run Coqui TTS Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-coqui.md Navigates to the cloned TTS directory, installs Coqui TTS using 'make install', and then runs the local TTS server with a specified model. ```bash cd TTS && make install python3 TTS/server/server.py --model_name tts_models/en/vctk/vits ``` -------------------------------- ### Start Piper Server Manually (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-piper.md Executes the Piper installer script, which handles downloading Piper, installing sample voices, and starting the Piper server. This is part of the manual setup method. ```bash ./piper_installer.sh ``` -------------------------------- ### Docker Setup: Install Flask CORS and Run Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-coqui.md Installs Flask CORS within the running Docker container and then starts the Coqui TTS server. This is done after entering the container. ```bash pip install flask_cors python3 TTS/server/server.py --model_name tts_models/en/vctk/vits ``` -------------------------------- ### Manual Setup: Clone Coqui TTS Repository Source: https://github.com/semperai/amica/blob/master/docs/guides/using-coqui.md Clones the Coqui TTS repository from GitHub to your local machine. This is a prerequisite for manual installation. ```bash git clone https://github.com/coqui-ai/TTS.git ``` -------------------------------- ### Start Amica Development Server Source: https://github.com/semperai/amica/blob/master/docs/contributing/setup-dev-env.md Starts the Amica development server, which includes watching for file changes and automatically rebuilding the project as you code. ```shell npm run dev ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/semperai/amica/blob/master/README.md This command installs all the necessary Node.js packages required for the Amica project to run. It should be executed in the root directory of the cloned repository. ```bash npm install ``` -------------------------------- ### Manual Setup: Install Coqui TTS Dependencies Source: https://github.com/semperai/amica/blob/master/docs/guides/using-coqui.md Installs necessary system and Python dependencies for Coqui TTS using Homebrew, pip, and Conda. Ensure you have Python 3.10 and the 'coqui' Conda environment activated. ```bash brew install mecab espeak pip install numpy==1.21.6 flask_cors conda install scipy scikit-learn Cython ``` -------------------------------- ### Start Kokoro TTS FastAPI Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-kokoro.md Starts the FastAPI server for Kokoro TTS. This command assumes the Python environment is activated and dependencies are installed. ```bash python server.py ``` -------------------------------- ### Install and Run Amica Project Source: https://context7.com/semperai/amica/llms.txt This section details the steps to clone the Amica repository, install its dependencies, and run the development server. It also includes commands for building the project for production and creating a desktop application using Tauri. ```bash # Clone the repository git clone git@github.com:semperai/amica.git cd amica # Install dependencies npm install # Start development server npm run dev # Application will be available at http://localhost:3000 # Build for production npm run build npm run start # Build desktop application with Tauri npm run tauri dev ``` -------------------------------- ### Setup Three.js Viewer and Load VRM Model Source: https://context7.com/semperai/amica/llms.txt Initializes a Three.js WebGL renderer, scene, camera, and lighting. It also sets up OrbitControls for camera manipulation and loads a VRM model. Includes functionality for capturing screenshots and starting video recording. ```typescript import * as THREE from "three"; import { OrbitControls } from "three/examples/jsm/controls/OrbitControls"; class Viewer { public renderer?: THREE.WebGLRenderer; public model?: Model; private scene?: THREE.Scene; private camera?: THREE.PerspectiveCamera; async setup(canvas: HTMLCanvasElement): Promise { const parentElement = canvas.parentElement; const width = parentElement?.clientWidth || canvas.width; const height = parentElement?.clientHeight || canvas.height; // Create renderer const renderer = new THREE.WebGLRenderer({ canvas, alpha: true, antialias: true, powerPreference: "high-performance", }); this.renderer = renderer; renderer.setSize(width, height); renderer.setPixelRatio(window.devicePixelRatio); renderer.xr.enabled = true; // WebXR support // Create scene this.scene = new THREE.Scene(); // Add lighting const directionalLight = new THREE.DirectionalLight(0xffffff, 0.6); directionalLight.position.set(1.0, 1.0, 1.0).normalize(); this.scene.add(directionalLight); const ambientLight = new THREE.AmbientLight(0xffffff, 2); this.scene.add(ambientLight); // Create camera this.camera = new THREE.PerspectiveCamera(20.0, width / height, 0.1, 20.0); this.camera.position.set(0, 8.5, 3.5); // Add orbit controls const controls = new OrbitControls(this.camera, renderer.domElement); controls.screenSpacePanning = true; controls.minDistance = 0.5; controls.maxDistance = 4; // Start render loop renderer.setAnimationLoop(() => this.update()); } async loadVrm(url: string): Promise { if (this.model?.vrm) { this.unloadVRM(); } this.model = new Model(this.camera || new THREE.Object3D()); await this.model.loadVRM(url); if (this.model?.vrm) { this.scene!.add(this.model.vrm.scene); this.resetCamera(); } } resetCamera(): void { const headNode = this.model?.vrm?.humanoid.getNormalizedBoneNode("head"); if (headNode) { const headPos = headNode.getWorldPosition(new THREE.Vector3()); this.camera?.position.setY(headPos.y); } } // Capture screenshot getScreenshotBlob(callback: BlobCallback): void { this.renderer!.domElement.toBlob(callback, "image/jpeg"); } // Start video recording startRecording(): void { const stream = this.renderer!.domElement.captureStream(60); this.mediaRecorder = new MediaRecorder(stream, { mimeType: 'video/webm;codecs=vp9', videoBitsPerSecond: 8000000, }); this.mediaRecorder.start(); } update(): void { const delta = this.clock.getDelta(); this.model?.update(delta); this.renderer!.render(this.scene!, this.camera!); } } // Usage const canvas = document.querySelector('canvas')!; const viewer = new Viewer(); await viewer.setup(canvas); await viewer.loadVrm("/vrm/AvatarSample_A.vrm"); ``` -------------------------------- ### Start Oobabooga API Server (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-oobabooga.md Starts the Oobabooga text generation web UI server with API enabled. This command is essential for connecting the client to the Oobabooga backend. ```bash python server.py --api ``` -------------------------------- ### Run AllTalk Setup Script (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-alltalk.md Executes the AllTalk setup script. The specific command differs slightly between Windows and Linux environments. ```bash atsetup.bat ``` ```bash ./atsetup.bat ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/semperai/amica/blob/master/docs/guides/using-kokoro.md Installs all the necessary Python packages listed in the 'requirements.txt' file. This ensures the Kokoro TTS server has all its dependencies met. ```bash pip install -r requirements.txt ``` -------------------------------- ### Start Moshi Server with Uvicorn Source: https://github.com/semperai/amica/blob/master/docs/guides/using-moshi.md Starts the Moshi server using Uvicorn. The command differs based on whether the server is running on Runpod (accessible externally) or a local machine (accessible internally). ```bash # For Runpod: uvicorn moshi_service:app --host 0.0.0.0 --port 8000 ``` ```bash # For your own computer: uvicorn moshi_service:app --host 127.0.0.1 --port 8000 ``` -------------------------------- ### Install Ollama on Linux/WSL2 Source: https://github.com/semperai/amica/blob/master/docs/guides/using-ollama.md Installs Ollama on Linux and Windows Subsystem for Linux 2 environments using a curl script. This is the primary method for server-side setup on these platforms. ```bash curl https://ollama.ai/install.sh | sh ``` -------------------------------- ### Clone Amica Repository Source: https://github.com/semperai/amica/blob/master/docs/contributing/setup-dev-env.md Clones the Amica repository from GitHub. This is the first step to get the project code onto your local machine. ```shell git clone https://github.com/semperai/amica.git ``` -------------------------------- ### Run KoboldCpp Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-koboldcpp.md Starts the KoboldCpp inference server with a specified language model. This command requires the path to the downloaded model file (e.g., a .gguf file) and launches the server to handle requests. ```bash ./koboldcpp.py ./models/openchat_3.5.Q5_K_M.gguf ``` -------------------------------- ### Run RVC Setup Script Source: https://github.com/semperai/amica/blob/master/docs/guides/using-rvc.md Executes the `run.sh` script to set up the necessary environment for RVC. This script typically handles dependencies and initial configurations. ```bash sh ./run.sh ``` -------------------------------- ### Run RVC FastAPI Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-rvc.md Starts the FastAPI server for RVC after all setup steps and model placements are complete. This command initiates the voice conversion service. ```python python rvc_fastapi.py ``` -------------------------------- ### Clone RVC Repository and Navigate Source: https://github.com/semperai/amica/blob/master/docs/guides/using-rvc.md Clones the RVC repository from GitHub and changes the current directory to the cloned project. This is the initial step for local setup. ```bash git clone git@github.com:SocAIty/Retrieval-based-Voice-Conversion-FastAPI.git rvc cd rvc ``` -------------------------------- ### Clone KoboldCpp Repository Source: https://github.com/semperai/amica/blob/master/docs/guides/using-koboldcpp.md Clones the KoboldCpp repository from GitHub and navigates into the cloned directory. This is the initial step to get the source code for building the inference engine. ```bash git clone https://github.com/LostRuins/koboldcpp cd koboldcpp ``` -------------------------------- ### Configure Client to Use KoboldCpp Backend Source: https://github.com/semperai/amica/blob/master/docs/guides/using-koboldcpp.md Guides users on how to select and configure KoboldCpp as the chatbot backend within a client application. It involves navigating through settings to enable KoboldCpp and its extra features like streaming. ```markdown settings -> ChatBot -> ChatBot Backend -> KoboldCpp settings -> ChatBot -> KoboldCpp Inside of "Use KoboldCpp" ensure that "Use Extra" is enabled. ``` -------------------------------- ### Install Oobabooga and OpenAI Extension (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-oobabooga.md Installs Oobabooga and its OpenAI extension using pip within a Python virtual environment. Ensure you select the correct requirements.txt file for your system. ```bash python3 -m venv venv source venv/bin/activate # choose correct requirements.txt for your system pip install -r requirements.txt # install the openai extension pip install -r extensions/openai/requirements.txt ``` -------------------------------- ### YAML Front-Matter Example Source: https://github.com/semperai/amica/blob/master/docs/contributing/contributing-to-the-docs.md This snippet demonstrates the YAML front-matter used at the beginning of each documentation page. It configures GitBook's presentation and ordering of the page within the documentation structure. ```yaml --- title: Contributing to the Docs order: 3 --- ``` -------------------------------- ### Clone Amica Repository Source: https://github.com/semperai/amica/blob/master/README.md This command clones the Amica project repository from GitHub to your local machine. Ensure you have Git installed. ```bash git clone git@github.com:semperai/amica.git ``` -------------------------------- ### Docker Setup: Pull Coqui TTS Image Source: https://github.com/semperai/amica/blob/master/docs/guides/using-coqui.md Pulls the Coqui TTS Docker image from GitHub Container Registry. This command downloads the necessary container image for running Coqui TTS. ```bash docker pull ghcr.io/coqui-ai/tts --platform linux/amd64 ``` -------------------------------- ### Run LLaMA.cpp Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-llamacpp.md Starts the LLaMA.cpp server with specified parameters. This includes the number of threads, context size, GPU layers, batch size, memory locking, and the path to the model file. Ensure the model file exists in the specified path. ```bash ./llama-server -t 4 -c 4096 -ngl 35 -b 512 --mlock -m models/openchat_3.5.Q5_K_M.gguf ``` -------------------------------- ### Retrieve Data via GET Request - Bash Source: https://github.com/semperai/amica/blob/master/docs/api/api-reference.md Demonstrates how to retrieve specific data types (config, subconscious, logs, userInputMessages, chatLogs) from the server using a GET request to the /api/dataHandler route. Requires specifying the 'type' query parameter. ```bash curl -X GET "http://localhost:3000/api/dataHandler?type=config" ``` -------------------------------- ### Navigate to Directory (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-alltalk.md Navigates the command line interface to a specified directory. This command is used on both Windows and Linux to prepare for cloning the repository and running setup scripts. ```bash cd /d C:\path\to\your\preferred\directory ``` ```bash cd /path/to/your/preferred/directory ``` -------------------------------- ### Run LLaMA.cpp Server with Vision Model Source: https://github.com/semperai/amica/blob/master/docs/guides/using-llava.md Starts the LLaMA.cpp server with specific configurations for running LLaVA models. It includes parameters for thread count, context size, GPU layers, batch size, memory locking, the main model path, and the vision model projection path. ```bash ./server -t 4 -c 4096 -ngl 35 -b 512 --mlock -m models/openchat_3.5.Q5_K_M.gguf --mmproj models/mmproj-model-f16.gguf ``` -------------------------------- ### Docker Setup: Run Coqui TTS Container Source: https://github.com/semperai/amica/blob/master/docs/guides/using-coqui.md Runs the Coqui TTS Docker container, exposing port 5002 and setting the entrypoint to bash. This allows interactive access to the container. ```bash docker run --rm -it -p 5002:5002 --entrypoint /bin/bash ghcr.io/coqui-ai/tts ``` -------------------------------- ### Data Handler API: Get Logs Source: https://context7.com/semperai/amica/llms.txt Retrieves server logs. This is a GET request to the '/api/dataHandler' endpoint with the 'type' query parameter set to 'logs'. ```bash curl -X GET "http://localhost:3000/api/dataHandler?type=logs" ``` -------------------------------- ### Build KoboldCpp Executable Source: https://github.com/semperai/amica/blob/master/docs/guides/using-koboldcpp.md Compiles the KoboldCpp source code using the 'make' command. This step generates the executable file required to run the inference server. ```bash make ``` -------------------------------- ### Data Handler API: Get Chat Logs Source: https://context7.com/semperai/amica/llms.txt Retrieves chat history logs. This is a GET request to the '/api/dataHandler' endpoint with the 'type' query parameter set to 'chatLogs'. ```bash curl -X GET "http://localhost:3000/api/dataHandler?type=chatLogs" ``` -------------------------------- ### Data Handler API: Get Subconscious Data Source: https://context7.com/semperai/amica/llms.txt Retrieves the stored subconscious data for the AI. This is a GET request to the '/api/dataHandler' endpoint with the 'type' query parameter set to 'subconscious'. ```bash curl -X GET "http://localhost:3000/api/dataHandler?type=subconscious" ``` -------------------------------- ### Data Handler API: Get User Input Messages Source: https://context7.com/semperai/amica/llms.txt Retrieves historical user input messages. This is a GET request to the '/api/dataHandler' endpoint with the 'type' query parameter set to 'userInputMessages'. ```bash curl -X GET "http://localhost:3000/api/dataHandler?type=userInputMessages" ``` -------------------------------- ### Clone Moshi Server Repository Source: https://github.com/semperai/amica/blob/master/docs/guides/using-moshi.md Clones the Moshi server repository from GitHub and navigates into the cloned directory. This is the initial step to obtain the server's codebase. ```bash git clone https://github.com/flukexp/moshi_server.git moshi && cd moshi ``` -------------------------------- ### SSE Connection - GET /api/amicaHandler Source: https://context7.com/semperai/amica/llms.txt Establishes a Server-Sent Events connection for real-time updates from the Amica system. ```APIDOC ## GET /api/amicaHandler (SSE) ### Description Establishes a Server-Sent Events connection for real-time updates from the Amica system. ### Method GET ### Endpoint /api/amicaHandler ### Parameters None ### Request Example ```javascript const eventSource = new EventSource('/api/amicaHandler'); eventSource.onmessage = (event) => { const message = JSON.parse(event.data); const { type, data } = message; switch (type) { case 'normal': console.log('Chat message:', data); break; case 'animation': console.log('Play animation:', data); break; case 'playback': console.log('Recording duration:', data); break; case 'systemPrompt': console.log('New prompt:', data); break; } }; eventSource.onerror = (error) => { console.error('SSE error:', error); eventSource.close(); }; // To close the connection: // eventSource.close(); ``` ### Response #### Success Response (200) - Event Stream - **Server-Sent Events stream** - Real-time events with `type` and `data` fields. #### Response Example (Event Data) ```json { "type": "normal", "data": "Hello there!" } ``` ``` -------------------------------- ### Navigate to AllTalk Directory (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-alltalk.md Changes the current directory to the 'alltalk_tts' folder after cloning the repository. This is necessary to access and run the setup scripts. ```bash cd alltalk_tts ``` -------------------------------- ### Clone AllTalk Repository (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-alltalk.md Clones the AllTalk TTS repository from GitHub using the 'alltalkbeta' branch. This is a prerequisite for the standalone installation on both Windows and Linux. ```bash git clone -b alltalkbeta https://github.com/erew123/alltalk_tts ``` -------------------------------- ### Create and Activate Virtual Environment Source: https://github.com/semperai/amica/blob/master/docs/guides/using-kokoro.md Creates a Python virtual environment named 'venv' and activates it. This isolates project dependencies. The activation command differs between Unix-based systems and Windows. ```bash python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` ``` -------------------------------- ### Clone Piper TTS API Wrapper (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-piper.md Clones the PiperTTS-API-Wrapper repository from GitHub, which is used for the manual setup of the Piper TTS backend. ```bash git clone https://github.com/flukexp/PiperTTS-API-Wrapper.git ``` -------------------------------- ### Clone Kokoro TTS Repository Source: https://github.com/semperai/amica/blob/master/docs/guides/using-kokoro.md Clones the Kokoro TTS GitHub repository to your local machine and navigates into the project directory. This is the first step to setting up the server. ```bash git clone https://github.com/flukexp/kokoro-tts.git cd kokoro-tts ``` -------------------------------- ### Build LLaMA.cpp Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-llamacpp.md Compiles the LLaMA.cpp server executable using the 'make' command. This step is necessary after cloning the repository and before running the server. ```bash make llama-server ``` -------------------------------- ### Install Flask CORS in Dockerfile (Bash) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-piper.md Adds Flask-CORS support to the Dockerfile, enabling Cross-Origin Resource Sharing for the Piper server running in a Docker container. ```bash RUN pip install flask_cors ``` -------------------------------- ### Create and Activate Python Virtual Environment Source: https://github.com/semperai/amica/blob/master/docs/guides/using-moshi.md Creates a Python virtual environment named 'venv' to isolate project dependencies. It then provides commands to activate this environment on macOS/Linux, Windows Command Prompt, and Windows PowerShell. ```bash python -m venv venv ``` ```bash # On macOS/Linux: source venv/bin/activate ``` ```bash # On Windows (Command Prompt): venv\Scripts\activate ``` ```bash # On Windows (PowerShell): .\venv\Scripts\Activate ``` -------------------------------- ### Develop Desktop Application with Tauri Source: https://github.com/semperai/amica/blob/master/README.md Command to initiate the development server for the Amica desktop application using Tauri. This command leverages npm scripts to build and run the application in a development environment. ```bash npm run tauri dev ``` -------------------------------- ### Build LLaMA.cpp Server Source: https://github.com/semperai/amica/blob/master/docs/guides/using-llava.md Compiles the LLaMA.cpp project to build the server executable. This command assumes you are in the root directory of the cloned llama.cpp repository. ```bash make server ``` -------------------------------- ### Clone LLaMA.cpp Repository Source: https://github.com/semperai/amica/blob/master/docs/guides/using-llamacpp.md Clones the official LLaMA.cpp repository from GitHub and navigates into the cloned directory. This is the first step to setting up the LLaMA.cpp server. ```bash git clone https://github.com/ggerganov/llama.cpp cd llama.cpp ``` -------------------------------- ### Configure Oobabooga Client Settings (Markdown) Source: https://github.com/semperai/amica/blob/master/docs/guides/using-oobabooga.md Illustrates how to configure the client settings to use Oobabooga as a ChatGPT backend. This involves setting the ChatBot Backend and the OpenAI URL. ```markdown settings -> ChatBot -> ChatBot Backend -> ChatGPT settings -> ChatBot -> ChatGPT -> OpenAI URL -> http://localhost:5000 ``` -------------------------------- ### Amica Handler API: Get RPC Logs Source: https://context7.com/semperai/amica/llms.txt Retrieves Remote Procedure Call (RPC) logs from the Amica handler. This is a simple POST request with the input type 'RPC Logs'. ```bash curl -X POST "http://localhost:3000/api/amicaHandler" \ -H "Content-Type: application/json" \ -d '{ "inputType": "RPC Logs" }' ``` -------------------------------- ### Media Handler JSON Output Example Source: https://github.com/semperai/amica/blob/master/docs/api/api-reference.md This JSON represents a successful response from the /api/mediaHandler endpoint. It includes a session ID, the output type (e.g., 'Text' for transcription), and the processed response, which is the transcribed text for voice input. ```json { "sessionId": "a1b2c3d4e5f6g7h8", "outputType": "Text", "response": "Transcription of the audio." } ```