Skip to content

Let VocaLinux hit this host as an OpenAI transcription server - #37

Merged
jatinkrmalik merged 3 commits into
mainfrom
jatin/openai-transcriptions-36
Sep 2, 2026
Merged

Let VocaLinux hit this host as an OpenAI transcription server#37
jatinkrmalik merged 3 commits into
mainfrom
jatin/openai-transcriptions-36

Conversation

@jatinkrmalik

Copy link
Copy Markdown
Member

Closes #36.

Desktop embed stays Planned. Phone pairing and the session API are untouched.

POST /v1/audio/transcriptions accepts the OpenAI multipart shape (file plus optional model, language, response_format, and stream). Auth is the same bearer token. Transcription goes through transcribe_adhoc, the same path the WebUI test recorder uses. The JSON body is {"text"}. The model field is ignored, so whisper-1 and sensevoice both hit whatever engine is loaded in the WebUI. language falls back to auto. verbose_json and stream=true return 400.

There is no /inference route.

Known limits: VocaLinux still defaults to /inference, so the dropdown has to be switched. Test Connection is GET / and does not prove the token.

Closes #36.

Desktop embed stays Planned. This adds POST /v1/audio/transcriptions, using the
same bearer token as the rest of the API and the same adhoc transcribe path as
the WebUI test recorder. The response is {"text"}. The model form field is
ignored; whatever engine you loaded in the WebUI is what runs.

Pairing is unchanged. This path does not speak /inference and does not stream.

Known limits: VocaLinux still defaults to /inference, so the dropdown has to be
switched. Test Connection is GET / and does not prove the token.
@netlify

netlify Bot commented Aug 30, 2026

Copy link
Copy Markdown

Deploy Preview for voca-gateway canceled.

Name Link
🔨 Latest commit 38e9465
🔍 Latest deploy log https://app.netlify.com/projects/voca-gateway/deploys/6a952e3f08572200086a8c0d

@jatinkrmalik
jatinkrmalik marked this pull request as ready for review August 30, 2026 20:17
@greptile-apps

greptile-apps Bot commented Aug 30, 2026

Copy link
Copy Markdown

Greptile Summary

The PR adds an authenticated OpenAI-compatible transcription endpoint for VocaLinux while preserving the existing engine and phone-session behavior.

  • Registers POST /v1/audio/transcriptions and returns the OpenAI-compatible {"text": ...} response.
  • Validates authentication, request length, audio type, language, response format, and streaming options.
  • Routes uploaded audio through the existing ad-hoc transcription service and cleans up temporary files.
  • Documents VocaLinux remote_api configuration and adds endpoint coverage.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
app/routes/transcriptions.py Adds the authenticated OpenAI-compatible route with early request-size enforcement, bounded copying, validation, transcription, and cancellation-safe cleanup.
app/main.py Registers the new transcription router without changing the existing session or streaming routes.
app/schemas.py Adds the minimal OpenAI-compatible transcription response schema.
tests/test_transcriptions.py Covers authentication, successful transcription, validation failures, upload limits, and early Content-Length handling.
README.md Documents configuring VocaLinux to use the new OpenAI-compatible endpoint.
docs/configuration.md Adds operational details and limitations for VocaLinux remote API use.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[VocaLinux POST multipart audio] --> B[Authenticate bearer token]
    B --> C[Validate Content-Length before multipart parsing]
    C --> D[Parse and validate form fields]
    D --> E[Copy audio with file-size limit]
    E --> F[Finalize temporary upload]
    F --> G[transcribe_adhoc using loaded WebUI engine]
    G --> H[Delete finalized audio]
    H --> I[Return JSON text]
Loading

Reviews (3): Last reviewed commit: "Require Content-Length on the OpenAI tra..." | Re-trigger Greptile

Comment thread app/routes/transcriptions.py
Comment thread app/routes/transcriptions.py Outdated
Content-Length is checked after the bearer token and before the multipart
parser, with 64KiB of slack for wrapping. The copy loop still 413s if that
header is missing. A disconnect during the write now deletes the hidden
.upload file.
Comment thread app/routes/transcriptions.py Outdated
A missing or junk header used to fall through, so FastAPI still parsed the
multipart body and an authenticated client could fill /tmp. Missing
Content-Length is now 411, invalid values are 400, and a declared length
over the cap is still 413, all in the early route handler before
request.form(). The copy loop cap stays.
@jatinkrmalik

Copy link
Copy Markdown
Member Author

Shipping this. A running VocaLinux can point remote_api at POST /v1/audio/transcriptions on a self-hosted gateway. Desktop embed stays Planned.

@jatinkrmalik
jatinkrmalik merged commit 0a91e7e into main Sep 2, 2026
6 checks passed
@Mr-Sunglasses
Mr-Sunglasses deleted the jatin/openai-transcriptions-36 branch September 3, 2026 10:03
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.

VocaLinux can't point at this gateway — there's no endpoint they share

1 participant