# Intégrations externes : Pouvoir créer des intégrations de type "Fournisseur TTS"

**URL:** <https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-fournisseur-tts/10422>\
**Category:** Demandes livrées\
**Tags:** feature-core, in-progress\
**Created:** [Août 1, 2026, 10:43 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-fournisseur-tts/10422 "2026-08-01T10:43:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Août 1, 2026, 10:43 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-fournisseur-tts/10422/1 "2026-08-01T10:43:49Z")

</div>

Pouvoir créer des intégrations externes de TTS type «&nbsp;Gradium TTS&nbsp;», «&nbsp;Whisper&nbsp;», etc…

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Août 3, 2026, 2:52 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-fournisseur-tts/10422/2 "2026-08-03T14:52:11Z")

</div>

La PR côté Gladys :

> <https://github.com/GladysAssistant/Gladys/pull/2746>
>
> \### Description
> 
> This PR implements a pluggable text-to-speech (TTS) provider sy…stem that decouples TTS consumers (scene actions, voice assistant) from specific TTS engines. The system supports:
> 
> 1. \*\*Built-in Gladys Plus provider\*\* as the default, with fallback behavior
> 2. \*\*External TTS integrations\*\* (type: "tts") that expose a \`synthesize\` command over WebSocket
> 3. \*\*Provider selection UI\*\* on the Artificial Intelligence integration page to switch between available providers
> 4. \*\*Audio streaming\*\* via high-entropy tokens for LAN speakers (Sonos, Cast, etc.) that cannot send JWT authentication
> 
> \#### Key Changes
> 
> \*\*Backend:\*\*
> \- New \`Tts\` manager class (\`server/lib/tts/\`) with methods to:
> - List available providers (\`getProviders\`)
> - Get/set active provider configuration (\`getProviderConfiguration\`, \`setActiveProvider\`)
> - Generate speech URLs (\`getSpeechUrl\`) - dispatches to Gladys Plus or external provider
> - Serve synthesized audio clips (\`getAudio\`) with token-based access control
> - Manage audio lifecycle (purge expired clips, get local API base URL)
> \- TTS controller with three endpoints:
> - \`GET /api/v1/tts/provider\` - list providers and active selection
> - \`POST /api/v1/tts/provider\` - change active provider (admin only)
> - \`GET /api/v1/tts/audio/:token\` - serve audio clips (unauthenticated)
> \- Extended external integration proxy service registration to expose \`tts.synthesize\` capability for TTS-type integrations
> \- Validation of TTS manifest (rejects messaging/contact\_schema fields)
> \- Audio validation: content-type curation, size bounds, text length capping
> 
> \*\*Frontend:\*\*
> \- New \`TtsProviderSettings\` component for provider selection on the Artificial Intelligence integration page (\`front/src/routes/integration/all/openai/\`), next to the other voice/chat features
> \- Updated \`PlayNotification\` scene action to conditionally show Gladys Plus upsell only when using Gladys Plus
> \- Integration catalog support for TTS providers (empty by default, populated by external integrations)
> \- i18n strings for TTS category in English, French, and German
> 
> \*\*Tests:\*\*
> \- Comprehensive test suite for TTS manager (providers, configuration, speech URL generation, audio retrieval)
> \- External integration TTS provider tests (manifest validation, proxy service registration, audio handling)
> \- TTS controller tests (provider endpoints, audio serving)
> \- Updated existing tests to use new TTS system
> 
> \#### Design Notes
> 
> \- Audio clips stored in RAM only (no database table) behind high-entropy tokens - the token is the secret
> \- 10-minute TTL for synthesized clips with lazy purging
> \- Text capped before relay to provider (truncation, not error)
> \- Unauthenticated audio endpoint by design: speakers cannot send JWT, token provides security
> \- Local API base URL derived from the LAN-facing IPv4 (Docker bridges excluded, physical NICs preferred over VPN tunnels) + SERVER\_PORT for LAN accessibility
> \- Graceful fallback: if configured provider is unavailable, throws rather than silently switching
> 
> \### Checklist
> 
> \- \[x\] Tests pass: Added comprehensive unit tests for TTS manager, external integration TTS support, and controller endpoints
> \- \[x\] Linter and prettier pass
> \- \[x\] No breaking changes: New system is additive; existing Gladys Plus behavior unchanged when no provider configured
> 
> https://claude.ai/code/session\_013ihJhVk52zW6qUsxBHeqx2
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*New Features\*\*
> \* Added text-to-speech provider support, including provider selection and configuration.
> \* Added a dedicated TTS integration category with installation guidance and multilingual translations.
> \* Enabled TTS audio for scene announcements and voice-assistant responses.
> \* Added local-network audio delivery with short-lived secure URLs.
> \* Falls back to Gladys Plus when no external provider is selected or available.
> \* \*\*Bug Fixes\*\*
> \* Removing the active TTS provider now automatically restores Gladys Plus.
> \* Added validation for unsupported, oversized, malformed, or unavailable audio responses.

La PR côté SDK :

> <https://github.com/GladysAssistant/integration-sdk-js/pull/21>
>
> SDK counterpart of GladysAssistant/Gladys#2746 (B.20 "TTS provider" type): integ…rations declaring \`type: "tts"\` in their manifest become selectable as the voice of the instance, and answer synthesis requests over the existing WebSocket command channel.
> 
> \## What's added
> 
> \- \*\*\`WEBSOCKET\_MESSAGE\_TYPES.EXTERNAL\_INTEGRATION.TTS\_SYNTHESIZE\`\*\* (\`external-integration.tts.synthesize\`), routed in \`\_handleMessage\` like the other auto-acked commands.
> \- \*\*\`gladys.onTtsSynthesize(cb)\`\*\* — \`(text, language) =\> Promise\<string\>\` resolving the audio data-URI (\`\<content\_type\>;base64,...\`), acked back as \`data.audio\` (contract C.8). \`language\` is normalized to \`null\` when absent (best-effort hint: the user's language for the voice assistant, \`null\` in scenes).
> \- \*\*SDK-side validation of the resolved audio\*\* (\`\_mapTtsAudio\`, same pattern as the sync-webhook response mapping): curated content types (\`audio/mpeg\`, \`audio/wav\`, \`audio/ogg\`, \`audio/aac\`), decoded audio of 1 byte to 5 MB — the same bounds the core enforces in \`externalIntegration.registerProxyService.js\`, so a bad audio fails the ack with an explicit message on the integration side instead of an opaque \`EXTERNAL\_INTEGRATION\_INVALID\_TTS\_AUDIO\` on the Gladys side.
> \- \*\*Typings\*\* (\`onTtsSynthesize\`, \`TTS\_SYNTHESIZE\`) + type-test coverage.
> \- \*\*Tests\*\* (\`test/tts.test.js\`, 10 cases): success ack with \`data.audio\`, \`language\` defaulting to \`null\`, handler throw, missing handler ("not implemented"), non-string / missing separator / non-curated content type / empty audio / \> 5 MB rejections, exactly-5 MB accepted.
> \- \*\*README\*\*: handler-table row + a "TTS provider (the voice of the instance)" section, mirroring the camera/communication sections.
> 
> \## Checks
> 
> \- \`npm test\`: 190/190 pass
> \- \`npm run lint\`, \`npm run check-types\`, \`npm run prettier-check\`: clean
> 
> 🤖 Generated with \[Claude Code\](https://claude.com/claude-code)
> 
> https://claude.ai/code/session\_01LCCieF9vzy56ULFi9r6b2g
> 
> \---
> \_Generated by \[Claude Code\](https://claude.ai/code/session\_01LCCieF9vzy56ULFi9r6b2g)\_
> 
> 
> 
> \## Summary by CodeRabbit
> 
> \- \*\*New Features\*\*
> - Added text-to-speech synthesis support for integrations.
> - Handlers can receive text with an optional language hint and return playable base64 audio.
> - Supports MP3, WAV, OGG, and AAC audio up to 5 MB.
> - Added validation for audio formats, data, and response limits.
> 
> \- \*\*Documentation\*\*
> - Documented TTS provider setup, configuration, playback behavior, input limits, and validation requirements.
> - Added SDK API documentation for registering TTS synthesis handlers.

---

<div class="post-metadata">

**Author:** ![bertrandda](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bertrandda/32/5929_2.png) [@bertrandda](https://community.gladysassistant.com/u/bertrandda)\
**Post date:** [Octobre 22, 2026, 5:29 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-fournisseur-tts/10422/3 "2026-10-22T17:29:14Z")

</div>

Hello, sur ce sujet je me demandais comment tu voyais le truc pour des modèles locaux (que ce soit vocaux ou textes), sachant que les containers des intégrations externes sont limités en cpu/ram. Il faut que l’utilisateur lance un serveur de tts sur sa machine puis lance une intégration externe qui se connecte dessus ? Donc on ne serait plus sur du 1-click intégration.  
Ou est ce qu’on peut faire une exception d’isolation pour ces intégrations là ?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [Octobre 23, 2026, 8:04 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-fournisseur-tts/10422/4 "2026-10-23T08:04:59Z")

</div>

Merci pour la question, elle est légitime, et je pense qu’il faut distinguer deux niveaux.

**Les limites que tu cites ne concernent que le conteneur principal de l’intégration** , celui qui parle au core via WebSocket. Il est effectivement bridé à 0,5 CPU et 256 Mo, et c’est voulu : une intégration ne doit jamais pouvoir affamer Gladys sur un mini-PC.

Mais le framework prévoit déjà, dans le manifeste, des **sous-conteneurs** avec leurs propres limites, pensés à l’origine pour le cas Frigate :

- `memory_mb` : de 32 à 4096 Mo
- `cpu` : de 0,1 à 2 CPU
- `shm_mb` : de 64 à 512 Mo
- `devices` : accès `gpu`, `coral-usb`, `coral-pcie` ou `video`, chaque classe étant accordée (ou refusée) individuellement par l’utilisateur, et révocable à tout moment

Ces valeurs sont affichées sur l’écran d’installation, et c’est l’utilisateur qui accepte en connaissance de cause avant d’installer.

Concrètement, une intégration “Piper TTS” ou “Kokoro TTS” serait donc un conteneur principal léger (le pont avec Gladys) plus un sous-conteneur qui fait tourner le modèle, avec 1 ou 2 Go de RAM et le GPU si l’utilisateur l’accorde. Installation en un clic, pas de serveur à lancer à la main, et aucune exception d’isolation à prévoir : le mécanisme existe déjà.

**Pour ce qui dépasse ces bornes** (un gros modèle vocal qui veut 8 Go et 4 cœurs), là oui, le modèle assumé est “l’intégration est un client vers un serveur que tu héberges toi-même”. C’est exactement le fonctionnement de l’IA locale aujourd’hui avec Ollama ou un endpoint compatible OpenAI, et je trouve ça cohérent : quelqu’un qui fait tourner ce type de modèle chez lui a le matériel et sait lancer un conteneur. Ça ne s’adresse pas à l’utilisateur lambda.

Et pour le grand public, le chemin reste Gladys Plus : zéro configuration, zéro matériel, et la PR garde le repli automatique sur Gladys Plus si aucun fournisseur local n’est configuré 🙂

---

<div class="post-metadata">

**Author:** ![bertrandda](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/bertrandda/32/5929_2.png) [@bertrandda](https://community.gladysassistant.com/u/bertrandda)\
**Post date:** [Octobre 23, 2026, 7:24 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-fournisseur-tts/10422/5 "2026-10-23T19:24:30Z")

</div>

D’accord merci, je vais essayer avec le sous container pour un accès simplifié pour l’utilisateur et ensuite on verra pour plus. Il nous suffira alors d’une intégration externe compatible API OpenAI et presque tous les services d’IA seront gérés c’est trop cool 🚀

---

<div class="post-metadata">

**Author:** ![cursor-bot](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/cursor-bot/32/22252_2.png) [@cursor-bot](https://community.gladysassistant.com/u/cursor-bot)\
**Post date:** [Octobre 25, 2026, 2:49 UTC](https://community.gladysassistant.com/t/integrations-externes-pouvoir-creer-des-integrations-de-type-fournisseur-tts/10422/6 "2026-10-25T14:49:38Z")

</div>


