From 93798fd377eb88707ab01308b07a2fb7984eff3a Mon Sep 17 00:00:00 2001 From: Xiaohan-Tian Date: Fri, 15 May 2026 13:50:00 -0700 Subject: [PATCH 1/2] fix: optimized system prompt for local LLM --- public/chat/welcome_local_llm.md | 8 ++++++++ public/prompts/system_compact.md | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/public/chat/welcome_local_llm.md b/public/chat/welcome_local_llm.md index 724767a..f09eb1b 100644 --- a/public/chat/welcome_local_llm.md +++ b/public/chat/welcome_local_llm.md @@ -14,6 +14,14 @@ Welcome to **K.G.Studio Musician Assistant** in local LLM mode. - Prefer simpler music arrangements when possible. - Start a new conversation for each standalone task. +Example: +- For best results, break more complex requests into smaller steps. +- For example, if you want the model to write a chord progression based on the current music, first ask: `Please read the current music.` +- Once that is complete, follow up with: `Please write a chord progression based on it.` +- This incremental workflow is generally more reliable in local LLM mode. +- Keep the MIDI region you want the agent to update selected throughout the workflow. +- You do not need to switch the selection to another region just for `read_music`, because `read_music` can fetch music across all tracks. + ### Use an External LLM Instead - If you want a larger cloud or self-hosted model, open **Settings -> General -> LLM Provider** and switch away from **Local LLM (Browser)**. - For a cloud model, you can use **OpenAI**, or choose **OpenAI Compatible** and enter a provider such as OpenRouter. diff --git a/public/prompts/system_compact.md b/public/prompts/system_compact.md index 8c6a5da..95682cd 100644 --- a/public/prompts/system_compact.md +++ b/public/prompts/system_compact.md @@ -99,4 +99,12 @@ WORKFLOW 5. Verify results 6. Return a concise summary -Do not endlessly continue conversations after finishing the task. \ No newline at end of file +Do not endlessly continue conversations after finishing the task. + +==== + +MISC TIPS + +- `add_notes` and `remove_notes` are limited to the current region. +- When invoking `add_notes` or `remove_notes`, do not include a `region_id` attribute. +- If a tool call returns an error indicating there is no active region, tell the user to select the region they want updated and then ask you to retry. From 31103041973af595869731c1a13ac6a1bc072744 Mon Sep 17 00:00:00 2001 From: Xiaohan-Tian Date: Fri, 15 May 2026 13:50:39 -0700 Subject: [PATCH 2/2] fix: always use unix-style LF even in Windows --- .editorconfig | 9 +++++++++ .gitattributes | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 .editorconfig create mode 100644 .gitattributes diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..fca82d2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.{bat,cmd,ps1}] +end_of_line = crlf diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..fea410f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +* text=auto eol=lf + +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf