# Repository Briefing: modal-labs/quillman
> Source: https://repoforai.com/repo/modal-labs/quillman (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/modal-labs/quillman
- **Official Docs / Website**: https://modal.com/docs/examples/llm-voice-chat
- **Category**: Voice, Vision & Video (语音 / 视觉 / 视频生成)
- **Primary Language**: Python
- **License**: MIT
- **Engineering Health**: B+ (69/100 · Maintenance 26/35 · Adoption 17/25 · Releases 6/20 · License 20/20)
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: API
- **Momentum**: 1,216 ★ total (+0 24h / +0 7d) · 161 forks
- **Topics**: `ai`, `language-model`, `python`, `serverless`, `speech-recognition`, `speech-to-text`
- **When to Use**: Best for: Prototyping continuous speech-to-speech interaction on Modal with a browser UI and a directly testable inference WebSocket. Skip if: You need an offline deployment path out of the box, independently replaceable ASR and TTS engines, or established latency and concurrency guarantees.

## Overview
```text
### Architecture & Core Mechanics
QuiLLMan separates static frontend delivery from stateful speech inference. `src/app.py` uses FastAPI to serve the React frontend in `src/frontend/`. The browser connects to the FastAPI WebSocket exposed by `src/moshi.py`, where a Modal class loads the models and maintains streaming state. The frontend entrypoint imports the inference module, so starting the full app brings up both services.

Mimi handles streaming audio encoding and decoding on the model side, while Moshi's speech-text model determines when and how to respond. Opus serves a different purpose: compressing audio for network transport over the bidirectional WebSocket. That WebSocket is the practical integration boundary. There is no documented plugin system for swapping model providers.

### Key Capabilities & Differentiators
The app supports continuous speech-to-speech interaction: it can receive new microphone audio while sending generated audio back over the same connection. It does not require a completed transcript as the handoff between a separate recognizer and synthesizer. The concrete stack is Kyutai’s Mimi codec and Moshi, with `moshiko-pytorch-bf16` as the linked speech-text checkpoint. Opus is the network audio format.

The browser demo offers end-to-end evaluation, while `tests/moshi_client.py` lets developers exercise the inference endpoint directly with a microphone and speakers. These are useful paths for testing conversation flow and audio handling, but there are no verified latency benchmarks, concurrency limits, or compatibility matrices for additional checkpoints or providers. Measure response timing and audio continuity over the networks and devices you intend to support.

### Trade-offs & Limitations
Compared with a modular ASR → LLM → TTS stack, QuiLLMan avoids explicit handoffs between separately operated services and makes continuous audio the primary interface. That is a useful starting point for natural voice interaction, but the application offers no documented swap points for speech recognition, reasoning, or synthesis. A modular pipeline is a better fit when you need editable transcripts in the critical path or want to replace and evaluate each stage separately.

Modal's scale-to-zero behavior reduces the need to keep idle inference workers running, but the first connection after idle may encounter model startup. Opus lowers the amount of audio sent over the network without eliminating the effects of network conditions or inference load. Before production use, validate session isolation, overload handling, and reconnect behavior rather than assuming those guarantees. The application is MIT-licensed; check model-weight terms separately before commercial use.

### Hardware & Deployment Guide
The supported path is a managed Modal deployment. Install `modal` in a Python virtual environment with `pip install modal`, configure an account with `modal setup`, and create a token with `modal token new`. Run `modal deploy src.app` from the repository root to deploy both the frontend server and inference WebSocket. For development, `modal serve src.app` starts both services; `modal serve -m src.moshi` starts inference alone. Both development modes apply file changes while running.

For direct audio testing, install `requirements/requirements-dev.txt` and run `python tests/moshi_client.py` with a microphone and speakers available. Clear the browser cache if frontend edits do not appear. No verified GPU or VRAM target, ready-to-run offline deployment, or published release is identified. Pin a tested commit for repeatable rollout and validate peak memory, cold-start time, and steady-state streaming under the intended session load.
```

## Key Capabilities
```text
- Service split: `src/app.py` serves the React frontend, while `src/moshi.py` exposes the inference WebSocket.
- Model roles: Mimi provides streaming audio encoding and decoding; Moshi's linked `moshiko-pytorch-bf16` checkpoint drives responses.
- Audio transport: Opus compresses audio on the wire, while a bidirectional WebSocket carries input and output on the same connection.
- Inference lifecycle: A Modal class loads the models and maintains streaming state behind FastAPI.
- Integration test path: `tests/moshi_client.py` exercises the inference WebSocket without the browser UI.
- Development workflow: `modal serve -m src.moshi` starts the inference service alone; `modal serve src.app` starts both services.
```

## Quick Start / Clone
```bash
python -m venv venv
source venv/bin/activate
pip install -r requirements/requirements-dev.txt
```
