AGENT SKILL

localtts

This skill should be used when the user asks to "generate local TTS", "use local text to speech", "use remote TTS over Tailscale", "make speech audio", "add a TTS provider", "use Qwen3-TTS", or needs TTS endpoint setup through local or HivemindOS Tailscale routes.

License 许可
MIT
最近更新
2026-11-10
Stars
★ 13
Forks
4

01 前言 Front Matter

name
localtts
version
0.1.0
description
This skill should be used when the user asks to "generate local TTS", "use local text to speech", "use remote TTS over Tailscale", "make speech audio", "add a TTS provider", "use Qwen3-TTS", or needs TTS endpoint setup through local or HivemindOS Tailscale routes.

03 SKILL.md 正文

LocalTTS

Generate speech audio through local or HivemindOS Tailnet TTS services. Keep speech providers in this skill as blocks so agents can add new voices and engines without creating one skill per model.

Route modes

Use one of two modes:

  • Tailnet mode: call a remote TTS host over Tailscale. Use this when the voice model runs on another HivemindOS machine.
  • Local mode: call a TTS server running on the current machine. Use this only when the current machine owns the model files and service process.

Do not require Tailnet clients to have the TTS repo, model files, LaunchAgent, systemd unit, or localhost port. Do not use client-local 127.0.0.1 for a remote TTS provider.

Recommended endpoint contract

A local/Tailnet TTS provider should document at least these endpoints. Prefer OpenAI-compatible paths where possible, and add simple aliases only when they make clients easier to write.

Discovery and health

GET /health
GET /v1/models
GET /v1/voices
  • GET /health: liveness/readiness probe. Include service name, status, loaded model, device/backend, and version when available.
  • GET /v1/models: OpenAI-style model list. Return the model IDs accepted by generation calls.
  • GET /v1/voices: voice discovery. Return stable voice IDs/names, display names, languages, genders/styles if known, and provider-specific metadata needed by clients.

Useful optional endpoints

