
High-performance Text-to-Speech server with OpenAI-compatible API, multilingual support with 24 voices, emotion tags, and modern web UI. Optimized for RTX GPUs.
v1.3.1 (2025-07-05)
v1.3.0 (2025-04-18)
.env file before installation and change ORPHEUS_MODEL_NAME to match the desired model repo ID (e.g., Orpheus-3b-French-FT-Q8_0.gguf)v1.2.0 (2025-04-12)
llama.cpp server and Orpheus-FastAPI integrationv1.1.0 (2025-03-23)
π NEW: Try the quantized models for improved performance!
Browse the Orpheus-FASTAPI Model Collection on HuggingFace
Listen to sample outputs with different voices and emotions:

/v1/audio/speech endpointOrpheus-FastAPI/
βββ app.py # FastAPI server and endpoints
βββ docker-compose.yml # Docker compose configuration
βββ Dockerfile.gpu # GPU-enabled Docker image
βββ requirements.txt # Dependencies
βββ static/ # Static assets (favicon, etc.)
βββ outputs/ # Generated audio files
βββ templates/ # HTML templates
β βββ tts.html # Web UI template
βββ tts_engine/ # Core TTS functionality
βββ __init__.py # Package exports
βββ inference.py # Token generation and API handling
βββ speechpipe.py # Audio conversion pipeline
The docker compose file orchestrates the Orpheus-FastAPI for audio and a llama.cpp inference server for the base model token generation. The GGUF model is downloaded with the model-init service.
There are three versions, two for machines that have access to GPU support docker-compose-gpu.yaml, docker-compose-gpu-rocm.yml and one for CPU support only: docker-compose-cpu.yaml
cp .env.example .env # Create your .env file from the example
copy .env.example .env # For Windows CMD
For multilingual models, edit the .env file and change the model name:
# Change this line in .env to use a language-specific model
ORPHEUS_MODEL_NAME=Orpheus-3b-French-FT-Q8_0.gguf # Example for French
Then start the services:
For CUDA GPU support run
docker compose -f docker-compose-gpu.yml up
For ROCm GPU support run
docker compose -f docker-compose-gpu-rocm.yml up
For CPU support run:
docker compose -f docker-compose-cpu.yml up
The system will automatically download the specified model from Hugging Face before starting the service.
git clone https://github.com/Lex-au/Orpheus-FastAPI.git
cd Orpheus-FastAPI
# Using venv (Python's built-in virtual environment)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Or using conda
conda create -n orpheus-tts python=3.10
conda activate orpheus-tts
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
or Install PyTorch with ROCm support:
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.4/
pip3 install -r requirements.txt
# Create directories for outputs and static files
mkdir -p outputs static
Run the FastAPI server:
python app.py
Or with specific host/port:
uvicorn app:app --host 0.0.0.0 --port 5005 --reload

Access:

