--- title: ZeroGPU TTS Service emoji: 🚀 colorFrom: blue colorTo: purple sdk: gradio sdk_version: 5.42.0 app_file: app.py pinned: false license: mit suggested_hardware: zero-a10g --- # 🚀 ZeroGPU Text-to-Speech Service A high-performance text-to-speech service powered by **Hugging Face ZeroGPU** and **Nvidia H200** dynamic resources. ## 🎯 Features - 🚀 **ZeroGPU Acceleration**: Dynamic H200 GPU allocation - ⚡ **Ultra-Fast Generation**: Optimized for latest GPU architecture - 🎭 **Multiple Voice Presets**: 10 different voice characteristics - 🔊 **High-Quality Audio**: Professional-grade speech synthesis - 📦 **Batch Processing**: Multiple texts in parallel - 🌐 **Dual Protocol Support**: Gradio Web UI + MCP Protocol - 🔌 **MCP Integration**: Compatible with AI assistants (Claude Code, etc.) - 💰 **Cost Efficient**: No idle costs with Pro subscription ## 🏗️ Architecture - **Backend**: Transformers + PyTorch with CUDA optimization - **Frontend**: Gradio with enhanced UI - **GPU**: ZeroGPU with H200 dynamic scaling - **Model**: Bark (suno/bark-small) with mixed precision ## 🚀 Performance - **Single synthesis**: 0.5-2 seconds (depending on text length) - **Batch processing**: Parallel execution on H200 - **Memory efficient**: Automatic GPU cleanup - **Scaling**: Dynamic resource allocation ## 💻 API Usage ### Gradio Client API ```python from gradio_client import Client client = Client("YOUR_USERNAME/tts-gpu-service") result = client.predict( "Hello from ZeroGPU!", "v2/en_speaker_6", api_name="/predict" ) audio_file, status = result ``` ### MCP Protocol API ```python from mcp import ClientSession, StdioServerParameters from mcp.client.stdio import stdio_client async def use_tts(): server_params = StdioServerParameters( command="python", args=["app.py", "--mcp-only"] ) async with stdio_client(server_params) as (read, write): async with ClientSession(read, write) as session: await session.initialize() result = await session.call_tool("tts_synthesize", { "text": "Hello from MCP!", "voice_preset": "v2/en_speaker_6" }) ``` ## 🔌 MCP Tools - **`tts_synthesize`**: Convert single text to speech - **`tts_batch_synthesize`**: Convert multiple texts to speech - **`tts_get_info`**: Get system status and capabilities ## 🚀 Running Modes ### Dual Mode (Default) ```bash python app.py ``` - Gradio UI: http://localhost:7860 - MCP Server: Available on stdio ### MCP-Only Mode ```bash python app.py --mcp-only ``` - For integration with AI assistants - No web interface, only MCP protocol