<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>AWS Systems Manager on Robin Su</title><link>https://robinsujob.github.io/tags/aws-systems-manager/</link><description>Recent content in AWS Systems Manager on Robin Su</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Sun, 01 Dec 2024 00:00:00 +0800</lastBuildDate><atom:link href="https://robinsujob.github.io/tags/aws-systems-manager/index.xml" rel="self" type="application/rss+xml"/><item><title>From GPT-SoVITS to AWS MagicVoice: Building a Custom-Voice TTS Solution</title><link>https://robinsujob.github.io/p/aws-magicvoice-gpt-sovits-solution/</link><pubDate>Sun, 01 Dec 2024 00:00:00 +0800</pubDate><guid>https://robinsujob.github.io/p/aws-magicvoice-gpt-sovits-solution/</guid><description>&lt;p&gt;Around 2024, GPT-SoVITS quickly gained traction in the open-source speech community. It made custom voice creation—previously a highly specialized undertaking—accessible to everyday developers. The official project supports &lt;strong&gt;zero-shot TTS from roughly five seconds of reference audio&lt;/strong&gt;, as well as &lt;strong&gt;few-shot fine-tuning with about one minute of speech&lt;/strong&gt;. It can also use a reference voice to synthesize speech across languages, including Chinese, English, and Japanese.&lt;/p&gt;
&lt;p&gt;Its popularity stems not only from its output quality, but also from a WebUI that brings together data segmentation, speech recognition, text annotation, training, and inference tools. This toolchain is highly efficient for model developers. However, new challenges emerge when the system is handed to real business users: the interface is complex, model files require manual management, the frontend and backend are tightly coupled, and deployment and operations require expertise in GPUs, Linux, and model directory structures.&lt;/p&gt;
&lt;p&gt;This was the starting point for &lt;strong&gt;MagicVoice&lt;/strong&gt;: packaging GPT-SoVITS as a ready-to-use, manageable reference solution deployed in the customer&amp;rsquo;s own AWS account.&lt;/p&gt;
&lt;h2 id="from-gpt-sovitss-popularity-to-an-aws-solution"&gt;From GPT-SoVITS&amp;rsquo;s Popularity to an AWS Solution
&lt;/h2&gt;&lt;p&gt;The customer wanted to use custom voices for audiobook production and similar content workflows. The requirement went well beyond simply “reading text aloud”:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Provide multiple characters and emotions within one system;&lt;/li&gt;
&lt;li&gt;Create character voices quickly from a small number of samples;&lt;/li&gt;
&lt;li&gt;Generate Chinese, English, or mixed Chinese-English content with the same character;&lt;/li&gt;
&lt;li&gt;Keep end users from having to understand model weights or complex inference parameters;&lt;/li&gt;
&lt;li&gt;Allow model developers to train, update, and manage voices independently;&lt;/li&gt;
&lt;li&gt;Enable rapid environment deployment, with straightforward maintenance or decommissioning after testing.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The native GPT-SoVITS WebUI is built with Gradio and offers a comprehensive feature set, but it combines model development, data processing, and end-user inference in a single interface. Nontechnical users face too many options, while solution maintainers cannot readily host it as a static website on Amazon S3 and Amazon CloudFront.&lt;/p&gt;
&lt;p&gt;MagicVoice therefore focused on four goals:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;One-click infrastructure deployment&lt;/strong&gt;: Use AWS CDK to generate an AWS CloudFormation template.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A user-friendly interface&lt;/strong&gt;: Build a new frontend that exposes only essential options.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloud-based model management&lt;/strong&gt;: Host models in Amazon S3 to simplify the deployment of characters, emotions, and reference voices.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Separation of developers and users&lt;/strong&gt;: Developers handle training, models, and voice licensing; users simply choose a voice and generate audio.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This adds a productization layer beyond merely moving the WebUI to Amazon EC2—and that layer is central to the value of the solution.&lt;/p&gt;
&lt;h2 id="magicvoice-architecture-on-aws"&gt;MagicVoice Architecture on AWS
&lt;/h2&gt;&lt;p&gt;The following diagram shows the overall MagicVoice architecture on AWS and its three core flows: frontend access, speech inference, and model updates.&lt;/p&gt;
&lt;figure&gt;
 &lt;img src="https://robinsujob.github.io/media/magicvoice/architecture-original.png" alt="Overall MagicVoice architecture on AWS" loading="lazy"&gt;
 &lt;figcaption&gt;Overall MagicVoice architecture on AWS&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The architecture consists of three main components: &lt;strong&gt;the web frontend, the inference backend, and the model synchronization and update service&lt;/strong&gt;.&lt;/p&gt;
