{
  "@context": "https://schema.org",
  "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-11-05-a-closer-look-at-phonon-tts-launching-high-quality-on/#webpage",
  "@type": [
    "WebPage",
    "ArchiveComponent"
  ],
  "articleBody": "Two weeks ago, we opened up Phonon, our small text-to-speech model that runs on your own device. It needs no server and no network, and what you type stays with you.\n\nWe've been very happy with the reception so far. So here's the story of the launch: why we built Phonon, what it can do, the demos that came with it, and how it did on Hugging Face's Open TTS Leaderboard.\n\n## Why a voice should live on your device\n\nMost voice AI lives in the cloud: every sentence makes a round trip to a server. Phonon runs on your own device instead. Your text stays there and the voice works without a network. We’ve also opened the weights. Phonon 31m is Apache 2.0, so you can use it for free, even in a commercial product. The other models are CC BY-NC, so they’re free for non-commercial projects. If you’re building something commercial with those, pricing is based on your number of users, not how much speech you generate.\n\nGetting a good voice to run on a small device has always been hard. You could make the model small, but then it didn’t sound great. Or you could make it sound great, but then it wouldn’t fit. We addressed both.\n\nWe announced Phonon in April and spent the next six months building on it with partners and early users. Their feedback helped us to shape this release. The models got smaller, and we added more languages and support for custom voices through voice cloning and voice design.\n\nPhonon is based on the [Pocket TTS](https://huggingface.co/kyutai/pocket-tts) lineage and as such uses flow matching to generate the audio which is very different from the modeling techniques used in other TTS systems. This is what allowed us to bring this level of quality to such a small model but it created new challenges while training the models. The training was initially numerically unstable and required several tricks to produce quality results on all five languages.\n\n## What we released\n\nPhonon comes in two sizes, at about 65 MB and 75 MB. Together they speak English, French, German, Spanish and Portuguese. There are more than 100 built-in voices, and you can create your own in [Gradium Studio](https://studio.gradium.ai/). Phonon also handles the important things that most other TTS systems often stumble on, like phone numbers, dates and codes.\n\nIt runs on phones, laptops, single-board computers and in a browser tab, so you can [hear it right now](https://huggingface.co/spaces/gradium/phonon). Phonon 31m speaks English and is Apache 2.0, so you can build on it freely, including for commercial products. Phonon 40m covers all five languages under a non-commercial license.\n\n## Demos and first projects\n\n[The launch](https://gradium.ai/blog/release-phonon-open-weight) came with demos from friends and from our own team. On an Apple Watch with Wi-Fi off, Phonon talks you through a coffee brew step by step. On an iPhone with no signal, it counts your reps and keeps you going. A robot called Lamp, from Autonomous, wears a sorting hat and talks in character. In a browser, an offline dino runner becomes a radio show hosted by Rex. There's also a sci-fi game voiced on the player's own machine, and Proust read aloud page by page.\n\nThe Hugging Face team built the Transformers integration, so developers could use Phonon in Transformers from day one.\n\nDevelopers have started building on it too. An [ExecuTorch conversion](https://huggingface.co/executorch-community/Phonon-31M-EN-ExecuTorch-WebGPU) runs Phonon on a visitor's GPU in the browser, [Micdrop](https://micdrop.dev/docs/ai-integration/provided-integrations/phonon.md) brings it to Node.js apps, and Spaces like [smallest-s2s](https://huggingface.co/spaces/Steveeeeeeen/smallest-s2s) build on it.\n\nPhonon was downloaded more than 200,000 times in its first two weeks, and it’s still trending on Hugging Face.\n\n## How Phonon did on the Hugging Face Open TTS Leaderboard\n\nThe [Open TTS Leaderboard](https://huggingface.co/spaces/hf-audio/open_tts_leaderboard) is a very new project from Hugging Face, and we love it. With more than 9,000 TTS models on the [Hugging Face Hub](https://huggingface.co/models?pipeline_tag=text-to-speech), the leaderboard gives developers one place to compare open models and hear them side by side. Across 23 languages, models are evaluated on **intelligibility** (*word error rate of the outputs*), **speed** (*inverse real-time factor and time-to-first audio*), and **naturalness** (*UTMOS for English and KOMOS for Korean*). Fixed-voice and voice cloning are evaluated, with an additional speaker similarity metric for the latter. The leaderboard also has a Listen tab, where you can conveniently compare TTS outputs yourself and vote for the ones you like the most.\n\nOn intelligibility, Phonon ranks first in [German](https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?languages=de) and [Spanish](https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?languages=es), and in the top three in every language we evaluated, next to models up to 100 times its size.\n\nSpeed is where we see Phonon truly shine, as the models top the [CPU streaming benchmark](https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?streaming-cpu) on time-to-first audio.\n\n[![Bar chart of the top 10 models by 95th-percentile time to first audio. Phonon 31m en is first at 28 ms and Phonon 40m en is second at 38 ms, ahead of Pocket TTS at 165 ms. Lower is better.](https://huggingface.co/datasets/olesiagradium/video/resolve/main/phonon-ttfa-chart.png)](https://huggingface.co/datasets/olesiagradium/video/resolve/main/phonon-ttfa-chart.png)\n\n## Inference\n\nWe built a new inference framework, [ptts](https://github.com/gradium-ai/xn-ptts), specifically for Phonon. The goal of ptts is to get the best performance on a wide variety of devices and as such supports more than 10 backends: CPU (Intel, Arm, WebAssembly), GPU (CUDA, Vulkan, Metal, WebGPU), and NPU (Apple Core ML, Snapdragon®).\n\nPhonon is also available in 🤗 Transformers, from v5.21, as its reference PyTorch implementation. Where `ptts` runs a single stream on device, Transformers targets GPU throughput: batched generation, full-graph `torch.compile`, e.g., for synthesizing speech datasets at scale. Being native PyTorch, it is a base to build upon, whether to integrate Phonon into your own stack or to study the model itself.\n\nIt belongs to the Pocket TTS lineage, so we first added Pocket TTS to Transformers. Phonon sits on top as a [modular](https://huggingface.co/docs/transformers/modular_transformers) model: about [200 lines](https://github.com/huggingface/transformers/blob/main/src/transformers/models/gradium_phonon_tts/modular_gradium_phonon_tts.py) describing only what differs.\n\nPhonon generates audio latents autoregressively: each step outputs a latent that is fed back as the next input, and the training loss is computed on them. Latents are the model's inputs, outputs and targets, as text tokens are for a language model, so the codec mapping audio to latents plays the role of a tokenizer. Transformers ships it as such: an [audio tokenizer](https://huggingface.co/docs/transformers/model_doc/pocket_tts_audio_tokenizer), held by the processor next to the text tokenizer:\n\n```py\nfrom transformers import AutoProcessor, GradiumPhononTTSForConditionalGeneration\n\nmodel_id = \"gradium/phonon-31m-en\"\nprocessor = AutoProcessor.from_pretrained(model_id, device_map=\"auto\")\nmodel = GradiumPhononTTSForConditionalGeneration.from_pretrained(model_id, device_map=\"auto\")\n\nprint(f\"{model.num_parameters():,}\")  # 30,788,354\nprint(f\"{processor.audio_tokenizer.num_parameters():,}\")  # 10,305,313\n```\n\nA voice is not a recording but a tensor of speaker latents. Phonon never encodes audio directly with its audio tokenizer, which ships decoder-only, and voices come precomputed: [gradium/phonon-voices](https://huggingface.co/gradium/phonon-voices).\n\n```py\nfrom huggingface_hub import hf_hub_download\nfrom safetensors.torch import load_file\n\npath = hf_hub_download(\"gradium/phonon-voices\", \"voices/LMDIYE0Oa377Qh6Z.safetensors\")\nvoice = load_file(path)[\"speaker_wavs\"][0].T  # (num_frames, 512)\n```\n\nThe prompt layout (voice positions, text, then a token opening the audio) ships with the checkpoint as a chat template, as for other multimodal models in Transformers. You write a standard conversation, with an empty `audio` item where the voice goes, and your code stays the same across checkpoints. The processor then expands the voice placeholder to one position per frame, normalizes and tokenizes the text, and batches the inputs:\n\n```py\nconversation = [\n    {\"role\": \"user\", \"content\": [{\"type\": \"audio\"}, {\"type\": \"text\", \"text\": \"Hello from Phonon.\"}]}\n]\ninputs = processor.apply_chat_template(\n    conversation,\n    tokenize=True,\n    return_dict=True,\n    add_generation_prompt=True,\n    processor_kwargs={\"audio_prompt_latents\": [voice]},\n).to(model.device)\n# prompt: <|audio_prompt|> × num_frames, \"Hello from Phonon.\", <|audio_bos|>\n```\n\n`generate` returns latents, which the processor decodes to audio:\n\n```py\noutputs = model.generate(**inputs)  # audio_latents: (batch_size, num_frames, 32)\naudio = processor.decode(outputs.audio_latents, outputs.audio_latents_mask)\nprocessor.save_audio(audio, \"phonon.wav\")\n```\n\nSee the [docs](https://huggingface.co/docs/transformers/model_doc/gradium_phonon_tts) 🤗 for more!\n\n## What's next\n\nPhonon can speak with any voice. Clone one from a short recording with the speaker’s consent, or describe a new one in plain text in [Gradium Studio](https://studio.gradium.ai/). Then download the voice file, load it in Phonon, and it runs fully on the device.\n\nWe also train custom Phonon models with design partners. If your memory budget is tight, we can make the model smaller. If you need Korean, Arabic or Japanese, we can train for that too. And if your product has its own vocabulary, we can fine-tune on it. [Get in touch](https://gradium.ai/contact?subject=Sales) and tell us what you need.\n\nThank you to the Hugging Face team, and to everyone who tried Phonon in its first two weeks.\n\nPhonon is our first open release. [Try it out](https://huggingface.co/spaces/gradium/phonon) and tell us what you build.\n",
  "authors": [],
  "captured_at": "2026-11-05T17:57:26.867095589+00:00",
  "category": "ai",
  "content_html": "<p>Two weeks ago, we opened up Phonon, our small text-to-speech model that runs on your own device. It needs no server and no network, and what you type stays with you.</p>\n<p>We've been very happy with the reception so far. So here's the story of the launch: why we built Phonon, what it can do, the demos that came with it, and how it did on Hugging Face's Open TTS Leaderboard.</p>\n<h2>Why a voice should live on your device</h2>\n<p>Most voice AI lives in the cloud: every sentence makes a round trip to a server. Phonon runs on your own device instead. Your text stays there and the voice works without a network. We’ve also opened the weights. Phonon 31m is Apache 2.0, so you can use it for free, even in a commercial product. The other models are CC BY-NC, so they’re free for non-commercial projects. If you’re building something commercial with those, pricing is based on your number of users, not how much speech you generate.</p>\n<p>Getting a good voice to run on a small device has always been hard. You could make the model small, but then it didn’t sound great. Or you could make it sound great, but then it wouldn’t fit. We addressed both.</p>\n<p>We announced Phonon in April and spent the next six months building on it with partners and early users. Their feedback helped us to shape this release. The models got smaller, and we added more languages and support for custom voices through voice cloning and voice design.</p>\n<p>Phonon is based on the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/kyutai/pocket-tts\">Pocket TTS</a> lineage and as such uses flow matching to generate the audio which is very different from the modeling techniques used in other TTS systems. This is what allowed us to bring this level of quality to such a small model but it created new challenges while training the models. The training was initially numerically unstable and required several tricks to produce quality results on all five languages.</p>\n<h2>What we released</h2>\n<p>Phonon comes in two sizes, at about 65 MB and 75 MB. Together they speak English, French, German, Spanish and Portuguese. There are more than 100 built-in voices, and you can create your own in <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://studio.gradium.ai/\">Gradium Studio</a>. Phonon also handles the important things that most other TTS systems often stumble on, like phone numbers, dates and codes.</p>\n<p>It runs on phones, laptops, single-board computers and in a browser tab, so you can <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/gradium/phonon\">hear it right now</a>. Phonon 31m speaks English and is Apache 2.0, so you can build on it freely, including for commercial products. Phonon 40m covers all five languages under a non-commercial license.</p>\n<h2>Demos and first projects</h2>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://gradium.ai/blog/release-phonon-open-weight\">The launch</a> came with demos from friends and from our own team. On an Apple Watch with Wi-Fi off, Phonon talks you through a coffee brew step by step. On an iPhone with no signal, it counts your reps and keeps you going. A robot called Lamp, from Autonomous, wears a sorting hat and talks in character. In a browser, an offline dino runner becomes a radio show hosted by Rex. There's also a sci-fi game voiced on the player's own machine, and Proust read aloud page by page.</p>\n<p>The Hugging Face team built the Transformers integration, so developers could use Phonon in Transformers from day one.</p>\n<p>Developers have started building on it too. An <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/executorch-community/Phonon-31M-EN-ExecuTorch-WebGPU\">ExecuTorch conversion</a> runs Phonon on a visitor's GPU in the browser, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://micdrop.dev/docs/ai-integration/provided-integrations/phonon.md\">Micdrop</a> brings it to Node.js apps, and Spaces like <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/Steveeeeeeen/smallest-s2s\">smallest-s2s</a> build on it.</p>\n<p>Phonon was downloaded more than 200,000 times in its first two weeks, and it’s still trending on Hugging Face.</p>\n<h2>How Phonon did on the Hugging Face Open TTS Leaderboard</h2>\n<p>The <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/hf-audio/open_tts_leaderboard\">Open TTS Leaderboard</a> is a very new project from Hugging Face, and we love it. With more than 9,000 TTS models on the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/models?pipeline_tag=text-to-speech\">Hugging Face Hub</a>, the leaderboard gives developers one place to compare open models and hear them side by side. Across 23 languages, models are evaluated on <strong>intelligibility</strong> (<em>word error rate of the outputs</em>), <strong>speed</strong> (<em>inverse real-time factor and time-to-first audio</em>), and <strong>naturalness</strong> (<em>UTMOS for English and KOMOS for Korean</em>). Fixed-voice and voice cloning are evaluated, with an additional speaker similarity metric for the latter. The leaderboard also has a Listen tab, where you can conveniently compare TTS outputs yourself and vote for the ones you like the most.</p>\n<p>On intelligibility, Phonon ranks first in <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?languages=de\">German</a> and <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?languages=es\">Spanish</a>, and in the top three in every language we evaluated, next to models up to 100 times its size.</p>\n<p>Speed is where we see Phonon truly shine, as the models top the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?streaming-cpu\">CPU streaming benchmark</a> on time-to-first audio.</p>\n<p><a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/datasets/olesiagradium/video/resolve/main/phonon-ttfa-chart.png\"><picture class=\"article-picture article-picture-fallback\" style=\"--image-ratio:16 / 9\"><img src=\"https://huggingface.co/datasets/olesiagradium/video/resolve/main/phonon-ttfa-chart.png\" alt=\"Bar chart of the top 10 models by 95th-percentile time to first audio. Phonon 31m en is first at 28 ms and Phonon 40m en is second at 38 ms, ahead of Pocket TTS at 165 ms. Lower is better.\" loading=\"eager\" decoding=\"async\" fetchpriority=\"high\" referrerpolicy=\"no-referrer\" class=\"progressive-image\"></picture></a></p>\n<h2>Inference</h2>\n<p>We built a new inference framework, <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/gradium-ai/xn-ptts\">ptts</a>, specifically for Phonon. The goal of ptts is to get the best performance on a wide variety of devices and as such supports more than 10 backends: CPU (Intel, Arm, WebAssembly), GPU (CUDA, Vulkan, Metal, WebGPU), and NPU (Apple Core ML, Snapdragon®).</p>\n<p>Phonon is also available in 🤗 Transformers, from v5.21, as its reference PyTorch implementation. Where <code>ptts</code> runs a single stream on device, Transformers targets GPU throughput: batched generation, full-graph <code>torch.compile</code>, e.g., for synthesizing speech datasets at scale. Being native PyTorch, it is a base to build upon, whether to integrate Phonon into your own stack or to study the model itself.</p>\n<p>It belongs to the Pocket TTS lineage, so we first added Pocket TTS to Transformers. Phonon sits on top as a <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/transformers/modular_transformers\">modular</a> model: about <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/huggingface/transformers/blob/main/src/transformers/models/gradium_phonon_tts/modular_gradium_phonon_tts.py\">200 lines</a> describing only what differs.</p>\n<p>Phonon generates audio latents autoregressively: each step outputs a latent that is fed back as the next input, and the training loss is computed on them. Latents are the model's inputs, outputs and targets, as text tokens are for a language model, so the codec mapping audio to latents plays the role of a tokenizer. Transformers ships it as such: an <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/transformers/model_doc/pocket_tts_audio_tokenizer\">audio tokenizer</a>, held by the processor next to the text tokenizer:</p>\n<pre><code class=\"language-py\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-from syntax-python\">from</span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-meta syntax-import-source syntax-python\"> <span class=\"syntax-meta syntax-import-path syntax-python\"><span class=\"syntax-meta syntax-import-name syntax-python\">transformers</span></span> <span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span></span></span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"> <span class=\"syntax-meta syntax-generic-name syntax-python\">AutoProcessor</span><span class=\"syntax-punctuation syntax-separator syntax-import-list syntax-python\">,</span> <span class=\"syntax-meta syntax-generic-name syntax-python\">GradiumPhononTTSForConditionalGeneration</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model_id</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">gradium/phonon-31m-en<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span>\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">processor</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">AutoProcessor</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">from_pretrained</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model_id</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span> <span class=\"syntax-variable syntax-parameter syntax-python\">device_map</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">auto<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">GradiumPhononTTSForConditionalGeneration</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">from_pretrained</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model_id</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span> <span class=\"syntax-variable syntax-parameter syntax-python\">device_map</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">auto<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n\n<span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-support syntax-function syntax-builtin syntax-python\">print</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-storage syntax-type syntax-string syntax-python\">f</span><span class=\"syntax-meta syntax-string syntax-interpolated syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-interpolated syntax-python\"><span class=\"syntax-meta syntax-interpolation syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-interpolation syntax-begin syntax-python\">{</span><span class=\"syntax-source syntax-python syntax-embedded\"><span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">num_parameters</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span></span><span class=\"syntax-meta syntax-format-spec syntax-python\"><span class=\"syntax-constant syntax-other syntax-format-spec syntax-python\">:,</span></span></span><span class=\"syntax-meta syntax-interpolation syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-interpolation syntax-end syntax-python\">}</span></span><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>  <span class=\"syntax-comment syntax-line syntax-number-sign syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-python\">#</span> 30,788,354\n</span><span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-support syntax-function syntax-builtin syntax-python\">print</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-storage syntax-type syntax-string syntax-python\">f</span><span class=\"syntax-meta syntax-string syntax-interpolated syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-interpolated syntax-python\"><span class=\"syntax-meta syntax-interpolation syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-interpolation syntax-begin syntax-python\">{</span><span class=\"syntax-source syntax-python syntax-embedded\"><span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">processor</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">audio_tokenizer</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">num_parameters</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span></span><span class=\"syntax-meta syntax-format-spec syntax-python\"><span class=\"syntax-constant syntax-other syntax-format-spec syntax-python\">:,</span></span></span><span class=\"syntax-meta syntax-interpolation syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-interpolation syntax-end syntax-python\">}</span></span><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>  <span class=\"syntax-comment syntax-line syntax-number-sign syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-python\">#</span> 10,305,313\n</span></span></span></code></pre>\n<p>A voice is not a recording but a tensor of speaker latents. Phonon never encodes audio directly with its audio tokenizer, which ships decoder-only, and voices come precomputed: <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/gradium/phonon-voices\">gradium/phonon-voices</a>.</p>\n<pre><code class=\"language-py\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-from syntax-python\">from</span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-meta syntax-import-source syntax-python\"> <span class=\"syntax-meta syntax-import-path syntax-python\"><span class=\"syntax-meta syntax-import-name syntax-python\">huggingface_hub</span></span> <span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span></span></span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"> <span class=\"syntax-meta syntax-generic-name syntax-python\">hf_hub_download</span></span>\n<span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-from syntax-python\">from</span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-meta syntax-import-source syntax-python\"> <span class=\"syntax-meta syntax-import-path syntax-python\"><span class=\"syntax-meta syntax-import-name syntax-python\">safetensors</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-import-name syntax-python\">torch</span></span> <span class=\"syntax-meta syntax-statement syntax-import syntax-python\"><span class=\"syntax-keyword syntax-control syntax-import syntax-python\">import</span></span></span></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"></span><span class=\"syntax-meta syntax-statement syntax-import syntax-python\"> <span class=\"syntax-meta syntax-generic-name syntax-python\">load_file</span></span>\n\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">path</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">hf_hub_download</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">gradium/phonon-voices<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">voices/LMDIYE0Oa377Qh6Z.safetensors<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">voice</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">load_file</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">path</span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python\">[</span></span><span class=\"syntax-meta syntax-item-access syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">speaker_wavs<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python\">]</span></span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-begin syntax-python\">[</span></span><span class=\"syntax-meta syntax-item-access syntax-arguments syntax-python\"><span class=\"syntax-constant syntax-numeric syntax-integer syntax-decimal syntax-python\">0</span></span><span class=\"syntax-meta syntax-item-access syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-brackets syntax-end syntax-python\">]</span></span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">T</span>  <span class=\"syntax-comment syntax-line syntax-number-sign syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-python\">#</span> (num_frames, 512)\n</span></span></span></code></pre>\n<p>The prompt layout (voice positions, text, then a token opening the audio) ships with the checkpoint as a chat template, as for other multimodal models in Transformers. You write a standard conversation, with an empty <code>audio</code> item where the voice goes, and your code stays the same across checkpoints. The processor then expands the voice placeholder to one position per frame, normalizes and tokenizes the text, and batches the inputs:</p>\n<pre><code class=\"language-py\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">conversation</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-structure syntax-list syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-list syntax-begin syntax-python\">[</span>\n    <span class=\"syntax-meta syntax-structure syntax-dictionary-or-set syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python\">{</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">role<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">user<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python\">,</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">content<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-structure syntax-list syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-list syntax-begin syntax-python\">[</span><span class=\"syntax-meta syntax-structure syntax-dictionary-or-set syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python\">{</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">type<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">audio<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python\">}</span></span><span class=\"syntax-punctuation syntax-separator syntax-list syntax-python\">,</span> <span class=\"syntax-meta syntax-structure syntax-dictionary-or-set syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python\">{</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">type<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">text<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-dictionary-or-set syntax-python\">,</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">text<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">Hello from Phonon.<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python\">}</span></span><span class=\"syntax-punctuation syntax-section syntax-list syntax-end syntax-python\">]</span></span><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python\">}</span></span>\n<span class=\"syntax-punctuation syntax-section syntax-list syntax-end syntax-python\">]</span></span>\n<span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">inputs</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">processor</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">apply_chat_template</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\">\n    <span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">conversation</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">tokenize</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-language syntax-python\">True</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">return_dict</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-language syntax-python\">True</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">add_generation_prompt</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-constant syntax-language syntax-python\">True</span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n    <span class=\"syntax-variable syntax-parameter syntax-python\">processor_kwargs</span><span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span><span class=\"syntax-meta syntax-structure syntax-dictionary-or-set syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-begin syntax-python\">{</span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">audio_prompt_latents<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span><span class=\"syntax-punctuation syntax-separator syntax-key-value syntax-python\">:</span> <span class=\"syntax-meta syntax-structure syntax-list syntax-python\"><span class=\"syntax-punctuation syntax-section syntax-list syntax-begin syntax-python\">[</span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">voice</span></span><span class=\"syntax-punctuation syntax-section syntax-list syntax-end syntax-python\">]</span></span><span class=\"syntax-punctuation syntax-section syntax-dictionary-or-set syntax-end syntax-python\">}</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span>\n</span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span><span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">to</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">device</span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n<span class=\"syntax-comment syntax-line syntax-number-sign syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-python\">#</span> prompt: &lt;|audio_prompt|&gt; × num_frames, &quot;Hello from Phonon.&quot;, &lt;|audio_bos|&gt;\n</span></span></span></code></pre>\n<p><code>generate</code> returns latents, which the processor decodes to audio:</p>\n<pre><code class=\"language-py\"><span class=\"code-snippet\" data-language=\"Python\"><span class=\"syntax-source syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">outputs</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">model</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">generate</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-keyword syntax-operator syntax-arithmetic syntax-python\">*</span><span class=\"syntax-keyword syntax-operator syntax-arithmetic syntax-python\">*</span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">inputs</span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>  <span class=\"syntax-comment syntax-line syntax-number-sign syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-comment syntax-python\">#</span> audio_latents: (batch_size, num_frames, 32)\n</span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">audio</span></span> <span class=\"syntax-keyword syntax-operator syntax-assignment syntax-python\">=</span> <span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">processor</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">decode</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">outputs</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">audio_latents</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span> <span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">outputs</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span><span class=\"syntax-meta syntax-generic-name syntax-python\">audio_latents_mask</span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n<span class=\"syntax-meta syntax-function-call syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">processor</span><span class=\"syntax-punctuation syntax-accessor syntax-dot syntax-python\">.</span></span><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-variable syntax-function syntax-python\">save_audio</span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-begin syntax-python\">(</span><span class=\"syntax-meta syntax-function-call syntax-arguments syntax-python\"><span class=\"syntax-meta syntax-qualified-name syntax-python\"><span class=\"syntax-meta syntax-generic-name syntax-python\">audio</span></span><span class=\"syntax-punctuation syntax-separator syntax-arguments syntax-python\">,</span> <span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\"><span class=\"syntax-punctuation syntax-definition syntax-string syntax-begin syntax-python\">&quot;</span></span></span><span class=\"syntax-meta syntax-string syntax-python\"><span class=\"syntax-string syntax-quoted syntax-double syntax-python\">phonon.wav<span class=\"syntax-punctuation syntax-definition syntax-string syntax-end syntax-python\">&quot;</span></span></span></span><span class=\"syntax-punctuation syntax-section syntax-arguments syntax-end syntax-python\">)</span></span>\n</span></span></code></pre>\n<p>See the <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/docs/transformers/model_doc/gradium_phonon_tts\">docs</a> 🤗 for more!</p>\n<h2>What's next</h2>\n<p>Phonon can speak with any voice. Clone one from a short recording with the speaker’s consent, or describe a new one in plain text in <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://studio.gradium.ai/\">Gradium Studio</a>. Then download the voice file, load it in Phonon, and it runs fully on the device.</p>\n<p>We also train custom Phonon models with design partners. If your memory budget is tight, we can make the model smaller. If you need Korean, Arabic or Japanese, we can train for that too. And if your product has its own vocabulary, we can fine-tune on it. <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://gradium.ai/contact?subject=Sales\">Get in touch</a> and tell us what you need.</p>\n<p>Thank you to the Hugging Face team, and to everyone who tried Phonon in its first two weeks.</p>\n<p>Phonon is our first open release. <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://huggingface.co/spaces/gradium/phonon\">Try it out</a> and tell us what you build.</p>\n",
  "content_markdown": "Two weeks ago, we opened up Phonon, our small text-to-speech model that runs on your own device. It needs no server and no network, and what you type stays with you.\n\nWe've been very happy with the reception so far. So here's the story of the launch: why we built Phonon, what it can do, the demos that came with it, and how it did on Hugging Face's Open TTS Leaderboard.\n\n## Why a voice should live on your device\n\nMost voice AI lives in the cloud: every sentence makes a round trip to a server. Phonon runs on your own device instead. Your text stays there and the voice works without a network. We’ve also opened the weights. Phonon 31m is Apache 2.0, so you can use it for free, even in a commercial product. The other models are CC BY-NC, so they’re free for non-commercial projects. If you’re building something commercial with those, pricing is based on your number of users, not how much speech you generate.\n\nGetting a good voice to run on a small device has always been hard. You could make the model small, but then it didn’t sound great. Or you could make it sound great, but then it wouldn’t fit. We addressed both.\n\nWe announced Phonon in April and spent the next six months building on it with partners and early users. Their feedback helped us to shape this release. The models got smaller, and we added more languages and support for custom voices through voice cloning and voice design.\n\nPhonon is based on the [Pocket TTS](https://huggingface.co/kyutai/pocket-tts) lineage and as such uses flow matching to generate the audio which is very different from the modeling techniques used in other TTS systems. This is what allowed us to bring this level of quality to such a small model but it created new challenges while training the models. The training was initially numerically unstable and required several tricks to produce quality results on all five languages.\n\n## What we released\n\nPhonon comes in two sizes, at about 65 MB and 75 MB. Together they speak English, French, German, Spanish and Portuguese. There are more than 100 built-in voices, and you can create your own in [Gradium Studio](https://studio.gradium.ai/). Phonon also handles the important things that most other TTS systems often stumble on, like phone numbers, dates and codes.\n\nIt runs on phones, laptops, single-board computers and in a browser tab, so you can [hear it right now](https://huggingface.co/spaces/gradium/phonon). Phonon 31m speaks English and is Apache 2.0, so you can build on it freely, including for commercial products. Phonon 40m covers all five languages under a non-commercial license.\n\n## Demos and first projects\n\n[The launch](https://gradium.ai/blog/release-phonon-open-weight) came with demos from friends and from our own team. On an Apple Watch with Wi-Fi off, Phonon talks you through a coffee brew step by step. On an iPhone with no signal, it counts your reps and keeps you going. A robot called Lamp, from Autonomous, wears a sorting hat and talks in character. In a browser, an offline dino runner becomes a radio show hosted by Rex. There's also a sci-fi game voiced on the player's own machine, and Proust read aloud page by page.\n\nThe Hugging Face team built the Transformers integration, so developers could use Phonon in Transformers from day one.\n\nDevelopers have started building on it too. An [ExecuTorch conversion](https://huggingface.co/executorch-community/Phonon-31M-EN-ExecuTorch-WebGPU) runs Phonon on a visitor's GPU in the browser, [Micdrop](https://micdrop.dev/docs/ai-integration/provided-integrations/phonon.md) brings it to Node.js apps, and Spaces like [smallest-s2s](https://huggingface.co/spaces/Steveeeeeeen/smallest-s2s) build on it.\n\nPhonon was downloaded more than 200,000 times in its first two weeks, and it’s still trending on Hugging Face.\n\n## How Phonon did on the Hugging Face Open TTS Leaderboard\n\nThe [Open TTS Leaderboard](https://huggingface.co/spaces/hf-audio/open_tts_leaderboard) is a very new project from Hugging Face, and we love it. With more than 9,000 TTS models on the [Hugging Face Hub](https://huggingface.co/models?pipeline_tag=text-to-speech), the leaderboard gives developers one place to compare open models and hear them side by side. Across 23 languages, models are evaluated on **intelligibility** (*word error rate of the outputs*), **speed** (*inverse real-time factor and time-to-first audio*), and **naturalness** (*UTMOS for English and KOMOS for Korean*). Fixed-voice and voice cloning are evaluated, with an additional speaker similarity metric for the latter. The leaderboard also has a Listen tab, where you can conveniently compare TTS outputs yourself and vote for the ones you like the most.\n\nOn intelligibility, Phonon ranks first in [German](https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?languages=de) and [Spanish](https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?languages=es), and in the top three in every language we evaluated, next to models up to 100 times its size.\n\nSpeed is where we see Phonon truly shine, as the models top the [CPU streaming benchmark](https://huggingface.co/spaces/hf-audio/open_tts_leaderboard?streaming-cpu) on time-to-first audio.\n\n[![Bar chart of the top 10 models by 95th-percentile time to first audio. Phonon 31m en is first at 28 ms and Phonon 40m en is second at 38 ms, ahead of Pocket TTS at 165 ms. Lower is better.](https://huggingface.co/datasets/olesiagradium/video/resolve/main/phonon-ttfa-chart.png)](https://huggingface.co/datasets/olesiagradium/video/resolve/main/phonon-ttfa-chart.png)\n\n## Inference\n\nWe built a new inference framework, [ptts](https://github.com/gradium-ai/xn-ptts), specifically for Phonon. The goal of ptts is to get the best performance on a wide variety of devices and as such supports more than 10 backends: CPU (Intel, Arm, WebAssembly), GPU (CUDA, Vulkan, Metal, WebGPU), and NPU (Apple Core ML, Snapdragon®).\n\nPhonon is also available in 🤗 Transformers, from v5.21, as its reference PyTorch implementation. Where `ptts` runs a single stream on device, Transformers targets GPU throughput: batched generation, full-graph `torch.compile`, e.g., for synthesizing speech datasets at scale. Being native PyTorch, it is a base to build upon, whether to integrate Phonon into your own stack or to study the model itself.\n\nIt belongs to the Pocket TTS lineage, so we first added Pocket TTS to Transformers. Phonon sits on top as a [modular](https://huggingface.co/docs/transformers/modular_transformers) model: about [200 lines](https://github.com/huggingface/transformers/blob/main/src/transformers/models/gradium_phonon_tts/modular_gradium_phonon_tts.py) describing only what differs.\n\nPhonon generates audio latents autoregressively: each step outputs a latent that is fed back as the next input, and the training loss is computed on them. Latents are the model's inputs, outputs and targets, as text tokens are for a language model, so the codec mapping audio to latents plays the role of a tokenizer. Transformers ships it as such: an [audio tokenizer](https://huggingface.co/docs/transformers/model_doc/pocket_tts_audio_tokenizer), held by the processor next to the text tokenizer:\n\n```py\nfrom transformers import AutoProcessor, GradiumPhononTTSForConditionalGeneration\n\nmodel_id = \"gradium/phonon-31m-en\"\nprocessor = AutoProcessor.from_pretrained(model_id, device_map=\"auto\")\nmodel = GradiumPhononTTSForConditionalGeneration.from_pretrained(model_id, device_map=\"auto\")\n\nprint(f\"{model.num_parameters():,}\")  # 30,788,354\nprint(f\"{processor.audio_tokenizer.num_parameters():,}\")  # 10,305,313\n```\n\nA voice is not a recording but a tensor of speaker latents. Phonon never encodes audio directly with its audio tokenizer, which ships decoder-only, and voices come precomputed: [gradium/phonon-voices](https://huggingface.co/gradium/phonon-voices).\n\n```py\nfrom huggingface_hub import hf_hub_download\nfrom safetensors.torch import load_file\n\npath = hf_hub_download(\"gradium/phonon-voices\", \"voices/LMDIYE0Oa377Qh6Z.safetensors\")\nvoice = load_file(path)[\"speaker_wavs\"][0].T  # (num_frames, 512)\n```\n\nThe prompt layout (voice positions, text, then a token opening the audio) ships with the checkpoint as a chat template, as for other multimodal models in Transformers. You write a standard conversation, with an empty `audio` item where the voice goes, and your code stays the same across checkpoints. The processor then expands the voice placeholder to one position per frame, normalizes and tokenizes the text, and batches the inputs:\n\n```py\nconversation = [\n    {\"role\": \"user\", \"content\": [{\"type\": \"audio\"}, {\"type\": \"text\", \"text\": \"Hello from Phonon.\"}]}\n]\ninputs = processor.apply_chat_template(\n    conversation,\n    tokenize=True,\n    return_dict=True,\n    add_generation_prompt=True,\n    processor_kwargs={\"audio_prompt_latents\": [voice]},\n).to(model.device)\n# prompt: <|audio_prompt|> × num_frames, \"Hello from Phonon.\", <|audio_bos|>\n```\n\n`generate` returns latents, which the processor decodes to audio:\n\n```py\noutputs = model.generate(**inputs)  # audio_latents: (batch_size, num_frames, 32)\naudio = processor.decode(outputs.audio_latents, outputs.audio_latents_mask)\nprocessor.save_audio(audio, \"phonon.wav\")\n```\n\nSee the [docs](https://huggingface.co/docs/transformers/model_doc/gradium_phonon_tts) 🤗 for more!\n\n## What's next\n\nPhonon can speak with any voice. Clone one from a short recording with the speaker’s consent, or describe a new one in plain text in [Gradium Studio](https://studio.gradium.ai/). Then download the voice file, load it in Phonon, and it runs fully on the device.\n\nWe also train custom Phonon models with design partners. If your memory budget is tight, we can make the model smaller. If you need Korean, Arabic or Japanese, we can train for that too. And if your product has its own vocabulary, we can fine-tune on it. [Get in touch](https://gradium.ai/contact?subject=Sales) and tell us what you need.\n\nThank you to the Hugging Face team, and to everyone who tried Phonon in its first two weeks.\n\nPhonon is our first open release. [Try it out](https://huggingface.co/spaces/gradium/phonon) and tell us what you build.\n",
  "dateCreated": "2026-11-05T17:57:26.867095589+00:00",
  "date_created": "2026-11-05T00:00:00+00:00",
  "date_modified": "2026-11-05T00:00:00+00:00",
  "date_published": "2026-11-05T00:00:00+00:00",
  "description": "Two weeks ago, we opened up Phonon, our small text-to-speech model that runs on your own device. It needs no server and no network, and what you type stays with you. We've been very happy with the reception so far. So here's the story of…",
  "external_url": "https://huggingface.co/blog/phonon-tts",
  "git": {
    "commit": "20068632b65d2830a2d54f25ca1d90d697bea2c0",
    "path": "items/huggingface-co/2026/11/2026-11-05-a-closer-look-at-phonon-tts-launching-high-quality-on.md",
    "permalink": "https://github.com/aymericbeaumet/aggr-instance/blob/20068632b65d2830a2d54f25ca1d90d697bea2c0/items/huggingface-co/2026/11/2026-11-05-a-closer-look-at-phonon-tts-launching-high-quality-on.md"
  },
  "id": "urn:aggr:item:44f87ce4256c4d3f191a1e765fb56f53364301f8",
  "isBasedOn": {
    "@id": "https://huggingface.co/blog/phonon-tts"
  },
  "mainEntity": {
    "@id": "https://huggingface.co/blog/phonon-tts",
    "@type": "CreativeWork",
    "archivedAt": {
      "@id": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-11-05-a-closer-look-at-phonon-tts-launching-high-quality-on/#webpage"
    },
    "dateModified": "2026-11-05T00:00:00+00:00",
    "datePublished": "2026-11-05T00:00:00+00:00",
    "headline": "A Closer Look at Phonon TTS. Launching High-Quality On-Device Speech That Tops the Benchmarks.",
    "image": {
      "@type": "ImageObject",
      "caption": null,
      "height": 90,
      "url": "https://huggingface.co/blog/assets/phonon-closer-look/thumbnail.png",
      "width": 160
    },
    "timeRequired": "PT6M",
    "url": "https://huggingface.co/blog/phonon-tts",
    "wordCount": 1347
  },
  "name": "Archived snapshot: A Closer Look at Phonon TTS. Launching High-Quality On-Device Speech That Tops the Benchmarks.",
  "preview": {
    "alt": null,
    "color": null,
    "height": 90,
    "placeholder": {
      "data_url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII=",
      "hash": ""
    },
    "url": "https://huggingface.co/blog/assets/phonon-closer-look/thumbnail.png",
    "width": 160
  },
  "reading_minutes": 6,
  "replicated_at": null,
  "source": "huggingface-co",
  "source_name": "Hugging Face - Blog",
  "summary": null,
  "tags": [],
  "temporalCoverage": "2026-11-05T17:57:26.867095589+00:00",
  "title": "A Closer Look at Phonon TTS. Launching High-Quality On-Device Speech That Tops the Benchmarks.",
  "url": "https://aggr.aymericbeaumet.com/items/huggingface-co/2026-11-05-a-closer-look-at-phonon-tts-launching-high-quality-on/",
  "word_count": 1347
}