feat(studio): presets include load settings (#7347) (#7352)

* feat(studio): save load settings in chat presets

Presets previously stored only sampling params (temperature, top_p, etc.).
Extend them with an optional loadConfig blob that captures context length,
KV cache dtype, speculative decoding, and GPU layer knobs from the current
runtime when saving.

- Apply loadConfig when switching presets or hydrating on startup
- Show a short summary under the preset controls
- Prompt to reload when a model is already loaded

Fixes #7347

* fix(studio): persist preset loadConfig and capture GGUF context

Add ChatPresetLoadConfig to the chat settings API schema so presets with
load settings no longer 400 on save. Capture effective GGUF context from
ggufContextLength when customContextLength is cleared after auto-mode load.

* fix(studio): address Codex review on preset load settings

Coalesce default maxSeqLength/speculative/gpu knobs when capturing presets,
no-op apply for legacy presets without loadConfig, preserve GPU pin on apply,
and stop replaying stale loadConfig during settings hydration.

* Remove unused getOrderedPresets import

---------

Co-authored-by: Daniel Han <danielhanchen@gmail.com>
This commit is contained in:
Souravrajvi0 2026-07-24 14:53:43 +05:30 committed by GitHub
commit 434fac6ffc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 467 additions and 15 deletions

View file

@ -13,6 +13,7 @@ export type PersistedInferenceParams = Partial<
export interface PersistedChatPreset {
name: string;
params: PersistedInferenceParams;
loadConfig?: Record<string, unknown>;
}
export interface PersistedChatSettings {