&lt;h3 id="1-web-frontend"&gt;1. Web Frontend
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;The frontend is built with React and AWS Cloudscape;&lt;/li&gt;
&lt;li&gt;Compiled static assets are stored in Amazon S3;&lt;/li&gt;
&lt;li&gt;Amazon CloudFront serves as the unified access point and distributes the frontend content;&lt;/li&gt;
&lt;li&gt;The interface exposes only text, character, emotion, language, speed, and a small set of advanced inference options;&lt;/li&gt;
&lt;li&gt;The “Reload TTS Service” action enters the backend event flow through Amazon API Gateway.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Cloudscape offers more than visual consistency. It allows the frontend to be released independently of Gradio and the model process, so end users never need to see developer-oriented functions such as training, audio segmentation, or weight paths.&lt;/p&gt;
&lt;h3 id="2-inference-backend"&gt;2. Inference Backend
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;The GPT-SoVITS inference service runs on a GPU-enabled Amazon EC2 instance;&lt;/li&gt;
&lt;li&gt;CloudFront forwards inference requests to the EC2 backend;&lt;/li&gt;
&lt;li&gt;The EC2 instance reads characters, emotions, model weights, and reference audio from the model S3 bucket;&lt;/li&gt;
&lt;li&gt;The inference API supports both standard responses and streaming output.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A proof-of-concept environment can start with a &lt;code&gt;g4dn.xlarge&lt;/code&gt; instance. Production instance sizing, however, should be benchmarked against the model version, concurrency, time to first audio output, audio duration, and GPU memory consumption.&lt;/p&gt;
&lt;h3 id="3-model-synchronization-and-update-service"&gt;3. Model Synchronization and Update Service
&lt;/h3&gt;&lt;p&gt;Model updates can be triggered in two ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;A model developer uploads or deletes model files in Amazon S3, and the resulting S3 event is sent to Amazon EventBridge;&lt;/li&gt;
&lt;li&gt;An authorized user selects the reload action in the frontend, causing Amazon API Gateway to send an event to EventBridge.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;EventBridge then invokes AWS Systems Manager Run Command. Using a predefined Systems Manager document, Run Command executes synchronization and reload scripts on the EC2 instance. The scripts synchronize the latest models from Amazon S3 to the inference instance and then refresh the service.&lt;/p&gt;
&lt;p&gt;As a result, model developers do not need to sign in to the EC2 instance or copy weights manually. The inference instance does not need to expose SSH, and routine management is handled through Amazon S3, EventBridge, and Systems Manager.&lt;/p&gt;
&lt;h2 id="why-separate-model-developers-from-end-users"&gt;Why Separate Model Developers from End Users?
&lt;/h2&gt;&lt;p&gt;A custom-voice solution serves two fundamentally different groups:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Role&lt;/th&gt;
 &lt;th&gt;Responsibilities&lt;/th&gt;
 &lt;th&gt;What They Do Not Need to Handle&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Model developer&lt;/td&gt;
 &lt;td&gt;Prepare licensed source material, train models, organize directories, upload to Amazon S3, and validate voice quality&lt;/td&gt;
 &lt;td&gt;The business-facing interface and routine text generation&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;End user&lt;/td&gt;
 &lt;td&gt;Select a character, emotion, and language; enter text; preview or download the result&lt;/td&gt;
 &lt;td&gt;Weight files, training parameters, GPUs, or server operations&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;This separation improves usability and clarifies responsibility for voice rights and operations. Whether voice material is properly licensed and whether a model may be used commercially should be addressed in the model release process—not decided ad hoc by end users at inference time.&lt;/p&gt;
