Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion apps/desktop/src/components/toast/model-download.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ export default function ModelDownloadNotification() {
refetchInterval: 5000,
});

const listDownloadedModels = useQuery({
queryKey: ["list-downloaded-models"],
queryFn: async () => {
return localLlmCommands.listDownloadedModel();
},
refetchInterval: 3000,
});

const sttModelDownloading = useQuery({
enabled: !checkForModelDownload.data?.sttModelDownloaded,
queryKey: ["stt-model-downloading"],
Expand Down Expand Up @@ -77,7 +85,7 @@ export default function ModelDownloadNotification() {
}

const needsSttModel = !checkForModelDownload.data?.sttModelDownloaded;
const needsLlmModel = !checkForModelDownload.data?.llmModelDownloaded;
const needsLlmModel = listDownloadedModels.data?.length === 0;

let title: string;
let content: string;
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/components/welcome-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ export function WelcomeModal({ isOpen, onClose }: WelcomeModalProps) {

const handleModelSelected = (model: SupportedModel) => {
selectSTTModel.mutate(model);

sessionStorage.setItem("model-download-toast-dismissed", "true");

onClose();
};

Expand Down
2 changes: 1 addition & 1 deletion plugins/local-llm/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const COMMANDS: &[&str] = &[
"models_dir",
"list_supported_models",
"is_server_running",
"is_model_downloaded",
"is_model_downloading",
Expand All @@ -10,6 +9,7 @@ const COMMANDS: &[&str] = &[
"restart_server",
"get_current_model",
"set_current_model",
"list_downloaded_model",
];

fn main() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Automatically generated - DO NOT EDIT!

"$schema" = "../../schemas/schema.json"

[[permission]]
identifier = "allow-list-downloaded-model"
description = "Enables the list_downloaded_model command without any pre-configured scope."
commands.allow = ["list_downloaded_model"]

[[permission]]
identifier = "deny-list-downloaded-model"
description = "Denies the list_downloaded_model command without any pre-configured scope."
commands.deny = ["list_downloaded_model"]

This file was deleted.

10 changes: 5 additions & 5 deletions plugins/local-llm/permissions/autogenerated/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Default permissions for the plugin
- `allow-restart-server`
- `allow-get-current-model`
- `allow-set-current-model`
- `allow-list-supported-models`
- `allow-list-downloaded-model`

## Permission Table

Expand Down Expand Up @@ -184,25 +184,25 @@ Denies the is_server_running command without any pre-configured scope.
<tr>
<td>

`local-llm:allow-list-supported-models`
`local-llm:allow-list-downloaded-model`

</td>
<td>

Enables the list_supported_models command without any pre-configured scope.
Enables the list_downloaded_model command without any pre-configured scope.

</td>
</tr>

<tr>
<td>

`local-llm:deny-list-supported-models`
`local-llm:deny-list-downloaded-model`

</td>
<td>

Denies the list_supported_models command without any pre-configured scope.
Denies the list_downloaded_model command without any pre-configured scope.

</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion plugins/local-llm/permissions/default.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ permissions = [
"allow-restart-server",
"allow-get-current-model",
"allow-set-current-model",
"allow-list-supported-models",
"allow-list-downloaded-model",
]
16 changes: 8 additions & 8 deletions plugins/local-llm/permissions/schemas/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,16 @@
"markdownDescription": "Denies the is_server_running command without any pre-configured scope."
},
{
"description": "Enables the list_supported_models command without any pre-configured scope.",
"description": "Enables the list_downloaded_model command without any pre-configured scope.",
"type": "string",
"const": "allow-list-supported-models",
"markdownDescription": "Enables the list_supported_models command without any pre-configured scope."
"const": "allow-list-downloaded-model",
"markdownDescription": "Enables the list_downloaded_model command without any pre-configured scope."
},
{
"description": "Denies the list_supported_models command without any pre-configured scope.",
"description": "Denies the list_downloaded_model command without any pre-configured scope.",
"type": "string",
"const": "deny-list-supported-models",
"markdownDescription": "Denies the list_supported_models command without any pre-configured scope."
"const": "deny-list-downloaded-model",
"markdownDescription": "Denies the list_downloaded_model command without any pre-configured scope."
},
{
"description": "Enables the models_dir command without any pre-configured scope.",
Expand Down Expand Up @@ -439,10 +439,10 @@
"markdownDescription": "Denies the stop_server command without any pre-configured scope."
},
{
"description": "Default permissions for the plugin\n#### This default permission set includes:\n\n- `allow-models-dir`\n- `allow-is-server-running`\n- `allow-is-model-downloading`\n- `allow-is-model-downloaded`\n- `allow-download-model`\n- `allow-start-server`\n- `allow-stop-server`\n- `allow-restart-server`\n- `allow-get-current-model`\n- `allow-set-current-model`\n- `allow-list-supported-models`",
"description": "Default permissions for the plugin\n#### This default permission set includes:\n\n- `allow-models-dir`\n- `allow-is-server-running`\n- `allow-is-model-downloading`\n- `allow-is-model-downloaded`\n- `allow-download-model`\n- `allow-start-server`\n- `allow-stop-server`\n- `allow-restart-server`\n- `allow-get-current-model`\n- `allow-set-current-model`\n- `allow-list-downloaded-model`",
"type": "string",
"const": "default",
"markdownDescription": "Default permissions for the plugin\n#### This default permission set includes:\n\n- `allow-models-dir`\n- `allow-is-server-running`\n- `allow-is-model-downloading`\n- `allow-is-model-downloaded`\n- `allow-download-model`\n- `allow-start-server`\n- `allow-stop-server`\n- `allow-restart-server`\n- `allow-get-current-model`\n- `allow-set-current-model`\n- `allow-list-supported-models`"
"markdownDescription": "Default permissions for the plugin\n#### This default permission set includes:\n\n- `allow-models-dir`\n- `allow-is-server-running`\n- `allow-is-model-downloading`\n- `allow-is-model-downloaded`\n- `allow-download-model`\n- `allow-start-server`\n- `allow-stop-server`\n- `allow-restart-server`\n- `allow-get-current-model`\n- `allow-set-current-model`\n- `allow-list-downloaded-model`"
}
]
}
Expand Down
Loading