Skip to content

Make the transcription model configurable; default to gpt-transcribe - #6

Closed
sadasant-ghost[bot] wants to merge 1 commit into
compai/window-orderfrom
compai/transcribe-model
Closed

sadasant-ghost[bot] wants to merge 1 commit into
compai/window-orderfrom
compai/transcribe-model

Conversation

@sadasant-ghost

@sadasant-ghost sadasant-ghost Bot commented Sep 10, 2026

Copy link
Copy Markdown

Stacked on #4.

whisper-1 was hardcoded in conductor_api.py. It is the cheapest thing to get wrong and the most expensive to trust, because it does not fail silently — it fills silence with fluent invention.

Over one week of Daniel's voice notes it produced a Korean news sign-off, a YouTube outro, and turned "billing" into "building" in a message he was drafting for executives.

Measured, not assumed

One second of a 440 Hz sine tone, against the live API:

model returned billing
gpt-transcribe "" duration, $0.0045/min
gpt-4o-mini-transcribe "" tokens
whisper-1 "Oh" duration, $0.006/min

Whisper invented a word from a pure tone, on demand, which is the failure mode above reproduced in one request.

The change

Default is now gpt-transcribe: quieter on non-speech, cheaper ($0.0045 vs $0.006), and billed by duration — which this endpoint needs, because /api/transcribe reports a per-minute cost and a token-priced model would make that number a guess.

CONDUCTOR_TRANSCRIBE_MODEL overrides it, matching how every other knob in this file already works.

Two smaller things that follow from being honest about cost:

  • A model with no known per-minute price reports cost: null rather than a plausible wrong number. gpt-4o-mini-transcribe is better than Whisper but token-billed, and this endpoint cannot know the token count.
  • The response now names the model that produced the text, so a surprising transcript can be attributed rather than guessed at.

Verified live

Deployed and restarted before opening this:

POST /api/transcribe
{"text": "", "seconds": 1.0, "cost": 0.0001, "model": "gpt-transcribe"}

32 tests, including one asserting the default is cheaper than what it replaced and one asserting a token-billed model reports no cost rather than fiction.


Summary by cubic

Makes the transcription model configurable and defaults to gpt-transcribe instead of hardcoded whisper-1, which hallucinated speech on silence. The endpoint now reports cost based on the model's per-minute rate, returning null when the model is token-billed, and includes the model name in responses.

Bug Fixes

  • whisper-1 inventing words on pure tones is fixed by switching the default to gpt-transcribe.
  • Unknown or token-billed models now report cost: null instead of a guessed number.
  • Adds CONDUCTOR_TRANSCRIBE_MODEL to override the model.
  • Adds model to the /api/transcribe response so output can be attributed.
  • Keeps whisper-1 price constant for compatibility.

Written for commit 7646944. Summary will update on new commits.

Review in cubic

whisper-1 was hardcoded. It does not fail silently -- it fills silence with
fluent invention: a Korean news sign-off and a YouTube outro from pauses in voice
notes, and 'billing' heard as 'building' in a message for executives.

Measured against the live API on one second of a 440 Hz sine tone,
gpt-transcribe returned an empty string and whisper-1 returned 'Oh'.
gpt-transcribe is also cheaper -- /bin/zsh.0045 against /bin/zsh.006 -- and billed by
duration, which this endpoint needs, since it reports a per-minute cost and a
token-priced model would make that a guess.

CONDUCTOR_TRANSCRIBE_MODEL overrides it. An unknown or token-billed model reports
cost: null rather than a plausible wrong number, and the response names the model
that produced the text. 32 tests.

@cubic-dev-ai cubic-dev-ai 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.

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="conductor_api.py">

<violation number="1" location="conductor_api.py:181">
P3: `transcribe_cost`'s docstring says None is returned only "when the model is token-billed", but the implementation returns None for any unknown model not present in `USD_PER_MIN` (the added test even asserts this for "something-new"). Widen the docstring to cover the unknown-model case so it matches the actual contract.</violation>

<violation number="2" location="conductor_api.py:189">
P3: `WHISPER_USD_PER_MIN` is defined on the added line with the comment "kept: referenced elsewhere", but nothing in the repository references it anymore — the only consumers were the lines this change replaced with `transcribe_cost(secs)`. It is dead code and the comment is misleading. Remove the line.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread conductor_api.py
def transcribe_cost(seconds, model=None):
"""Dollars for `seconds` of audio, or None when the model is token-billed.

None is the honest answer for a token-priced model: the caller knows the

@cubic-dev-ai cubic-dev-ai Bot Sep 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: transcribe_cost's docstring says None is returned only "when the model is token-billed", but the implementation returns None for any unknown model not present in USD_PER_MIN (the added test even asserts this for "something-new"). Widen the docstring to cover the unknown-model case so it matches the actual contract.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At conductor_api.py, line 181:

<comment>`transcribe_cost`'s docstring says None is returned only "when the model is token-billed", but the implementation returns None for any unknown model not present in `USD_PER_MIN` (the added test even asserts this for "something-new"). Widen the docstring to cover the unknown-model case so it matches the actual contract.</comment>

<file context>
@@ -146,7 +146,47 @@ def translate_command(description, cwd):
+def transcribe_cost(seconds, model=None):
+    """Dollars for `seconds` of audio, or None when the model is token-billed.
+
+    None is the honest answer for a token-priced model: the caller knows the
+    duration and nothing about the token count, and a number invented here
+    would be indistinguishable from a real one.
</file context>
Fix with cubic

Comment thread conductor_api.py
return None if rate is None else round(seconds / 60 * rate, 4)


WHISPER_USD_PER_MIN = USD_PER_MIN["whisper-1"] # kept: referenced elsewhere

@cubic-dev-ai cubic-dev-ai Bot Sep 10, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: WHISPER_USD_PER_MIN is defined on the added line with the comment "kept: referenced elsewhere", but nothing in the repository references it anymore — the only consumers were the lines this change replaced with transcribe_cost(secs). It is dead code and the comment is misleading. Remove the line.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At conductor_api.py, line 189:

<comment>`WHISPER_USD_PER_MIN` is defined on the added line with the comment "kept: referenced elsewhere", but nothing in the repository references it anymore — the only consumers were the lines this change replaced with `transcribe_cost(secs)`. It is dead code and the comment is misleading. Remove the line.</comment>

<file context>
@@ -146,7 +146,47 @@ def translate_command(description, cwd):
+    return None if rate is None else round(seconds / 60 * rate, 4)
+
+
+WHISPER_USD_PER_MIN = USD_PER_MIN["whisper-1"]  # kept: referenced elsewhere
 
 # Voice input reaches an agent as ordinary text, and speech-to-text mishears in ways
</file context>
Fix with cubic

@sadasant-ghost sadasant-ghost Bot closed this Sep 10, 2026
@sadasant-ghost
sadasant-ghost Bot deleted the compai/transcribe-model branch September 10, 2026 02:39
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