&lt;p&gt;The MagicVoice frontend therefore exposes only the options required by the business workflow:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;TTS Text;&lt;/li&gt;
&lt;li&gt;Character;&lt;/li&gt;
&lt;li&gt;Emotion;&lt;/li&gt;
&lt;li&gt;Language;&lt;/li&gt;
&lt;li&gt;Speed;&lt;/li&gt;
&lt;li&gt;Inference Batch;&lt;/li&gt;
&lt;li&gt;Top K, Top P, Temperature;&lt;/li&gt;
&lt;li&gt;Streaming;&lt;/li&gt;
&lt;li&gt;Reload TTS Service.&lt;/li&gt;
&lt;/ul&gt;
&lt;figure&gt;
 &lt;img src="https://robinsujob.github.io/media/magicvoice/demo-ui.png" alt="MagicVoice demo interface" loading="lazy"&gt;
 &lt;figcaption&gt;The streamlined MagicVoice user interface built with AWS Cloudscape&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id="the-model-lifecycle-from-training-to-production"&gt;The Model Lifecycle: From Training to Production
&lt;/h2&gt;&lt;p&gt;GPT-SoVITS models used to generate different character voices require a consistent directory structure for GPT weights, SoVITS weights, reference audio, reference text, and language metadata. The basic workflow is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Prepare and train a voice model in a separate training environment;&lt;/li&gt;
&lt;li&gt;Organize the model according to the MagicVoice directory convention;&lt;/li&gt;
&lt;li&gt;Upload the model directory to the model storage S3 bucket;&lt;/li&gt;
&lt;li&gt;An S3 event triggers EventBridge;&lt;/li&gt;
&lt;li&gt;EventBridge invokes Systems Manager Run Command;&lt;/li&gt;
&lt;li&gt;The EC2 instance synchronizes the model and reloads the inference service;&lt;/li&gt;
&lt;li&gt;After refreshing the character list, users can select the new voice.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Training and online inference should run in separate environments. Start GPU instances on demand for model training, then publish the resulting models to Amazon S3 so that training workloads do not consume online inference capacity.&lt;/p&gt;
&lt;p&gt;For consistent management of character voices and emotions, organize directories by character and model version, and store the model weights, reference audio, and inference configuration together in each directory.&lt;/p&gt;
&lt;figure&gt;
 &lt;img src="https://robinsujob.github.io/media/magicvoice/model-directory.png" alt="Example MagicVoice character model directory containing reference audio, infer_config.json, GPT weights, and SoVITS weights" loading="lazy"&gt;
 &lt;figcaption&gt;Example character model directory&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;The &lt;code&gt;infer_config.json&lt;/code&gt; file is the entry point for each character model&amp;rsquo;s inference configuration. It records the locations of the GPT and SoVITS weight files, while &lt;code&gt;emotion_list&lt;/code&gt; maps emotion labels such as “default” and “angry” to the corresponding reference audio (&lt;code&gt;ref_wav_path&lt;/code&gt;), reference text (&lt;code&gt;prompt_text&lt;/code&gt;), and language (&lt;code&gt;prompt_language&lt;/code&gt;). After a user selects a character and emotion in the frontend, the inference service uses this configuration to load the appropriate model weights and reference audio, eliminating the need to maintain each file path in application code.&lt;/p&gt;
