<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ashim Upadhaya · Blog</title><description>Notes, opinions and the occasional random post by Ashim Upadhaya: software, teams, and what I learn while building things in Nepal.</description><link>https://uashim.com.np/</link><language>en</language><atom:link href="https://uashim.com.np/rss.xml" rel="self" type="application/rss+xml"/><lastBuildDate>Sun, 22 Nov 2026 00:00:00 GMT</lastBuildDate><item><title>Voice cloning on a Mac with Voicebox and open models</title><link>https://uashim.com.np/blog/voice-cloning-mac-voicebox/</link><guid isPermaLink="true">https://uashim.com.np/blog/voice-cloning-mac-voicebox/</guid><description>Voice cloning on a Mac, all local. My Voicebox setup, which open models I use and why, and working API examples in curl, Python and TypeScript.</description><pubDate>Sun, 22 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; I clone voices on my Mac with &lt;a href=&quot;https://github.com/jamiepine/voicebox&quot;&gt;Voicebox&lt;/a&gt; and open-weight models, because a cloud service was too expensive for my whole Sprache course library. This post covers the setup, the models I tried, what went wrong, and how to call Voicebox&apos;s local API from curl, Python and TypeScript.&lt;/p&gt;
&lt;p&gt;This is for developers with an Apple Silicon Mac who are comfortable in a terminal. Everything below was run on an M2 Pro with 16 GB, macOS 26.3.1 and Voicebox 0.5.0, in November 2026. Voicebox 0.6.0 has been released since. I have not retested on it, so check the release notes if something differs.&lt;/p&gt;
&lt;h2&gt;Why I run voice cloning locally&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://ashim.app/apps/sprache/&quot;&gt;Sprache&lt;/a&gt; has a feature where you hear yourself speak the language you are learning. I wanted it across the whole course library.&lt;/p&gt;
&lt;p&gt;I tried ElevenLabs first. It was too expensive to cover everything. So I moved to open-weight models on my own Mac. I have since generated more than 20 episodes of voice and dubbed more than 2,000 pieces of material in German and French this way. An episode comes from Sprache&apos;s story generator. It writes a story where you are the character, walking through the city you want to live in, in the language you are learning. In Sprache the voice is either the learner&apos;s own or one of the presets.&lt;/p&gt;
&lt;p&gt;It fits how I work. When a paid tool is almost right, I look at what it would take to build the missing part. I wrote more about that in &lt;a href=&quot;https://uashim.com.np/blog/why-i-build-my-own-tools/&quot;&gt;Why I build my own tools&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;What I run&lt;/h2&gt;
&lt;p&gt;Voicebox is a desktop app. Inside it are three programs:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Program&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;voicebox&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The desktop app. It starts the server.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;voicebox-server&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The local REST API.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;voicebox-mcp&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;An MCP server over stdio. It is a thin client of the REST API.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;My machine:&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Chip&lt;/td&gt;
&lt;td&gt;Apple M2 Pro&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;RAM&lt;/td&gt;
&lt;td&gt;16 GB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;macOS&lt;/td&gt;
&lt;td&gt;26.3.1&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Voicebox&lt;/td&gt;
&lt;td&gt;0.5.0 (MIT licence)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend&lt;/td&gt;
&lt;td&gt;MLX on Apple Silicon&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The models I have downloaded. Sizes are what the app reports.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Size&lt;/th&gt;
&lt;th&gt;What I use it for&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-Base&quot;&gt;Qwen3-TTS 1.7B Base&lt;/a&gt; (MLX bf16 build: &lt;a href=&quot;https://huggingface.co/mlx-community/Qwen3-TTS-12Hz-1.7B-Base-bf16&quot;&gt;mlx-community&lt;/a&gt;)&lt;/td&gt;
&lt;td&gt;4.3 GB&lt;/td&gt;
&lt;td&gt;Cloning a voice from a reference sample&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice&quot;&gt;Qwen3-TTS 1.7B CustomVoice&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;4.3 GB&lt;/td&gt;
&lt;td&gt;Built-in preset voices, with style instructions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://huggingface.co/hexgrad/Kokoro-82M&quot;&gt;Kokoro-82M&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;312 MB&lt;/td&gt;
&lt;td&gt;Small, very fast preset voices. No cloning.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://huggingface.co/ResembleAI/chatterbox&quot;&gt;Chatterbox&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;3.1 GB&lt;/td&gt;
&lt;td&gt;Multilingual cloning. The slowest one here.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;a href=&quot;https://huggingface.co/openai/whisper-base&quot;&gt;Whisper base&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;281 MB&lt;/td&gt;
&lt;td&gt;Speech to text&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Qwen3-TTS and Kokoro are Apache-2.0 on their model cards. Chatterbox is MIT.&lt;/p&gt;
&lt;h2&gt;Cloning a voice&lt;/h2&gt;
&lt;p&gt;The flow has three parts, whatever the engine:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Create a profile. A profile is a named voice.&lt;/li&gt;
&lt;li&gt;Give a cloned profile a reference recording of that voice.&lt;/li&gt;
&lt;li&gt;Generate speech from text with that profile and an engine that can clone: Qwen3-TTS Base or Chatterbox.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Preset voices work differently. They ship with the model (CustomVoice and Kokoro), so there is no sample to give. Voicebox marks each profile as &lt;code&gt;cloned&lt;/code&gt;, &lt;code&gt;preset&lt;/code&gt; or &lt;code&gt;designed&lt;/code&gt;. A preset profile carries its own default engine. A cloned one has none, and you pick &lt;code&gt;qwen&lt;/code&gt; or &lt;code&gt;chatterbox&lt;/code&gt; when you generate.&lt;/p&gt;
&lt;h3&gt;Your voice sample is the whole game&lt;/h3&gt;
&lt;p&gt;With too little sample, the result is bad. Your data is gold. Get the recording right before you blame the model.&lt;/p&gt;
&lt;h2&gt;Why I prefer Qwen3-TTS 1.7B&lt;/h2&gt;
&lt;p&gt;Of the models I tried, Qwen3-TTS 1.7B gives me the best results. That is my ear, not a benchmark. I use both Qwen3-TTS 1.7B models: Base for cloning and CustomVoice for presets.&lt;/p&gt;
&lt;p&gt;Speed is a separate question. I timed one short sentence per model (3.4 to 4.7 seconds of audio), from the generate call to the finished clip. Each number is a single run on a 16 GB machine with other apps open. Treat them as rough.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;First run (includes model load)&lt;/th&gt;
&lt;th&gt;Next run&lt;/th&gt;
&lt;th&gt;Audio length&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Kokoro 82M&lt;/td&gt;
&lt;td&gt;38.9 s&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;1.0 s&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;4.25 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3-TTS 1.7B Base (cloned German voice)&lt;/td&gt;
&lt;td&gt;31.3 s&lt;/td&gt;
&lt;td&gt;9.8 s&lt;/td&gt;
&lt;td&gt;3.6 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Qwen3-TTS 1.7B CustomVoice (preset)&lt;/td&gt;
&lt;td&gt;16.8 s&lt;/td&gt;
&lt;td&gt;21.3 s*&lt;/td&gt;
&lt;td&gt;3.8 to 4.2 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Chatterbox (cloned German voice)&lt;/td&gt;
&lt;td&gt;68.2 s&lt;/td&gt;
&lt;td&gt;32.9 s&lt;/td&gt;
&lt;td&gt;3.8 s&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;* One CustomVoice run took 49.1 s right after Chatterbox had loaded. With 16 GB, loading a 3 GB model pushes the others out of memory, so the next call pays to reload.&lt;/p&gt;
&lt;p&gt;How I read this:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Kokoro&lt;/strong&gt; for speed. About a second for a short line. It cannot clone.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Qwen3-TTS Base&lt;/strong&gt; for cloning when quality matters. About ten seconds warm.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Chatterbox&lt;/strong&gt; when I need its multilingual cloning and can wait. About 33 seconds warm.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I do not have a trustworthy memory number for Qwen. The server process looked small in &lt;code&gt;ps&lt;/code&gt; during Qwen runs, but that tool does not see MLX&apos;s GPU memory. If you need a number, use Activity Monitor.&lt;/p&gt;
&lt;h2&gt;Tutorial: call Voicebox from code&lt;/h2&gt;
&lt;p&gt;Voicebox has a local REST API. It lets you script generation from your own code. Four facts first:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The port is 17493&lt;/strong&gt;, not 8000. Some write-ups say 8000. For the app build it is 17493.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;It listens on &lt;code&gt;127.0.0.1&lt;/code&gt; only.&lt;/strong&gt; Other machines cannot reach it by default.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;There is no auth.&lt;/strong&gt; Anything on your Mac can call it. Do not forward the port.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generation is asynchronous.&lt;/strong&gt; &lt;code&gt;POST /generate&lt;/code&gt; returns at once with &lt;code&gt;status: &quot;generating&quot;&lt;/code&gt;. You poll, then download the audio.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The app has to be running, because it starts the server. The API description is at &lt;code&gt;http://127.0.0.1:17493/openapi.json&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;1. Check that the server is up&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;curl -s http://127.0.0.1:17493/health
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;{&quot;status&quot;:&quot;healthy&quot;,&quot;model_loaded&quot;:true,&quot;model_downloaded&quot;:true,&quot;model_size&quot;:&quot;1.7B&quot;,&quot;gpu_available&quot;:true,&quot;gpu_type&quot;:&quot;MPS (Apple Silicon)&quot;,&quot;vram_used_mb&quot;:null,&quot;backend_type&quot;:&quot;mlx&quot;,&quot;backend_variant&quot;:&quot;cpu&quot;,&quot;gpu_compatibility_warning&quot;:null}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;2. List models and profiles&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;curl -s http://127.0.0.1:17493/models/status | jq &apos;.models[] | select(.downloaded) | {model_name, hf_repo_id, size_mb, loaded}&apos;
curl -s http://127.0.0.1:17493/profiles | jq -r &apos;.[] | [.name, .voice_type, .default_engine] | @tsv&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Each profile has an &lt;code&gt;id&lt;/code&gt;, a &lt;code&gt;name&lt;/code&gt;, a &lt;code&gt;language&lt;/code&gt;, a &lt;code&gt;voice_type&lt;/code&gt; and a &lt;code&gt;default_engine&lt;/code&gt;. You need the &lt;code&gt;id&lt;/code&gt; to generate.&lt;/p&gt;
&lt;h3&gt;3. Generate, poll, download&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;curl -s -X POST http://127.0.0.1:17493/generate -H &apos;content-type: application/json&apos; \
  -d &apos;{&quot;profile_id&quot;:&quot;&amp;lt;id of your profile&amp;gt;&quot;,&quot;text&quot;:&quot;Hello from a local voice server.&quot;,&quot;language&quot;:&quot;en&quot;,&quot;engine&quot;:&quot;qwen_custom_voice&quot;,&quot;model_size&quot;:&quot;1.7B&quot;}&apos;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;{&quot;id&quot;:&quot;39f3abfe-4074-485e-8dec-071e1b0725cb&quot;,&quot;text&quot;:&quot;Hello from a local voice server.&quot;,&quot;language&quot;:&quot;en&quot;,&quot;audio_path&quot;:&quot;&quot;,&quot;duration&quot;:0.0,&quot;engine&quot;:&quot;qwen_custom_voice&quot;,&quot;model_size&quot;:&quot;1.7B&quot;,&quot;status&quot;:&quot;generating&quot;,&quot;error&quot;:null,&quot;source&quot;:&quot;manual&quot;, …}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then poll &lt;code&gt;GET /history/{id}&lt;/code&gt; until &lt;code&gt;status&lt;/code&gt; is &lt;code&gt;completed&lt;/code&gt; (or &lt;code&gt;failed&lt;/code&gt;), and fetch the audio from &lt;code&gt;GET /audio/{id}&lt;/code&gt;. The file is a 16-bit mono WAV at 24,000 Hz.&lt;/p&gt;
&lt;p&gt;Use &lt;code&gt;/history/{id}&lt;/code&gt; for polling. &lt;code&gt;/generate/{id}/status&lt;/code&gt; also exists, but it is a server-sent events stream, not plain JSON. That is fine in a browser and awkward in a script.&lt;/p&gt;
&lt;p&gt;Pass the right engine for the profile. A preset profile has its own &lt;code&gt;default_engine&lt;/code&gt;. A cloned profile has none, so use &lt;code&gt;qwen&lt;/code&gt; or &lt;code&gt;chatterbox&lt;/code&gt;. If you leave &lt;code&gt;engine&lt;/code&gt; out, it defaults to &lt;code&gt;qwen&lt;/code&gt;, which needs a cloned profile. All three scripts below handle this: they use the profile&apos;s default engine and fall back to &lt;code&gt;qwen&lt;/code&gt;. I did not test which error comes back for a wrong pairing.&lt;/p&gt;
&lt;p&gt;Other request fields I would look at: &lt;code&gt;seed&lt;/code&gt;, &lt;code&gt;instruct&lt;/code&gt; (style text, up to 500 characters), &lt;code&gt;normalize&lt;/code&gt;, &lt;code&gt;max_chunk_chars&lt;/code&gt; (long text is split) and &lt;code&gt;crossfade_ms&lt;/code&gt;. Text can be up to 50,000 characters.&lt;/p&gt;
&lt;h3&gt;The same flow as a script&lt;/h3&gt;
&lt;p&gt;Each script checks health, finds a profile by name, generates, polls and saves &lt;code&gt;out.wav&lt;/code&gt;. Change &lt;code&gt;hs-en-Ryan&lt;/code&gt; to a profile name in your own app. I ran all three on the Mac above, and each one produced a playable WAV.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;curl and jq&lt;/strong&gt; (&lt;code&gt;speak.sh&lt;/code&gt;; needs bash, curl and jq):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#!/usr/bin/env bash
# Voicebox 0.5.0 local API: text -&amp;gt; WAV. Needs curl and jq.
set -euo pipefail
B=${VOICEBOX_URL:-http://127.0.0.1:17493}
PROFILE_NAME=${1:-hs-en-Ryan}
TEXT=${2:-&quot;Hello from a local voice server.&quot;}
OUT=${3:-out.wav}

curl -sf &quot;$B/health&quot; | jq -r &apos;&quot;health: \(.status), backend: \(.backend_type)&quot;&apos; \
  || { echo &quot;Voicebox not reachable at $B. Is the app running?&quot; &amp;gt;&amp;amp;2; exit 1; }
PID=$(curl -sf &quot;$B/profiles&quot; | jq -r --arg n &quot;$PROFILE_NAME&quot; &apos;.[] | select(.name==$n) | .id&apos;)
[ -n &quot;$PID&quot; ] || { echo &quot;profile not found: $PROFILE_NAME&quot; &amp;gt;&amp;amp;2; exit 1; }
ENGINE=$(curl -sf &quot;$B/profiles/$PID&quot; | jq -r &apos;.default_engine // &quot;qwen&quot;&apos;)

GID=$(curl -sf -X POST &quot;$B/generate&quot; -H &apos;content-type: application/json&apos; \
  -d &quot;$(jq -n --arg p &quot;$PID&quot; --arg t &quot;$TEXT&quot; --arg e &quot;$ENGINE&quot; &apos;{profile_id:$p,text:$t,engine:$e,language:&quot;en&quot;}&apos;)&quot; | jq -r .id)
for _ in $(seq 1 120); do
  STATUS=$(curl -sf &quot;$B/history/$GID&quot; | jq -r .status)
  [ &quot;$STATUS&quot; = completed ] &amp;amp;&amp;amp; break
  [ &quot;$STATUS&quot; = failed ] &amp;amp;&amp;amp; { echo &quot;generation failed&quot; &amp;gt;&amp;amp;2; exit 1; }
  sleep 1
done
curl -sf &quot;$B/audio/$GID&quot; -o &quot;$OUT&quot;
echo &quot;saved $OUT ($(wc -c &amp;lt; &quot;$OUT&quot;) bytes)&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;health: healthy, backend: mlx
saved out.wav (153644 bytes)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Python&lt;/strong&gt; (&lt;code&gt;speak.py&lt;/code&gt;; standard library only, tested on Python 3.13):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&quot;&quot;&quot;Voicebox 0.5.0 local API: text -&amp;gt; WAV. Tested on Python 3.13, standard library only.&quot;&quot;&quot;
import json, sys, time, urllib.request

BASE = &quot;http://127.0.0.1:17493&quot;

def api(path, body=None):
    req = urllib.request.Request(
        BASE + path,
        data=json.dumps(body).encode() if body is not None else None,
        headers={&quot;content-type&quot;: &quot;application/json&quot;},
    )
    with urllib.request.urlopen(req, timeout=300) as r:
        return json.load(r)

def speak(text, profile_name=&quot;hs-en-Ryan&quot;, out=&quot;out.wav&quot;, language=&quot;en&quot;):
    profile = next((p for p in api(&quot;/profiles&quot;) if p[&quot;name&quot;] == profile_name), None)
    if profile is None:
        raise SystemExit(f&quot;profile not found: {profile_name}&quot;)
    gen = api(&quot;/generate&quot;, {
        &quot;profile_id&quot;: profile[&quot;id&quot;],
        &quot;text&quot;: text,
        &quot;language&quot;: language,
        &quot;engine&quot;: profile[&quot;default_engine&quot;] or &quot;qwen&quot;,
    })
    while True:
        status = api(f&quot;/history/{gen[&apos;id&apos;]}&quot;)
        if status[&quot;status&quot;] == &quot;completed&quot;:
            break
        if status[&quot;status&quot;] == &quot;failed&quot;:
            raise SystemExit(f&quot;generation failed: {status[&apos;error&apos;]}&quot;)
        time.sleep(0.5)
    with urllib.request.urlopen(f&quot;{BASE}/audio/{gen[&apos;id&apos;]}&quot;) as r, open(out, &quot;wb&quot;) as f:
        f.write(r.read())
    return status[&quot;duration&quot;]

if __name__ == &quot;__main__&quot;:
    print(api(&quot;/health&quot;)[&quot;status&quot;])
    seconds = speak(sys.argv[1] if len(sys.argv) &amp;gt; 1 else &quot;Hello from a local voice server.&quot;)
    print(f&quot;saved out.wav, {seconds:.2f}s of audio&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;healthy
saved out.wav, 2.32s of audio
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;TypeScript&lt;/strong&gt; (&lt;code&gt;speak.ts&lt;/code&gt;; I ran it on Node 23.9, which runs &lt;code&gt;.ts&lt;/code&gt; files directly and prints an ExperimentalWarning. Bun and Deno should also work. I did not test Node 22 or older, which may need &lt;code&gt;tsx&lt;/code&gt; or a build step):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Voicebox 0.5.0 local API: text -&amp;gt; WAV. Tested on Node 23.9 (runs .ts natively
// with `node speak.ts`); Bun and Deno should also work.
import { writeFile } from &quot;node:fs/promises&quot;;

const BASE = &quot;http://127.0.0.1:17493&quot;;

type Profile = { id: string; name: string; default_engine: string | null };
type Generation = { id: string; status: string; duration: number; error: string | null };

async function api&amp;lt;T&amp;gt;(path: string, body?: unknown): Promise&amp;lt;T&amp;gt; {
  const res = await fetch(BASE + path, {
    method: body === undefined ? &quot;GET&quot; : &quot;POST&quot;,
    headers: { &quot;content-type&quot;: &quot;application/json&quot; },
    body: body === undefined ? undefined : JSON.stringify(body),
  });
  if (!res.ok) throw new Error(`${path} -&amp;gt; ${res.status} ${await res.text()}`);
  return res.json() as Promise&amp;lt;T&amp;gt;;
}

async function speak(text: string, profileName = &quot;hs-en-Ryan&quot;, out = &quot;out.wav&quot;) {
  const profiles = await api&amp;lt;Profile[]&amp;gt;(&quot;/profiles&quot;);
  const profile = profiles.find((p) =&amp;gt; p.name === profileName);
  if (!profile) throw new Error(`profile not found: ${profileName}`);

  const gen = await api&amp;lt;Generation&amp;gt;(&quot;/generate&quot;, {
    profile_id: profile.id,
    text,
    language: &quot;en&quot;,
    engine: profile.default_engine ?? &quot;qwen&quot;,
  });

  let status = gen;
  while (status.status !== &quot;completed&quot;) {
    if (status.status === &quot;failed&quot;) throw new Error(`generation failed: ${status.error}`);
    await new Promise((r) =&amp;gt; setTimeout(r, 500));
    status = await api&amp;lt;Generation&amp;gt;(`/history/${gen.id}`);
  }
  const audio = await fetch(`${BASE}/audio/${gen.id}`);
  await writeFile(out, Buffer.from(await audio.arrayBuffer()));
  return status.duration;
}

const health = await api&amp;lt;{ status: string }&amp;gt;(&quot;/health&quot;);
console.log(health.status);
const seconds = await speak(process.argv[2] ?? &quot;Hello from a local voice server.&quot;);
console.log(`saved out.wav, ${seconds.toFixed(2)}s of audio`);
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;healthy
saved out.wav, 3.12s of audio
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The audio length and file size differ between runs, so your numbers will not match mine. The first call after launch can take much longer while the model loads (16 to 68 seconds in my tests), so keep the timeouts generous.&lt;/p&gt;
&lt;h3&gt;Transcribing: a gotcha&lt;/h3&gt;
&lt;p&gt;Voicebox also exposes &lt;code&gt;POST /transcribe&lt;/code&gt;, which uses Whisper base:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;curl -s -X POST http://127.0.0.1:17493/transcribe -F file=@out.wav
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Once, on a 2 second clip, it returned the right words and then looped: &lt;code&gt;Hello, from a local voice server! today today today today …&lt;/code&gt;. A second test of the same sentence on a fresh clip came back clean, so it does not always happen. Whisper models can repeat themselves on very short audio. If you see it, use longer audio, a larger Whisper model, or trim the repeats.&lt;/p&gt;
&lt;h3&gt;Using it from an AI agent over MCP&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;voicebox-mcp&lt;/code&gt; is an MCP server over stdio. It exposes four tools:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;voicebox.speak&lt;/code&gt; (&lt;code&gt;text&lt;/code&gt;, &lt;code&gt;profile&lt;/code&gt;, &lt;code&gt;engine&lt;/code&gt;, &lt;code&gt;personality&lt;/code&gt;, &lt;code&gt;language&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;voicebox.transcribe&lt;/code&gt; (&lt;code&gt;audio_base64&lt;/code&gt; or &lt;code&gt;audio_path&lt;/code&gt;, &lt;code&gt;language&lt;/code&gt;, &lt;code&gt;model&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;voicebox.list_captures&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;voicebox.list_profiles&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I first checked it with a raw JSON-RPC handshake over stdio. &lt;code&gt;initialize&lt;/code&gt; reported &lt;code&gt;{&quot;name&quot;:&quot;voicebox&quot;,&quot;version&quot;:&quot;3.2.4&quot;}&lt;/code&gt;, which is the MCP server&apos;s own version, not the app&apos;s. &lt;code&gt;list_profiles&lt;/code&gt; returned my profiles. This call started a generation:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;{&quot;name&quot;: &quot;voicebox.speak&quot;, &quot;arguments&quot;: {&quot;text&quot;: &quot;Hello from MCP.&quot;, &quot;profile&quot;: &quot;hs-en-Ryan&quot;}}
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;{&quot;generation_id&quot;:&quot;f5827029-…&quot;,&quot;status&quot;:&quot;generating&quot;,&quot;profile&quot;:&quot;hs-en-Ryan&quot;,&quot;source&quot;:&quot;mcp&quot;,&quot;poll_url&quot;:&quot;/generate/f5827029-…/status&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;speak&lt;/code&gt; returns an id, not audio. The caller still has to poll &lt;code&gt;/history/{id}&lt;/code&gt; and fetch &lt;code&gt;/audio/{id}&lt;/code&gt;, as above.&lt;/p&gt;
&lt;p&gt;To register it with Claude Code, the command is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;claude mcp add voicebox -- /Applications/Voicebox.app/Contents/MacOS/voicebox-mcp
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This worked in Claude Code. &lt;code&gt;claude mcp list&lt;/code&gt; showed &lt;code&gt;voicebox&lt;/code&gt; as connected, and a call to &lt;code&gt;list_profiles&lt;/code&gt; returned the profiles. It was tested with a temporary config, so my own Claude settings were not touched. The tool names Claude Code shows may differ slightly from the server&apos;s names above.&lt;/p&gt;
&lt;h2&gt;What went wrong, and what I&apos;d do differently&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Thin samples gave bad output.&lt;/strong&gt; With too little voice sample, the result is bad.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cold starts are long.&lt;/strong&gt; First use of a model took 16 to 68 seconds in my tests. Keep one engine loaded for a batch job.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;16 GB is tight.&lt;/strong&gt; Switching between Qwen and Chatterbox made later calls slow, because each load pushed the other out of memory. If you batch work, finish one model before you switch.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The port.&lt;/strong&gt; Some write-ups say 8000, but the app build listens on 17493. If calls fail, check the port first, and that the app is running.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Whose voice you should clone&lt;/h2&gt;
&lt;p&gt;My rule is simple: only my own voice, or a voice I have clear permission to use.&lt;/p&gt;
&lt;p&gt;A cloned voice can say things the real person never said. Permission is what keeps that honest. Voicebox has no auth on its API, so keep it on localhost, and keep reference recordings private.&lt;/p&gt;
&lt;h2&gt;Takeaway&lt;/h2&gt;
&lt;p&gt;Local voice cloning on a Mac is practical. A 16 GB machine runs it, the API is easy to script, and a good voice sample matters a lot.&lt;/p&gt;
&lt;p&gt;Next step: copy one of the scripts above, change the profile name and run it. To hear what I use it for, try &lt;a href=&quot;https://ashim.app/apps/sprache/&quot;&gt;Sprache&lt;/a&gt; and tell me what is missing.&lt;/p&gt;
&lt;h2&gt;Further reading&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/jamiepine/voicebox&quot;&gt;Voicebox repository&lt;/a&gt; (MIT)&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-Base&quot;&gt;Qwen3-TTS 1.7B Base model card&lt;/a&gt; and &lt;a href=&quot;https://huggingface.co/Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice&quot;&gt;CustomVoice&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://huggingface.co/hexgrad/Kokoro-82M&quot;&gt;Kokoro-82M model card&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://huggingface.co/ResembleAI/chatterbox&quot;&gt;Chatterbox model card&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://huggingface.co/openai/whisper-base&quot;&gt;Whisper base model card&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content:encoded><category>Tech</category><category>voice-cloning</category><category>text-to-speech</category><category>voicebox</category><category>apple-silicon</category><category>local-ai</category></item><item><title>Why I build my own tools: Canopy and Sprache</title><link>https://uashim.com.np/blog/why-i-build-my-own-tools/</link><guid isPermaLink="true">https://uashim.com.np/blog/why-i-build-my-own-tools/</guid><description>I built Canopy because my agentic IDE kept missing one feature, and Sprache because a paid language app taught me too little. Why I build my own.</description><pubDate>Sun, 22 Nov 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;strong&gt;TL;DR:&lt;/strong&gt; I build my own tools when an existing one is almost right and I would spend more time shopping for a better one than building the missing part. Canopy and Sprache came from that. It is not advice to build everything.&lt;/p&gt;
&lt;p&gt;This is for engineers who wonder if a side project is worth it.&lt;/p&gt;
&lt;h2&gt;The tool that was almost right&lt;/h2&gt;
&lt;p&gt;Before Canopy, I used an agentic IDE. It was good. I mean that. But there was always something I wished it had. It had other features I liked, and it lacked one or two I wanted. Most agentic IDEs I saw are built around a chat window. I wanted to see everything happening in one place, and move between different agents and workspaces easily.&lt;/p&gt;
&lt;p&gt;I could have looked for another one. But that means reading what each tool offers, installing it and testing it. For me, that was already too much work. I wanted the features I wanted in one place.&lt;/p&gt;
&lt;p&gt;So I built &lt;a href=&quot;https://ashim.app/apps/canopy/&quot;&gt;Canopy&lt;/a&gt;. It is written in Go and Next.js and runs teams of Claude Code agents as a live workspace tree.&lt;/p&gt;
&lt;p&gt;I want to be clear. Canopy is not a new idea. There are many open-source agentic IDEs you can pick up today. I don&apos;t think the tool I used was bad, and I don&apos;t think the others are bad. I built Canopy to make my own workflow easier.&lt;/p&gt;
&lt;h2&gt;Go, and why a side project is a good place to learn it&lt;/h2&gt;
&lt;p&gt;I am learning Go right now. A side project is a natural place to practise it.&lt;/p&gt;
&lt;p&gt;I also believe Go is faster than Python or Node.js, and I want a fast backend and a fast client for this kind of tool. That is my reason for choosing it. Don&apos;t take my word for it: benchmark it yourself for your own case.&lt;/p&gt;
&lt;p&gt;There was a second reason. I wanted to learn Go better by watching a complex application get built, and by reviewing and writing parts of it.&lt;/p&gt;
&lt;h2&gt;A different reason for Sprache&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://ashim.app/apps/sprache/&quot;&gt;Sprache&lt;/a&gt; came from a different place. I am learning German.&lt;/p&gt;
&lt;p&gt;I picked a popular language app because I had seen its ads. The ads looked good, so I signed up. I used the free version for a few chapters. The ads were a headache, but I kept going.&lt;/p&gt;
&lt;p&gt;Then I decided I was serious and bought the premium plan. After that, I felt I was learning very little. I had seen people say the same, and I didn&apos;t believe them at first. Then it happened to me. That is my experience, not a review of the app.&lt;/p&gt;
&lt;p&gt;So I collected the best ways to practise and the best course libraries I could find, and asked an AI to build me an app from them. I wanted a dictionary, and new words delivered to me regularly so my vocabulary keeps growing. That app is Sprache. It teaches German and French for Nepali speakers.&lt;/p&gt;
&lt;h2&gt;What this costs, and what it doesn&apos;t mean&lt;/h2&gt;
&lt;p&gt;I am not saying you should build everything. Building your own tool is work, and a good tool already exists for most jobs.&lt;/p&gt;
&lt;p&gt;My rule is smaller. I build when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;an existing tool is close, but misses a feature or two I want,&lt;/li&gt;
&lt;li&gt;finding and testing alternatives would take about as long as building the missing part, and&lt;/li&gt;
&lt;li&gt;I also want to learn something from the build.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you only want the tool to exist, use one that already does.&lt;/p&gt;
&lt;h2&gt;Takeaway&lt;/h2&gt;
&lt;p&gt;Build your own tool when the gap is small and personal, and the build teaches you something. Otherwise, use what exists.&lt;/p&gt;
&lt;p&gt;If you are curious, try &lt;a href=&quot;https://ashim.app/apps/canopy/&quot;&gt;Canopy&lt;/a&gt; or &lt;a href=&quot;https://ashim.app/apps/sprache/&quot;&gt;Sprache&lt;/a&gt;. Tell me what is missing.&lt;/p&gt;
</content:encoded><category>Opinions</category><category>side-projects</category><category>golang</category><category>ai-agents</category></item></channel></rss>