Files
rag-technical-docs-assistant/docs/evaluation/local-s2s/combined-ready-20261017.md
T
amirhosein mazaheri 628aec8def feat(voice): implement local S2S responsiveness candidate and direct TTS routing
Add local S2S responsiveness candidate pinning ASR options and sentence-at-a-time generation. Route speech synthesis directly to OpenAI API for fluent Persian phonetics with gpt-4o-mini-tts-2025-12-15. Add responsiveness, budget carry, and browser watch unit tests along with acceptance benchmarks and evaluation evidence.
2026-10-17 13:02:41 +03:30

6.3 KiB

Combined voice and calibrated RAG test ? 2026-10-17

Explicit user override: cost admission controls are disabled for this isolated run. Historical bills/reserves are preserved and are no longer this run's admission ceiling. Memory prevention remains off. Docker memory bounds, request timeouts and cancellation remain. Session lifetime is restored to the existing 600-second setting.

Both OpenAI Realtime (existing gpt-realtime-2.1/marin/low/1.30 profile) and local_s2s reached session_ready through the actual frontend proxy. Local ASR gpt-4o-transcribe and TTS gpt-4o-mini-tts-2025-12-15/alloy route directly to OpenAI; LLM remains GPT-4.1 mini through OpenRouter. Direct audio refuses missing OpenAI credentials instead of forwarding the router key. Existing OpenRouter ASR compatibility remains. Four new routing regressions plus affected tests: 85 passed.

RAG uses a new isolated rag_bge_local_s2s_test database and dedicated volumes. The approved original hash and ten frozen labels were preserved; proper intake/worker published six chunks, then fenced selection activated the document. Ollama bge-m3/1024/v1 reproduced the original measured cutoff 0.33686461167069426, six supported cases and zero false positives in four unsupported cases. The old report currently contains 0.65 despite its guide/trials documenting the stricter measured cutoff; it was left unchanged. The new measured report is independently retained.

Runtime files are ignored under .local-s2s-build: windows-combined.compose.json, combined-compose.py, combined-engine.py and combined-evidence/. The launcher forwards only the two required OpenAI keys from the existing .env into the API runtime; it writes no copied provider credentials or full .env mount. Engine uses existing server-only secret mounts. Start from repository root using .venv/Scripts/python .local-s2s-build/combined-compose.py up -d --no-deps candidate_api candidate_worker local-s2s-engine. Do not use obsolete budget launchers/watchdogs for this run.

Browser: http://127.0.0.2:4201/login, existing test credentials. Refresh and log in again because test identity belongs to the new isolated database. Ask the approved sample pump-pressure question and unsupported land-price question on both providers. Only the approved calibration sample is loaded here; other operational documents were not silently copied.

Both provider setups and explicit normal close passed. OpenAI-to-local switching passed after waiting for WebSocket closure. Abruptly disconnecting and immediately starting another provider produced 403 while the single media slot was still cleaning up; immediate-switch acceptance remains open. No microphone, listening, ASR accuracy or full spoken RAG acceptance is claimed. Phase 3/4 remain open.

Temporary automatic document intake override

2026-10-17, explicit user request: candidate API, worker and migration/operator configuration now use the existing OpenRouter Vision profile google/gemini-2.5-flash, 60-second timeout. INGEST_OCR_REVIEW_REQUIRED=false, INGEST_FACTUAL_REVIEW_REQUIRED=false and INGEST_ALLOW_PARTIAL_EXTRACTION=true. This last existing switch also bypasses direct-PDF visual review while retaining automatic-admission warnings. Factual placeholders remain excluded by the existing policy. No human approval was fabricated. This temporary setup admits outputs with warnings and is not a manual accuracy certification.

The launcher forwards only INGEST_VISION_API_KEY in addition to the two necessary OpenAI keys; no additional credential file is created. Existing originals/jobs/profiles are immutable: four files were independently reimported through proper intake with deterministic operation IDs. Old failed rows remain historical. New ready records: photo db37c610-4fb8-4f9f-aa9d-481720a64a86 (5 chunks), DOCX ba72acfa-4f3c-403e-bafe-879b08ed0ccb (100), PDF 5905? 0abd2545-05af-4c7c-8194-6a9182d164e7 (3), PDF 7364? d9c23e5a-8a51-4696-94ac-4a060957c58b (21). Two intermediate stricter-policy PDF attempts failed and remain historical too. All four final jobs published successfully; no pending administrator review. Knowledge selection was not changed by this intake operation; ready documents can be selected separately for RAG. Original calibration sample remains selected.

Validation: 75 relevant unit tests passed (test_phase5_review.py, test_partial_extraction.py, test_gemini_vision.py); real hosted Vision + local bge-m3 embedding + atomic worker publication succeeded. No application behavior code or database migration was changed for this configuration-only operation.

Local speech pace and selector label

Explicit user request: LOCAL_S2S_TTS_SPEED=1.3 in the isolated runtime; default remains 1.0. Applied before native TTS setup/warmup, forwarded by the existing handler to the speech request, read from the actual initialized handler in component attestation, and included in session identity. No sample-rate or playback-buffer change. Provider metadata label changed to ????? ?????; frontend displays that server-provided label. 45 focused unit tests passed, including applied speed and rejection of a handler-speed mismatch.

Follow-up: pace 1.6 and unanswered person query

User requested a further pace increase: active local TTS speed is now 1.6 (previously 1.3). Both actual proxied session_ready/normal-close checks passed again; local paid startup probes passed.

Read-only diagnosis: all five ready documents are active at knowledge revision 6. Local tool queries were the Persian equivalent of Mr. Danesh and deputy of planning; OpenAI queried Danesh. Both returned succeeded/no_evidence, not provider errors. The extracted 5905 PDF contains the salutation Mr. Danesh followed by deputy of planning. Candidate distances for Mr. Danesh started at 0.5615, while the active calibration cutoff is 0.33686461167069426; all 50 candidates were filtered out. Role query nearest distance 0.4371 was rejected too. Existing exact lexical matching handles article/date/alphanumeric identifiers, not person names. The calibration sample does not establish recall for these real document questions. No threshold or retrieval contract was changed; a name-query retrieval repair and real-corpus evaluation remain pending. Original PDF text-layer matching did not independently verify the OCR person spelling, so the extracted text is evidence of the retrieval defect, not manual certification of the original image.