Repository navigation
feat(transcribe): add optional Atlas Cloud provider - #71
binyangzhu000-sudo wants to merge 1 commit into
Conversation
Signed-off-by: binyangzhu000-sudo <224954946+binyangzhu000-sudo@users.noreply.github.com>
Greptile SummaryThis change adds an opt-in Atlas Cloud transcription path with Base64 audio submission and asynchronous prediction polling. Offline execution reproduced two reliability failures in Confidence Score: 4/5The Atlas transcription implementation is not safe to merge as written because a documented supported input size can exhaust the invoking process's memory. Focused offline executions exercised the production payload, serialization, and polling paths. They measured the duplicated audio representations and reproduced a request occurring after the polling deadline. Files Needing Attention:
What T-Rex did
|
| "audio": ( | ||
| base64.b64encode(audio_path.read_bytes()).decode("ascii") | ||
| if encode_audio | ||
| else "<base64 audio omitted>" | ||
| ), |
There was a problem hiding this comment.
Large Atlas inputs exhaust memory
Atlas accepts audio files up to 500 MB, but this path reads the entire file into memory, materializes a Base64 string, and then serializes that string into a separate JSON byte buffer. The exercised 64 MiB input reached a 256 MiB traced allocation peak; at the documented limit this can require roughly 2 GiB of process memory before the request is sent, causing avoidable memory pressure or termination. Use an upload/reference flow or streaming transport, or lower the accepted size to one that is safe for the simultaneous representations.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Artifacts
Offline Atlas audio payload and serialization probe source
- The authored executable invokes the real payload and request-serialization functions against a sparse audio file with an offline HTTP capture, showing the measured representations.
Control run with Base64 audio omitted
- The executed 64 MiB sparse-file control captured a 58-byte request and negligible traced allocation, establishing the non-encoded baseline.
Encoded Atlas audio serialization run
- The executed 64 MiB sparse-file encoded run captured an 85.33 MiB Base64 payload and JSON body with a 256.00 MiB traced peak, supporting the memory-pressure finding.
| while monotonic() < deadline: | ||
| sleep(poll_interval) | ||
| prediction = _atlas_data( | ||
| request_json(prediction_url, "GET", api_key, None) | ||
| ) |
There was a problem hiding this comment.
A polling sleep can cross the deadline, but the code issues the prediction GET before evaluating the loop condition again. The deadline-boundary run advanced the injected clock from 0 to 3 seconds during the first sleep for a 2-second timeout and recorded a GET at time 3 before the timeout was raised. Re-check the deadline after sleeping and before requesting the prediction, or cap the sleep interval to the remaining time.
Artifacts
Focused offline Atlas polling deadline boundary test source
- The exact authored Python test injects a clock, sleep function, and Atlas request function to cross the deadline during polling, demonstrating the boundary condition.
Atlas polling boundary reproduction output
- The executed offline test records a GET at simulated time 3.0 after a 2.0-second deadline and then records the timeout error, proving the extra request occurs.
Python compilation validation output
- The executed byte-compilation command exits successfully for both the focused test and the target transcription module, confirming they are syntactically executable.
Captured exact Atlas polling boundary test source
- The executed source capture prints the complete authored test file used for the offline reproduction, preserving the exact injected test setup.
Summary
xai/stt-v1schema, including optional diarizationTesting
python3 -m py_compile skills/transcribe/scripts/transcribe_diarize.pyNo paid transcription request was sent; the integration was validated against the live Atlas model catalog and OpenAPI schema plus local request/response mocks.