### Install Moshi Client Development Dependencies Source: https://github.com/modal-labs/quillman/blob/main/README.md Sets up a Python virtual environment and installs non-standard dependencies required for the `tests/moshi_client.py` client, which is used to test the websocket connection to the Moshi server. ```shell python -m venv venv source venv/bin/activate pip install -r requirements/requirements-dev.txt ``` -------------------------------- ### Run Frontend and HTTP Server Development Server Source: https://github.com/modal-labs/quillman/blob/main/README.md Starts a development server for the `src/app.py` FastAPI application, which serves the React frontend as static files. This command also implicitly starts the Moshi websocket server because `src/app.py` imports `src/moshi.py`. Changes to project files are automatically applied. ```shell modal serve src.app ``` -------------------------------- ### Run Moshi Development Server Source: https://github.com/modal-labs/quillman/blob/main/README.md Starts a development server for the Moshi module, which is a Modal class module responsible for loading models and maintaining streaming state. It exposes a websocket interface via FastAPI. Changes to project files are automatically applied while the server is running. ```shell modal serve -m src.moshi ``` -------------------------------- ### Run Moshi Backend Development Server Source: https://github.com/modal-labs/quillman/blob/main/README_DOCS.md This shell command initiates a local development server for the Moshi backend module. It allows developers to test the Moshi websocket server and its functionalities locally before deployment, providing a URL for establishing websocket connections in the terminal output. ```shell modal serve src.moshi ``` -------------------------------- ### Deploy Moshi Application to Modal Cloud Source: https://github.com/modal-labs/quillman/blob/main/README_DOCS.md This shell command deploys the entire Moshi speech-to-speech application, including both the backend and frontend components, to the Modal cloud. It prepares the application for live usage, making it accessible via a public URL. ```shell modal deploy src.app ``` -------------------------------- ### Serve React Frontend and Moshi Backend Locally Source: https://github.com/modal-labs/quillman/blob/main/README_DOCS.md This shell command serves the static React frontend assets located in `src/frontend`. Since `src/app.py` imports `src/moshi.py`, this single command also concurrently serves the Moshi websocket server as its own endpoint, enabling full local application testing. ```shell modal serve src.app ``` -------------------------------- ### Deploy QuiLLMan Application to Modal Source: https://github.com/modal-labs/quillman/blob/main/README.md Deploys both the frontend server and the Moshi websocket server to Modal. Deployed applications on Modal are serverless and scale to zero when not in use, meaning they incur no cost when idle. ```shell modal deploy src.app ``` -------------------------------- ### Implement Bidirectional Websocket for Streaming Audio with FastAPI and Modal Source: https://github.com/modal-labs/quillman/blob/main/README_DOCS.md This Python code demonstrates how to integrate a FastAPI websocket server within a Modal class method. The `@modal.asgi_app()` decorator exposes a `/ws` endpoint for bidirectional audio streaming. It outlines the structure for `recv_loop` and `send_loop` to handle continuous audio input and output, coupling the prewarmed Moshi model to the websocket session for real-time interaction. ```python @modal.asgi_app() def web(self): from fastapi import FastAPI, Response, WebSocket, WebSocketDisconnect web_app = FastAPI() @web_app.websocket("/ws") async def websocket(ws: WebSocket): with torch.no_grad(): await ws.accept() # handle user session # spawn loops for async IO async def recv_loop(): while True: data = await ws.receive_bytes() # send data into inference stream... async def send_loop(): while True: await asyncio.sleep(0.001) msg = self.opus_stream_outbound.read_bytes() # send inference output to user ... ``` -------------------------------- ### Define Stateful Moshi Model Class on Modal Source: https://github.com/modal-labs/quillman/blob/main/README_DOCS.md This Python snippet defines the `Moshi` class using Modal's `@app.cls` decorator. It configures a dedicated GPU ('A10G') for each user session, solving the statefulness challenge by ensuring isolated model instances. The `scaledown_window` setting allows GPU reuse after disconnection, optimizing resource management. ```python @app.cls( image=image, gpu="A10G", scaledown_window=300, ... ) class Moshi: # ... ``` -------------------------------- ### Run Moshi Websocket Test Client Source: https://github.com/modal-labs/quillman/blob/main/README.md Executes the `tests/moshi_client.py` script to test the websocket connection to the Moshi server. This allows direct interaction with the server using your microphone and speakers. ```shell python tests/moshi_client.py ``` -------------------------------- ### Configure Tailwind CSS Custom Colors Source: https://github.com/modal-labs/quillman/blob/main/src/frontend/index.html This JavaScript snippet defines custom color palettes for a Tailwind CSS project, specifically for a Modal Chat application. It extends the default Tailwind theme to include a dark base background color ('ground') and defines primary and accent colors ('primary', 'accent-pink', 'accent-blue') for consistent theming. ```JavaScript tailwind.config = { theme: { extend: { colors: { // Dark base background color ground: "#0C0F0B", // Theme colors primary: "#9AEE86", "accent-pink": "#FC9CC6", "accent-blue": "#B8E4FF" } } } }; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.