&lt;p&gt;Each model version should include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An &lt;code&gt;infer_config.json&lt;/code&gt; inference configuration file;&lt;/li&gt;
&lt;li&gt;GPT and SoVITS model weights;&lt;/li&gt;
&lt;li&gt;Reference audio for each emotion, together with its text and language metadata;&lt;/li&gt;
&lt;li&gt;The model version and release date.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="ready-to-use-deployment-with-infrastructure-as-code"&gt;Ready-to-Use Deployment with Infrastructure as Code
&lt;/h2&gt;&lt;p&gt;MagicVoice uses Amazon CloudFront, Amazon S3, Amazon EC2, Amazon API Gateway, Amazon EventBridge, AWS Systems Manager, and AWS Identity and Access Management (IAM). Creating these resources manually in the console would not only slow deployment, but also make it difficult to maintain consistency across environments. This solution uses infrastructure as code (IaC) to deploy and manage the complete solution framework.&lt;/p&gt;
&lt;p&gt;The infrastructure template creates and connects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A frontend S3 bucket;&lt;/li&gt;
&lt;li&gt;A model S3 bucket;&lt;/li&gt;
&lt;li&gt;A CloudFront distribution;&lt;/li&gt;
&lt;li&gt;A GPU-enabled EC2 instance, Amazon EBS volumes, a security group, and an instance role;&lt;/li&gt;
&lt;li&gt;An API Gateway reload API;&lt;/li&gt;
&lt;li&gt;EventBridge rules;&lt;/li&gt;
&lt;li&gt;A Systems Manager document;&lt;/li&gt;
&lt;li&gt;The required IAM roles and policies.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Permissions follow the principle of least privilege: the EC2 instance can read only the designated model bucket; EventBridge can invoke only the designated Systems Manager document; Run Command targets only the intended instance; and the frontend reload API must not allow anonymous access.&lt;/p&gt;
&lt;h2 id="demo-from-text-input-to-speech-generation"&gt;Demo: From Text Input to Speech Generation
&lt;/h2&gt;&lt;p&gt;The following video demonstrates the complete MagicVoice workflow in about three minutes, including character and parameter selection, speech generation, and output preview.&lt;/p&gt;
&lt;video controls preload="metadata" poster="/media/magicvoice/demo-ui.png" style="width:100%;max-width:1100px"&gt;
 &lt;source src="https://robinsujob.github.io/media/magicvoice/magicvoice-demo.mp4" type="video/mp4"&gt;
 &lt;a href="https://robinsujob.github.io/media/magicvoice/magicvoice-demo.mp4"&gt;Download the MagicVoice demo video&lt;/a&gt;
&lt;/video&gt;
&lt;p&gt;If your browser does not support embedded playback, you can &lt;a class="link" href="https://robinsujob.github.io/media/magicvoice/magicvoice-demo.mp4" &gt;download the demo video directly&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;GPT-SoVITS lowered the barrier to few-shot voice cloning and cross-lingual speech synthesis. MagicVoice takes the next step by packaging these capabilities as a solution that can be rapidly deployed, easily used, and centrally managed within a customer&amp;rsquo;s AWS account.&lt;/p&gt;
&lt;p&gt;The value of MagicVoice lies not in any single model parameter, but in its end-to-end design for real-world usage:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Build a clean, intuitive frontend with AWS Cloudscape;&lt;/li&gt;
&lt;li&gt;Host and distribute the frontend through Amazon S3 and Amazon CloudFront;&lt;/li&gt;
&lt;li&gt;Run the GPT-SoVITS inference service on a GPU-enabled EC2 instance;&lt;/li&gt;
&lt;li&gt;Centrally manage characters, emotions, and model files in Amazon S3;&lt;/li&gt;
&lt;li&gt;Automate model synchronization and service reloads with Amazon EventBridge and AWS Systems Manager;&lt;/li&gt;
&lt;li&gt;Standardize repeatable deployment with AWS CDK and AWS CloudFormation;&lt;/li&gt;
&lt;li&gt;Separate model development from routine use to reduce complexity for end users.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Together, these design choices transform the developer-oriented GPT-SoVITS WebUI into an AWS TTS reference architecture that is easier to deploy, operate, and maintain.&lt;/p&gt;
&lt;h2 id="references"&gt;References
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/RVC-Boss/GPT-SoVITS" target="_blank" rel="noopener"
 &gt;GPT-SoVITS GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html" target="_blank" rel="noopener"
 &gt;Amazon CloudFront Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/EventBridge.html" target="_blank" rel="noopener"
 &gt;Using Amazon S3 with Amazon EventBridge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://docs.aws.amazon.com/systems-manager/latest/userguide/run-command.html" target="_blank" rel="noopener"
 &gt;AWS Systems Manager Run Command&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://docs.aws.amazon.com/cdk/v2/guide/home.html" target="_blank" rel="noopener"
 &gt;AWS CDK Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://calculator.aws/" target="_blank" rel="noopener"
 &gt;AWS Pricing Calculator&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>