The server provides an OpenAI-compatible API endpoint at /v1/audio/speech:
curl http://localhost:5005/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"model": "orpheus",
"input": "Hello world! This is a test of the Orpheus TTS system.",
"voice": "tara",
"response_format": "wav",
"speed": 1.0
}' \
--output speech.wav
input (required): The text to convert to speechmodel (optional): The model to use (default: "orpheus")voice (optional): Which voice to use (default: "tara")response_format (optional): Output format (currently only "wav" is supported)speed (optional): Speed factor (0.5 to 1.5, default: 1.0)Additionally, a simpler /speak endpoint is available:
curl -X POST http://localhost:5005/speak \
-H "Content-Type: application/json" \
-d '{
"text": "Hello world! This is a test.",
"voice": "tara"
}' \
-o output.wav
tara: Female, conversational, clearleah: Female, warm, gentlejess: Female, energetic, youthfulleo: Male, authoritative, deepdan: Male, friendly, casualmia: Female, professional, articulatezac: Male, enthusiastic, dynamiczoe: Female, calm, soothingpierre: Male, sophisticatedamelie: Female, elegantmarie: Female, spiritedjana: Female, clearthomas: Male, authoritativemax: Male, energeticμ λ: Female, melodicμ€μ: Male, confidentΰ€ΰ€€ΰ€Ώΰ€ΰ€Ύ: Female, expressiveιΏδΉ: Female, gentleη½θ·: Female, clearjavi: Male, warmsergio: Male, professionalmaria: Female, friendlypietro: Male, passionategiulia: Female, expressivecarlo: Male, refinedYou can insert emotion tags into your text to add expressiveness:
<laugh>: Add laughter<sigh>: Add a sigh<chuckle>: Add a chuckle<cough>: Add a cough sound<sniffle>: Add a sniffle sound<groan>: Add a groan<yawn>: Add a yawning sound<gasp>: Add a gasping soundExample: "Well, that's interesting <laugh> I hadn't thought of that before."
This server works as a frontend that connects to an external LLM inference server. It sends text prompts to the inference server, which generates tokens that are then converted to audio using the SNAC model. The system has been optimised for RTX 4090 GPUs with:
The system features intelligent hardware detection that automatically optimizes performance based on your hardware capabilities:
High-End GPU Mode (dynamically detected based on capabilities):
Standard GPU Mode (other CUDA-capable GPUs):
CPU Mode (when no GPU is available):
No manual configuration is needed - the system automatically detects hardware capabilities and adapts for optimal performance across different generations of GPUs and CPUs.
The token processing system has been optimized with mathematically aligned parameters:
The system features efficient batch processing for texts of any length:
Note about long-form audio: While the system now supports texts of unlimited length, there may be slight audio discontinuities between segments due to architectural constraints of the underlying model. The Orpheus model was designed for short to medium text segments, and our batching system works around this limitation by intelligently splitting and stitching content with minimal audible impact.
You can easily integrate this TTS solution with OpenWebUI to add high-quality voice capabilities to your chatbot:
http://localhost:5005/v1)tara, pierre, jana, μ λ, etc.)tts-1This application requires a separate LLM inference server running the Orpheus model. For easy setup, use Docker Compose, which automatically handles this for you. Alternatively, you can use:
Quantized Model Options:
Choose based on your hardware and needs. Lower bit models (Q2_K, Q4_K_M) provide ~2x realtime performance on high-end GPUs.
Browse all models in the collection
The inference server should be configured to expose an API endpoint that this FastAPI application will connect to.
Configure in docker compose, if using docker. Not using docker; create a .env file:
ORPHEUS_API_URL: URL of the LLM inference API (default in Docker: http://llama-cpp-server:5006/v1/completions)ORPHEUS_API_TIMEOUT: Timeout in seconds for API requests (default: 120)ORPHEUS_MAX_TOKENS: Maximum tokens to generate (default: 8192)ORPHEUS_TEMPERATURE: Temperature for generation (default: 0.6)ORPHEUS_TOP_P: Top-p sampling parameter (default: 0.9)ORPHEUS_SAMPLE_RATE: Audio sample rate in Hz (default: 24000)ORPHEUS_PORT: Web server port (default: 5005)ORPHEUS_HOST: Web server host (default: 0.0.0.0)ORPHEUS_MODEL_NAME: Model name for inference serverThe system now supports loading environment variables from a .env file in the project root, making it easier to configure without modifying system-wide environment settings. See .env.example for a template.

Note: Repetition penalty is hardcoded to 1.1 and cannot be changed through environment variables as this is the only value that produces stable, high-quality output.
Make sure the ORPHEUS_API_URL points to your running inference server.
To add new voices, update the AVAILABLE_VOICES list in tts_engine/inference.py and add corresponding descriptions in the HTML template.
When running the Orpheus model with llama.cpp, use these parameters to ensure optimal performance:
./llama-server -m models/Modelname.gguf \
--ctx-size={{your ORPHEUS_MAX_TOKENS from .env}} \
--n-predict={{your ORPHEUS_MAX_TOKENS from .env}} \
--rope-scaling=linear
Important parameters:
--ctx-size: Sets the context window size, should match your ORPHEUS_MAX_TOKENS setting--n-predict: Maximum tokens to generate, should match your ORPHEUS_MAX_TOKENS setting--rope-scaling=linear: Required for optimal positional encoding with the Orpheus modelFor extended audio generation (books, long narrations), you may want to increase your token limits:
This project is licensed under the Apache License 2.0 - see the LICENSE.txt file for details.
Python
63.0%
HTML
37.0%

High-performance Text-to-Speech server with OpenAI-compatible API, multilingual support with 24 voices, emotion tags, and modern web UI. Optimized for RTX GPUs.
v1.3.1 (2025-07-05)
v1.3.0 (2025-04-18)
.env file before installation and change ORPHEUS_MODEL_NAME to match the desired model repo ID (e.g., Orpheus-3b-French-FT-Q8_0.gguf)v1.2.0 (2025-04-12)
llama.cpp server and Orpheus-FastAPI integrationv1.1.0 (2025-03-23)
π NEW: Try the quantized models for improved performance!
Browse the Orpheus-FASTAPI Model Collection on HuggingFace
Listen to sample outputs with different voices and emotions:

/v1/audio/speech endpointOrpheus-FastAPI/
βββ app.py # FastAPI server and endpoints
βββ docker-compose.yml # Docker compose configuration
βββ Dockerfile.gpu # GPU-enabled Docker image
βββ requirements.txt # Dependencies
βββ static/ # Static assets (favicon, etc.)
βββ outputs/ # Generated audio files
βββ templates/ # HTML templates
β βββ tts.html # Web UI template
βββ tts_engine/ # Core TTS functionality
βββ __init__.py # Package exports
βββ inference.py # Token generation and API handling
βββ speechpipe.py # Audio conversion pipeline
The docker compose file orchestrates the Orpheus-FastAPI for audio and a llama.cpp inference server for the base model token generation. The GGUF model is downloaded with the model-init service.
There are three versions, two for machines that have access to GPU support docker-compose-gpu.yaml, docker-compose-gpu-rocm.yml and one for CPU support only: docker-compose-cpu.yaml
cp .env.example .env # Create your .env file from the example
copy .env.example .env # For Windows CMD
For multilingual models, edit the .env file and change the model name:
# Change this line in .env to use a language-specific model
ORPHEUS_MODEL_NAME=Orpheus-3b-French-FT-Q8_0.gguf # Example for French
Then start the services:
For CUDA GPU support run
docker compose -f docker-compose-gpu.yml up
For ROCm GPU support run
docker compose -f docker-compose-gpu-rocm.yml up
For CPU support run:
docker compose -f docker-compose-cpu.yml up
The system will automatically download the specified model from Hugging Face before starting the service.
git clone https://github.com/Lex-au/Orpheus-FastAPI.git
cd Orpheus-FastAPI
# Using venv (Python's built-in virtual environment)
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Or using conda
conda create -n orpheus-tts python=3.10
conda activate orpheus-tts
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
or Install PyTorch with ROCm support:
pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.4/
pip3 install -r requirements.txt
# Create directories for outputs and static files
mkdir -p outputs static
Run the FastAPI server:
python app.py
Or with specific host/port:
uvicorn app:app --host 0.0.0.0 --port 5005 --reload

Access:

The server provides an OpenAI-compatible API endpoint at /v1/audio/speech:
curl http://localhost:5005/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{
"model": "orpheus",
"input": "Hello world! This is a test of the Orpheus TTS system.",
"voice": "tara",
"response_format": "wav",
"speed": 1.0
}' \
--output speech.wav
input (required): The text to convert to speechmodel (optional): The model to use (default: "orpheus")voice (optional): Which voice to use (default: "tara")response_format (optional): Output format (currently only "wav" is supported)speed (optional): Speed factor (0.5 to 1.5, default: 1.0)Additionally, a simpler /speak endpoint is available:
curl -X POST http://localhost:5005/speak \
-H "Content-Type: application/json" \
-d '{
"text": "Hello world! This is a test.",
"voice": "tara"
}' \
-o output.wav
tara: Female, conversational, clearleah: Female, warm, gentlejess: Female, energetic, youthfulleo: Male, authoritative, deepdan: Male, friendly, casualmia: Female, professional, articulatezac: Male, enthusiastic, dynamiczoe: Female, calm, soothingpierre: Male, sophisticatedamelie: Female, elegantmarie: Female, spiritedjana: Female, clearthomas: Male, authoritativemax: Male, energeticμ λ: Female, melodicμ€μ: Male, confidentΰ€ΰ€€ΰ€Ώΰ€ΰ€Ύ: Female, expressiveιΏδΉ: Female, gentleη½θ·: Female, clearjavi: Male, warmsergio: Male, professionalmaria: Female, friendlypietro: Male, passionategiulia: Female, expressivecarlo: Male, refinedYou can insert emotion tags into your text to add expressiveness:
<laugh>: Add laughter<sigh>: Add a sigh<chuckle>: Add a chuckle<cough>: Add a cough sound<sniffle>: Add a sniffle sound<groan>: Add a groan<yawn>: Add a yawning sound<gasp>: Add a gasping soundExample: "Well, that's interesting <laugh> I hadn't thought of that before."
This server works as a frontend that connects to an external LLM inference server. It sends text prompts to the inference server, which generates tokens that are then converted to audio using the SNAC model. The system has been optimised for RTX 4090 GPUs with:
The system features intelligent hardware detection that automatically optimizes performance based on your hardware capabilities:
High-End GPU Mode (dynamically detected based on capabilities):
Standard GPU Mode (other CUDA-capable GPUs):
CPU Mode (when no GPU is available):
No manual configuration is needed - the system automatically detects hardware capabilities and adapts for optimal performance across different generations of GPUs and CPUs.
The token processing system has been optimized with mathematically aligned parameters:
The system features efficient batch processing for texts of any length:
Note about long-form audio: While the system now supports texts of unlimited length, there may be slight audio discontinuities between segments due to architectural constraints of the underlying model. The Orpheus model was designed for short to medium text segments, and our batching system works around this limitation by intelligently splitting and stitching content with minimal audible impact.
You can easily integrate this TTS solution with OpenWebUI to add high-quality voice capabilities to your chatbot:
http://localhost:5005/v1)tara, pierre, jana, μ λ, etc.)tts-1This application requires a separate LLM inference server running the Orpheus model. For easy setup, use Docker Compose, which automatically handles this for you. Alternatively, you can use:
Quantized Model Options:
Choose based on your hardware and needs. Lower bit models (Q2_K, Q4_K_M) provide ~2x realtime performance on high-end GPUs.
Browse all models in the collection
The inference server should be configured to expose an API endpoint that this FastAPI application will connect to.
Configure in docker compose, if using docker. Not using docker; create a .env file:
ORPHEUS_API_URL: URL of the LLM inference API (default in Docker: http://llama-cpp-server:5006/v1/completions)ORPHEUS_API_TIMEOUT: Timeout in seconds for API requests (default: 120)ORPHEUS_MAX_TOKENS: Maximum tokens to generate (default: 8192)ORPHEUS_TEMPERATURE: Temperature for generation (default: 0.6)ORPHEUS_TOP_P: Top-p sampling parameter (default: 0.9)ORPHEUS_SAMPLE_RATE: Audio sample rate in Hz (default: 24000)ORPHEUS_PORT: Web server port (default: 5005)ORPHEUS_HOST: Web server host (default: 0.0.0.0)ORPHEUS_MODEL_NAME: Model name for inference serverThe system now supports loading environment variables from a .env file in the project root, making it easier to configure without modifying system-wide environment settings. See .env.example for a template.

Note: Repetition penalty is hardcoded to 1.1 and cannot be changed through environment variables as this is the only value that produces stable, high-quality output.
Make sure the ORPHEUS_API_URL points to your running inference server.
To add new voices, update the AVAILABLE_VOICES list in tts_engine/inference.py and add corresponding descriptions in the HTML template.
When running the Orpheus model with llama.cpp, use these parameters to ensure optimal performance:
./llama-server -m models/Modelname.gguf \
--ctx-size={{your ORPHEUS_MAX_TOKENS from .env}} \
--n-predict={{your ORPHEUS_MAX_TOKENS from .env}} \
--rope-scaling=linear
Important parameters:
--ctx-size: Sets the context window size, should match your ORPHEUS_MAX_TOKENS setting--n-predict: Maximum tokens to generate, should match your ORPHEUS_MAX_TOKENS setting--rope-scaling=linear: Required for optimal positional encoding with the Orpheus modelFor extended audio generation (books, long narrations), you may want to increase your token limits:
This project is licensed under the Apache License 2.0 - see the LICENSE.txt file for details.
Python
63.0%
HTML
37.0%