Files
rag-technical-docs-assistant/docs/guides/voice-model-switch-rollback.md

3.6 KiB

Isolated OpenAI Mini candidate and rollback

The original rag-api container is retained, with its image, environment and mounts. The candidate rag-api-mini uses the separately built rag-api-brief-answers:20261014 image and changes only OPENAI_REALTIME_MODEL to gpt-realtime-2.1-mini via docker-compose.voice-candidate.yml. Local .env remains the original profile. The old image is also tagged rag-api-rollback:20261014.

Both API instances share the database and startup reconciliation, so never run both simultaneously, even on different ports. Switching ends current voice sessions; start a fresh session. Worker, frontend, documents and database are not replaced. Container rollback preserves code/configuration, not a database snapshot or live session. Do not run compose down, container rm, or image pruning for this workflow.

Build the candidate without replacing the current container:

docker build -t rag-api-brief-answers:20261014 .

Switch after tests pass (if startup/readiness fails, stop the candidate and start rag-api immediately):

docker stop rag-api
docker compose -f docker-compose.yml -f docker-compose.voice-candidate.yml up -d --no-deps --no-build api_candidate
Invoke-RestMethod http://localhost:8080/health/ready

Rollback using the original container, without any rebuild:

docker stop rag-api-mini
docker start rag-api
Invoke-RestMethod http://localhost:8080/health/ready

Switch back to the existing candidate:

docker stop rag-api
docker start rag-api-mini

Do not run the ordinary compose api up while the candidate owns port 8080. Readiness is not provider or Persian quality acceptance. Actual microphone tests must cover interruption during response and search, repeated questions, source reports and long-session behavior. Unknown provider failures remain failures.

Verification checkpoint

Before the code fix, expanded regressions reproduced 15 failures (40 passed). Afterward, 343 focused provider-free cases passed. Adding wrong-cancellation-intent coverage then passed all 57 context-sync cases, including two additional cases. The candidate API reports ready; frontend responds HTTP 200. Runtime inspection confirmed 2.1-mini/Marin, speed 1.30, 2048 output tokens, gpt-transcribe and low reasoning. No provider generation or real microphone acceptance was performed. Original container ID remains 65c9fa765c150467bde2d6336b09fb46d5ffe451d1117eb1ab93a7bacff1037d, with its original image and configuration; it is stopped, not removed. The unrelated pre-existing .gitignore edit is excluded from this change.

Concise delivery default

OpenAI delivery v7 requests the supported fact first, short complete answers by default, all requested parts and material conditions/exceptions preserved, and full detail on explicit request. Repeated introductions, generic service menus and invitations are discouraged. Output-token limits and speed are unchanged. This is model instruction guidance, not a measured quality or cost guarantee. The existing original rag-api container remains the rollback target.

Return to the full model (2026-10-14)

After failed Mini content acceptance, the candidate configuration now selects gpt-realtime-2.1 while retaining the concise delivery v7 image and the model-independent cancellation repair. The historical container name rag-api-mini remains; it does not indicate the selected model. The .env original model setting and preserved rag-api container are unchanged. Use a fresh voice session after this switch; profile pinning intentionally rejects old incompatible reservations.