feat(model-server): wizard V2 config modèles locaux — source, options structurées & preview

Refonte UX du wizard de configuration des modèles locaux du serveur
llama.cpp intégré, alignée sur la source Hugging Face et les options backend.

- choix de source sans jargon (chemin local .gguf vs dépôt Hugging Face) ;
- champs structurés -ngl (gpu_layers), -c (context_size), --jinja, --host ;
- zone d'arguments libres avec alerte sur les flags réservés ;
- preview de la commande via le backend (previewModelServerCommand, debounced) ;
- gateway/ports et mock adaptés au contrat V2.

QA : Vitest 22 verts, tsc/build OK.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-12 14:32:04 +02:00
parent 38aecf2cac
commit efa081b074
10 changed files with 794 additions and 143 deletions

View File

@ -9,7 +9,10 @@
import { invoke } from "@tauri-apps/api/core";
import type { LocalModelServerConfig } from "@/domain";
import type {
LocalModelServerConfig,
ModelServerCommandPreview,
} from "@/domain";
import type { ModelServerGateway } from "@/ports";
export class TauriModelServerGateway implements ModelServerGateway {
@ -28,4 +31,14 @@ export class TauriModelServerGateway implements ModelServerGateway {
async deleteModelServer(serverId: string): Promise<void> {
await invoke("delete_model_server", { serverId });
}
previewModelServerCommand(
config: LocalModelServerConfig,
): Promise<ModelServerCommandPreview> {
// `preview_model_server_command` takes the config directly (no `request`
// wrapper), unlike `save_model_server`.
return invoke<ModelServerCommandPreview>("preview_model_server_command", {
config,
});
}
}