Files
rag-technical-docs-assistant/docker-compose.local-s2s-test.yml
T
amirhosein mazaheri 8d348f0ba1 feat(voice): add isolated Local S2S v3 candidate and acceptance evidence
Extract the provider boundary while retaining OpenAI/Gemini contracts. Add
an opt-in isolated Local S2S adapter, pinned engine extension, bounded
component gateway and frozen effective configuration profiles.

Enforce request token limits, zero retries, local asset validation,
connection deadlines, disconnect ownership, bounded cleanup and signals.
Include regression coverage, pinned source fixtures, operator guidance,
asset fingerprints and guarded disposable PostgreSQL acceptance tooling.
Preserve immutable fixture bytes across Git line-ending conversion.

Validation recorded in the reports:
- 74 repair, 107 combined and 242 preservation checks passed.
- Fresh PostgreSQL local checks: 2 passed.
- Expanded PostgreSQL: 57 passed, 6 documented baseline failures.
- Compose configurations, staged whitespace and fixture hashes passed.

Phase 1 live listening and Phase 2 complete engine/SDK/POSIX, real component
audio and Persian browser acceptance remain pending. No operational switch,
paid call, model download or Phase 3 implementation is included.
2026-10-15 12:28:17 +03:30

105 lines
4.3 KiB
YAML

# Standalone file: never extend the operational compose stack.
name: rag-local-s2s-test
x-candidate-env: &candidate-env
PROVIDER: local_s2s
VOICE_PROVIDER: local_s2s
LOCAL_S2S_ENABLED: ${LOCAL_S2S_ENABLE_CANDIDATE:-false}
VOICE_TRANSPORT_TESTING: "true"
LOCAL_S2S_ENDPOINT: ws://local-s2s-engine:8765/v1/realtime
LOCAL_S2S_STT_MODEL: ${LOCAL_S2S_STT_MODEL:-openai/whisper-large-v3}
LOCAL_S2S_LLM_MODEL: ${LOCAL_S2S_LLM_MODEL:-openai/gpt-4.1-mini}
LOCAL_S2S_TTS_MODEL: ${LOCAL_S2S_TTS_MODEL:-google/gemini-3.8-flash-lite-tts}
LOCAL_S2S_TTS_VOICE: ${LOCAL_S2S_TTS_VOICE:-Kore}
LOCAL_S2S_MAX_OUTPUT_TOKENS: "256"
LOCAL_S2S_REQUEST_TIMEOUT_SECONDS: "30"
LOCAL_S2S_TOKEN: ${LOCAL_S2S_TOKEN:-}
INGEST_DATABASE_URL: postgresql+psycopg://local_s2s_test:isolated-test-only@candidate_db:5432/rag_local_s2s_test
INGEST_ORIGINAL_DIRECTORY: /app/data/local-s2s-test/originals
INGEST_EXTRACTION_DIRECTORY: /app/data/local-s2s-test/extractions
# Greeting/transport-only profile; this endpoint deliberately cannot do inference.
INGEST_EMBEDDING_PROVIDER: openai
INGEST_EMBEDDING_ENDPOINT: http://127.0.0.1:9/v1
INGEST_EMBEDDING_MODEL: text-embedding-3-small
INGEST_EMBEDDING_DIMENSIONS: "1536"
INGEST_EMBEDDING_API_KEY: transport-test-no-inference
TRUSTED_ORIGINS: '["http://127.0.0.2:8091"]'
TRUSTED_HOSTS: '["127.0.0.2:8091"]'
COOKIE_SECURE: "false"
services:
candidate_db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_DB: rag_local_s2s_test
POSTGRES_USER: local_s2s_test
POSTGRES_PASSWORD: isolated-test-only
volumes: [candidate_postgres:/var/lib/postgresql/data]
healthcheck:
test: [CMD-SHELL, pg_isready -U local_s2s_test -d rag_local_s2s_test]
interval: 3s
timeout: 3s
retries: 20
candidate_migrations:
image: rag-local-s2s-candidate:phase2
environment: *candidate-env
command: [alembic, upgrade, head]
depends_on:
candidate_db: {condition: service_healthy}
local-s2s-engine:
image: rag-local-s2s-candidate:phase2
environment:
PROVIDER: local_s2s
VOICE_PROVIDER: local_s2s
LOCAL_S2S_ENABLED: ${LOCAL_S2S_ENABLE_CANDIDATE:-false}
VOICE_TRANSPORT_TESTING: "true"
LOCAL_S2S_STT_MODEL: ${LOCAL_S2S_STT_MODEL:-openai/whisper-large-v3}
LOCAL_S2S_LLM_MODEL: ${LOCAL_S2S_LLM_MODEL:-openai/gpt-4.1-mini}
LOCAL_S2S_TTS_MODEL: ${LOCAL_S2S_TTS_MODEL:-google/gemini-3.8-flash-lite-tts}
LOCAL_S2S_TTS_VOICE: ${LOCAL_S2S_TTS_VOICE:-Kore}
LOCAL_S2S_MAX_OUTPUT_TOKENS: "256"
LOCAL_S2S_REQUEST_TIMEOUT_SECONDS: "30"
LOCAL_S2S_TOKEN: ${LOCAL_S2S_TOKEN:-}
# No database URL or application identity is supplied to the engine.
# The inference key is sent only to the engine, never to the API/browser.
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY:-}
LOCAL_S2S_ALLOW_PAID_STARTUP: ${LOCAL_S2S_ALLOW_PAID_STARTUP:-false}
LOCAL_S2S_SILERO_SOURCE: /vad/silero-vad
LOCAL_S2S_NLTK_DATA: /assets/nltk
LOCAL_S2S_ASSET_MANIFEST: /assets/assets.json
LOCAL_S2S_ASSET_MANIFEST_SHA256: ${LOCAL_S2S_ASSET_MANIFEST_SHA256:-}
# Set to a separately provisioned local Silero source+asset bundle; no download.
volumes:
- type: bind
source: ${LOCAL_S2S_VAD_SOURCE:-./.local-s2s-build/vad-not-provisioned}
target: /vad/silero-vad
read_only: true
bind: {create_host_path: false}
- type: bind
source: ${LOCAL_S2S_NLTK_SOURCE:-./.local-s2s-build/nltk-not-provisioned}
target: /assets/nltk
read_only: true
bind: {create_host_path: false}
- type: bind
source: ${LOCAL_S2S_ASSET_MANIFEST_SOURCE:-./.local-s2s-build/assets.json}
target: /assets/assets.json
read_only: true
bind: {create_host_path: false}
mem_limit: 4g
cpus: 2
pids_limit: 128
candidate_api:
image: rag-local-s2s-candidate:phase2
command: [python, -m, app.server, --host, 0.0.0.0, --port, "8000"]
environment: *candidate-env
ports: ["127.0.0.2:8091:8000"]
volumes:
- candidate_originals:/app/data/local-s2s-test/originals
- candidate_extractions:/app/data/local-s2s-test/extractions
depends_on:
candidate_migrations: {condition: service_completed_successfully}
mem_limit: 2g
pids_limit: 128
volumes:
candidate_postgres:
candidate_originals:
candidate_extractions: