How 2noise/chattts works
ChatTTS is a dialogue-oriented text-to-speech model. The principal workflow is a user submitting text to Chat, which can normalize and refine it, generate speech codes, and decode those codes into audio; documented controls include speaker selection, prosody tokens, and streaming. Model inference uses a GPU-oriented generation engine with scheduling and token-block management. The graph reflects README capabilities and the supplied source index/excerpts; several model details are indexed but not excerpted, so their runtime connections are shown only where the evidence supports them.
Main entry points: llm_engine.py LLM engine · core.py Chat API · llm.py Generation interface · sequence.py Sequence state
Components 22
Speech workflow
- Chat API
ChatTTS/core.py - Text normalization
ChatTTS/norm.py - Audio decoding
ChatTTS/core.py
Speech models
- Tokenization
ChatTTS/model/tokenizer.py - Text processors
ChatTTS/model/processors.py - Speech-code GPT
ChatTTS/model/gpt.py - Speaker encoding
ChatTTS/model/speaker.py - Model embeddings
ChatTTS/model/embed.py - DVAE encoder
ChatTTS/model/dvae.py
Inference engine
- Generation interface
ChatTTS/model/velocity/llm.py - Engine configuration
ChatTTS/model/velocity/configs.py - LLM engine
ChatTTS/model/velocity/llm_engine.py - Sampling controls
ChatTTS/model/velocity/sampling_params.py - Request scheduler
ChatTTS/model/velocity/scheduler.py - Sequence state
ChatTTS/model/velocity/sequence.py - Token block manager
ChatTTS/model/velocity/block_manager.py - GPU worker
ChatTTS/model/velocity/worker.py - Model runner
ChatTTS/model/velocity/model_runner.py - Generation outputs
ChatTTS/model/velocity/output.py
Runtime support
- Model asset checks
ChatTTS/utils/dl.py - Tensor file loading
ChatTTS/utils/io.py
Other components
- Text caller
Connections 23
- Text caller → Chat API: submits text
README.md - Chat API → Text normalization: normalizes text
ChatTTS/core.py - Chat API → Speech-code GPT: generates codes
ChatTTS/core.py - Chat API → Audio decoding: decodes codes
ChatTTS/core.py - Chat API → Model asset checks: checks assets
ChatTTS/core.py - Speech-code GPT → Model embeddings: uses embeddings
ChatTTS/model/gpt.py - Speech-code GPT → Generation interface: uses generation
ChatTTS/model/gpt.py - Generation interface → Engine configuration: builds arguments
ChatTTS/model/velocity/llm.py - Generation interface → LLM engine: creates engine
ChatTTS/model/velocity/llm.py - Generation interface → Sampling controls: accepts sampling
ChatTTS/model/velocity/llm.py - LLM engine → Request scheduler: dispatches requests
ChatTTS/model/velocity/llm_engine.py - LLM engine → GPU worker: dispatches work
ChatTTS/model/velocity/llm_engine.py - LLM engine → Sequence state: creates sequences
ChatTTS/model/velocity/llm_engine.py - LLM engine → Sampling controls: uses parameters
ChatTTS/model/velocity/llm_engine.py - LLM engine → Generation outputs: returns results
ChatTTS/model/velocity/llm_engine.py - Request scheduler → Token block manager: allocates token blocks
ChatTTS/model/velocity/scheduler.py - Request scheduler → Sequence state: schedules sequences
ChatTTS/model/velocity/scheduler.py - GPU worker → Model runner: executes model
ChatTTS/model/velocity/worker.py - Token block manager → Sequence state: manages sequence blocks
ChatTTS/model/velocity/block_manager.py - Sequence state → Sampling controls: stores sampling settings
ChatTTS/model/velocity/sequence.py - DVAE encoder → Tensor file loading: loads model tensors
ChatTTS/model/dvae.py - Model embeddings → Tensor file loading: loads model tensors
ChatTTS/model/embed.py - Tokenization → Tensor file loading: uses shared utilities
ChatTTS/model/tokenizer.py