GET  /voices
GET  /v1/voices/<voice-id>
POST /v1/voices
POST /v1/audio/speech
POST /tts/synthesize
POST /synthesize
POST /api/tts
GET  /openapi.json
GET  /docs
  • GET /voices: compatibility alias for clients that do not use /v1/*; should return the same data shape as /v1/voices or clearly document differences.
  • GET /v1/voices/<voice-id>: details for one voice, including language support, sample rate, tags, and whether it requires a reference sample.
  • POST /v1/voices: register a new local cloned voice profile from multipart reference audio. Requires name and ref_audio; accepts language, description, model, ref_text, and x_vector_only_mode.
  • POST /v1/audio/speech: primary OpenAI-style speech generation endpoint. Accept model, input, voice, response_format, and provider extras such as language, instruct, speed, temperature, top_p, max_new_tokens, or seed.
  • POST /tts/synthesize: canonical JSON/base64 compatibility endpoint for clients that cannot handle binary audio responses.
  • POST /synthesize or POST /api/tts: JSON-native compatibility aliases for non-OpenAI clients. Document request/response exactly if the provider supports them.
  • GET /openapi.json and GET /docs: optional API schema and Swagger/ReDoc docs for human/client discovery.

Voice endpoint response template

{
  "object": "list",
  "data": [
    {
      "id": "<voice-id>",
      "name": "<display-name>",
      "language": "English",
      "languages": ["English"],
      "description": "Warm neutral narration voice.",
      "styles": ["neutral", "warm", "narration"],
      "sample_rate": 24000,
      "requires_reference_audio": false,
      "provider": "<provider-name>"
    }
  ]
}

Endpoint smoke tests

curl -fsS --max-time 5 http://<host>:<port>/health
curl -fsS --max-time 5 http://<host>:<port>/v1/models
curl -fsS --max-time 5 http://<host>:<port>/v1/voices
curl -fsS --max-time 5 http://<host>:<port>/voices || true

Generic Tailnet TTS template

Use this block when documenting an OpenAI-compatible or JSON TTS endpoint reachable through Tailscale.

Client route

  • Primary base URL: http://<magicdns-or-tailnet-ip>:<port>
  • HTTPS base URL, if configured: https://<magicdns-or-tailnet-ip>:<port>
  • Do not use 127.0.0.1 from the client unless the client is also the service host.

Tailnet client preflight

curl -fsS --max-time 5 http://<tailnet-host>:<port>/health
curl -fsS --max-time 5 http://<tailnet-host>:<port>/v1/models
curl -fsS --max-time 5 http://<tailnet-host>:<port>/v1/voices

If discovery endpoints fail, diagnose Tailnet reachability or the remote TTS host. Do not substitute unrelated local services on other ports.

OpenAI-style generation example

curl -fsS -X POST http://<tailnet-host>:<port>/v1/audio/speech \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "<model-id>",
    "input": "Hello from the HivemindOS Tailnet TTS endpoint.",
    "voice": "<voice-name>",
    "language": "English",
    "instruct": "Speak clearly and warmly.",
    "response_format": "wav",
    "max_new_tokens": 512
  }' \
  -o /tmp/tailnet-tts-output.wav

Verify output

ls -lh /tmp/tailnet-tts-output.wav
file /tmp/tailnet-tts-output.wav

Generic local TTS template

Use this block when the current machine runs the TTS service.

Local preflight

curl -fsS --max-time 5 http://127.0.0.1:<port>/health
curl -fsS --max-time 5 http://127.0.0.1:<port>/v1/models
curl -fsS --max-time 5 http://127.0.0.1:<port>/v1/voices
lsof -nP -iTCP:<port> -sTCP:LISTEN || true

Local generation example

curl -fsS -X POST http://127.0.0.1:<port>/v1/audio/speech \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "<model-id>",
    "input": "Hello from the local TTS endpoint.",
    "voice": "<voice-name>",
    "response_format": "wav"
  }' \
  -o /tmp/local-tts-output.wav

Qwen3-TTS provider template

Use this block as a starting point for Qwen3-TTS or a Qwen3-compatible local voice server.

Provider fields to fill in

  • Tailnet base URL: http://<qwen-tts-host>:<port>
  • Local service-host URL: http://127.0.0.1:<port>
  • Default model: <qwen3-tts-model-id>
  • Default voice: <voice-name>
  • Service directory on host: <path>
  • Service manager: <launchctl/systemd/docker/manual>
  • Logs: <path or command>
  • Precision/hardware note: <mps/cuda/cpu dtype constraints>

Service-host diagnostics only

curl -fsS --max-time 5 http://127.0.0.1:<port>/health || true
curl -fsS --max-time 5 http://127.0.0.1:<port>/v1/models || true
curl -fsS --max-time 5 http://127.0.0.1:<port>/v1/voices || true
curl -fsS --max-time 5 http://127.0.0.1:<port>/voices || true
lsof -nP -iTCP:<port> -sTCP:LISTEN || true
# macOS example:
launchctl print gui/$(id -u)/<service-label> || true
# Linux example:
systemctl --user status <service-name> || true

Delivery pattern

When generating audio for a chat user, save a .wav, .mp3, or .ogg under a stable absolute path and include it in the final response as a native media attachment when the runtime supports it.

Pitfalls

  • Keep TTS providers in this skill; do not create a new skill for every speech model.
  • Use a separate music/song skill for non-speech music generation.
  • Separate Tailnet client instructions from service-host diagnostics.
  • Treat raw Tailnet IPs as current examples, not permanent identifiers.
  • Do not store private Tailnet IPs, voice samples, transcripts, or machine-specific paths in bundled public templates unless they are placeholders.

04 同仓库更多 Skills

LiamVisionary
LiamVisionary/hivemindos

tailscale-generation-skill-authoring

This skill should be used when the user asks to "create a Tailscale generation skill", "add a local generation skill", "document a generation endpoint", "add an image generation provider", "add a TTS provider", "add video generation", "add 3D generation", or needs guidance on where HivemindOS Tailscale or local generation providers belong in the shared skills shelf.

★ 13
LiamVisionary
LiamVisionary/hivemindos

karpathy-guidelines

Behavioral guidelines to reduce common LLM coding mistakes. Use when writing, reviewing, or refactoring code to avoid overcomplication, make surgical changes, surface assumptions, and define verifiable success criteria.

★ 13
LiamVisionary
LiamVisionary/hivemindos

comfyui-image-generation

This skill should be used when the user asks to "generate images", "generate images with ComfyUI", "use local ComfyUI", "use remote ComfyUI", "use Z-Image", "add an image generation provider", or needs image-generation endpoint setup through local or HivemindOS Tailscale routes.

★ 13
LiamVisionary
LiamVisionary/hivemindos

wrangler

Cloudflare Workers CLI for deploying, developing, and managing Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, Containers, Queues, Workflows, Pipelines, and Secrets Store. Load before running wrangler commands to ensure correct syntax and best practices. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

★ 13
LiamVisionary
LiamVisionary/hivemindos

workers-best-practices

Reviews and authors Cloudflare Workers code against production best practices. Load when writing new Workers, reviewing Worker code, configuring wrangler.jsonc, or checking for common Workers anti-patterns (streaming, floating promises, global state, secrets, bindings, observability). Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

★ 13
LiamVisionary
LiamVisionary/hivemindos

sandbox-sdk

Build sandboxed applications for secure code execution. Load when building AI code execution, code interpreters, CI/CD systems, interactive dev environments, or executing untrusted code. Covers Sandbox SDK lifecycle, commands, files, code interpreter, and preview URLs. Biases towards retrieval from Cloudflare docs over pre-trained knowledge.

★ 13