Skip to content

Use EU by default for fail-closed OpenRouter regional routing - #72

Open
MyButtermilk wants to merge 1 commit into
mainfrom
codex/openrouter-in-region
Open

MyButtermilk wants to merge 1 commit into
mainfrom
codex/openrouter-in-region

Conversation

@MyButtermilk

Copy link
Copy Markdown
Owner

Why

Scriber currently hardcodes the global OpenRouter route for both audio transcription and text generation. The existing processing-region setting applies only to Soniox.

This change makes Europe the OpenRouter default, as explicitly requested. Existing installations without an OpenRouter region setting also use Europe; users can explicitly select US or Global. This is an intentional routing-default change, while API keys, model IDs and provider preferences remain unchanged.

Changes

  • Add one allowlisted OpenRouter region setting (eu, us, global), persisted independently of the API key and Soniox region and exposed in the Settings API and localized UI.
  • Route STT, summaries, Meeting analysis and cloud postprocessing through the selected endpoint. Pin the region across retries and freeze it with the endpoint fingerprint for queued/recovered transcription jobs.
  • Never fall back to the global endpoint. Reject redirects and invalid region values instead of permitting an implicit destination change.
  • Turn regional HTTP 404 responses into a non-retryable, privacy-safe explanation that asks users to select an available model or explicitly change their region. Preserve this explanation through transcription, summary retry, Meeting recovery and postprocessing error paths.
  • Document migration, scope and OpenRouter's Business/Enterprise requirement. Preserve other providers' independent routing settings.

Live model availability checked on 2026-09-29

Queried each region's public /api/v1/models endpoint. Dedicated STT models require the additional output_modalities=transcription query documented by OpenRouter [3]; they must not be inferred from the default catalog.

Catalog Global EU US
Default model catalog 460 67 117
Transcription catalog 24 1 7
Model family Global EU US
microsoft/mai-transcribe-2 (STT catalog) Listed Absent Absent
microsoft/mai-transcribe-1.5 (STT catalog) Listed Absent Absent
google/gemini-2.5-flash-lite Listed Listed Absent
openai/gpt-oss-120b Listed Listed Listed
minimax/minimax-m3 Listed Absent Listed
z-ai/glm-5.3-flash Listed Absent Listed

The EU transcription catalog currently lists only mistralai/voxtral-mini-transcribe. Scriber does not silently replace the configured MAI model: selecting MAI with the EU default can therefore produce the new regional availability error. Choosing another region is always explicit.

These are public catalog observations, not authenticated inference tests. No audio or transcript was sent, and no paid inference request was made. Account access and provider constraints can still prevent a listed model from running. Regional routing requires a Business or Enterprise account [1, 2].

Validation

  • 560 focused Python tests passed, including deterministic endpoint selection, config migration/persistence, atomic Settings validation, redirect rejection, regional 404s, retry pinning, frozen STT routes and Meeting recovery.
  • 20 frontend/localization tests passed.
  • Python Ruff lint/format and mypy passed; frontend type checks, changed-file ESLint/Prettier and production build passed.
  • Three unrelated failures in an initially broader Linux run were reproduced on untouched main: two Windows audio-host preference tests and a Deepgram factory test with an unavailable optional dependency. Windows CI remains the platform validation gate.

Based on current main at 4af59b77a82ea3aa017d706afdfa0bd3deee9237.

Sources

  1. https://openrouter.ai/blog/announcements/us-in-region-routing/
  2. https://openrouter.ai/docs/guides/features/in-region-routing
  3. https://openrouter.ai/blog/tutorials/transcription-on-openrouter/
  4. https://eu.openrouter.ai/api/v1/models
  5. https://us.openrouter.ai/api/v1/models
  6. https://openrouter.ai/api/v1/models
  7. https://eu.openrouter.ai/api/v1/models?output_modalities=transcription
  8. https://us.openrouter.ai/api/v1/models?output_modalities=transcription
  9. https://openrouter.ai/api/v1/models?output_modalities=transcription

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63a9413d3e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/cloud_async_stt.py
Comment on lines 894 to +895
async with session.post(
OPENROUTER_STT_URL,
url,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Check regional model availability before uploading audio

For an EU/US selection, this is the first OpenRouter request, so Scriber uploads the complete STT payload before discovering that the fixed MAI model is unavailable in that region. There is no regional /models availability lookup anywhere in the new routing path, and therefore no output_modalities=transcription query for STT; the same omission leaves text-generation models selectable until their prompt submission fails. Gate model admission on the selected region's models API (using the transcription modality for STT) so unavailable routes fail before user content is submitted.

AGENTS.md reference: AGENTS.md:L1488-L1489

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant