Skip to content

Support runtime Whisper model downloads#7

Open
bits-by-brandon wants to merge 3 commits intomainfrom
codex/remove-hard-dependency-on-whisper-model
Open

Support runtime Whisper model downloads#7
bits-by-brandon wants to merge 3 commits intomainfrom
codex/remove-hard-dependency-on-whisper-model

Conversation

@bits-by-brandon
Copy link
Copy Markdown
Owner

Summary

  • add a runtime model manager that downloads the Whisper model compatible with the current platform
  • update transcription to rely on the downloaded model and enable the Tauri HTTP API needed for fetching it
  • clean up bundled resources by removing the LFS model pointer and making the build script skip copying when no model is present

Testing

  • npm run check (fails: existing Svelte type resolution errors for module aliases and icon packages)

https://chatgpt.com/codex/tasks/task_e_6902e0f3eb24832cb59b96449f043684

Copy link
Copy Markdown

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

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.

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/util/models.ts
Comment on lines +55 to +59
console.info(`Downloading Whisper model from ${descriptor.url}...`);
const response = await fetch<Uint8Array>(descriptor.url, {
method: 'GET',
responseType: ResponseType.Binary
});
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 Register HTTP plugin before fetching models

The runtime downloader uses @tauri-apps/api/http.fetch to pull the Whisper model, but the backend still lacks the tauri-plugin-http dependency and .plugin(tauri_plugin_http::init()) call, so this call will immediately reject with “plugin http not initialized” and the model never downloads. Without a working download path, fresh installs ship without any model and transcription will always fail.

Useful? React with 👍 / 👎.

Comment thread src/lib/util/models.ts Outdated
Comment on lines +45 to +49
const baseDir = await appDataDir();
if (!baseDir) {
throw new Error('Failed to determine application data directory for model download.');
}
const modelsDir = await join(baseDir, 'models');
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 Allow fs access to appDataDir used for model storage

The code stores the model under appDataDir()/models, but the current tauri.conf.json only whitelists $RESOURCE/* and $APPCACHE/*. Calls to createDir/writeBinaryFile with an appDataDir path will be rejected by the file scope and the model will never persist. Extend the FS allowlist to $APPDATA/* or switch to a scoped directory before downloading.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant