Skip to content

webui: add setting for first-line chat titles#21797

Merged
allozaur merged 6 commits intoggml-org:masterfrom
crodjer:first-line-titles
Apr 13, 2026
Merged

webui: add setting for first-line chat titles#21797
allozaur merged 6 commits intoggml-org:masterfrom
crodjer:first-line-titles

Conversation

@crodjer
Copy link
Copy Markdown
Contributor

@crodjer crodjer commented Apr 12, 2026

Overview

Add an opt-in setting (titleGenerationUseFirstLine) to use the first non-empty line of a prompt as the generated conversation title.

Additional information

At the moment, the complete multi-line prompt is being used, which created long titles for complex prompts. Coupled with
"Ask for confirmation before changing conversation title", the dialog would overflow.

With the new flag disabled (default):
Screenshot 2026-04-12 at 13-59-41 Test Test This is multiline  - llama cpp
With the new flag enabled:
Screenshot 2026-04-12 at 14-00-22 Test Test - llama cpp

Requirements

Nothing that I know of, just running the frontend would work.

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: Yes, Gemini CLI as svelte and front-end work isn't my expertise. The code changes look minimal and reasonable to me with self review. Based on my going through it, the changes follow similar structure and style as the rest.

Add an opt-in setting (`titleGenerationUseFirstLine`) to use the first
non-empty line of a prompt as the generated conversation title.

Previously, the complete multi-line prompt was being used, which created
long titles for complex queries. Coupled with
"Ask for confirmation before changing conversation title", the dialog
would overflow.
Copy link
Copy Markdown
Contributor

@allozaur allozaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, please run npm run build and commit updates in tools/server/public

Comment thread tools/server/webui/src/lib/utils/text.ts Outdated
Comment thread tools/server/webui/src/lib/utils/text.ts
crodjer and others added 3 commits April 12, 2026 20:55
Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
@crodjer crodjer requested a review from allozaur April 12, 2026 15:27
*/
export function generateConversationTitle(content: string, useFirstLine: boolean = false): string {
if (useFirstLine) {
const firstLine = content.split(NEWLINE_SEPARATOR).find((line) => line.trim().length > 0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're missing an import for this constant here ;)

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. I added that from the the git review suggestion and did not run it locally. Apologies.

crodjer added 2 commits April 13, 2026 11:35
* origin/master:
  webui: MCP Diagnostics improvements (ggml-org#21803)
  Remove extra conditional check on debug mode. (ggml-org#21798)
  sycl: disable Q1_0 in backend and cleanup unused variables (ggml-org#21807)
  mtmd: fix crash when sending image under 2x2 pixels (ggml-org#21711)
  mtmd: qwen3 audio support (qwen3-omni and qwen3-asr) (ggml-org#19441)
  convert : force f16 or f32 on step3-vl conv weights (ggml-org#21646)
  mtmd: add gemma 4 test (vision + audio) [no ci] (ggml-org#21806)
  mtmd: add Gemma 4 audio conformer encoder support (ggml-org#21421)
  fix: Proper messages rendering for "Show raw output" (ggml-org#21672)
  docs: add guide on how to add multimodal support (ggml-org#21778)
@crodjer crodjer requested a review from allozaur April 13, 2026 06:15
Comment thread tools/server/public/bundle.js
@allozaur allozaur merged commit 974c8c9 into ggml-org:master Apr 13, 2026
1 check passed
cnsiva pushed a commit to saas-home/llama.cpp that referenced this pull request Apr 13, 2026
* webui: add setting for first-line chat titles

Add an opt-in setting (`titleGenerationUseFirstLine`) to use the first
non-empty line of a prompt as the generated conversation title.

Previously, the complete multi-line prompt was being used, which created
long titles for complex queries. Coupled with
"Ask for confirmation before changing conversation title", the dialog
would overflow.

* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui: Run build to update the bundle

As requested in:
ggml-org#21797 (review)

* webui: Fix missing import for NEWLINE_SEPARATOR

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
HermestoAizales pushed a commit to HermestoAizales/llama.cpp that referenced this pull request Apr 13, 2026
* webui: add setting for first-line chat titles

Add an opt-in setting (`titleGenerationUseFirstLine`) to use the first
non-empty line of a prompt as the generated conversation title.

Previously, the complete multi-line prompt was being used, which created
long titles for complex queries. Coupled with
"Ask for confirmation before changing conversation title", the dialog
would overflow.

* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui: Run build to update the bundle

As requested in:
ggml-org#21797 (review)

* webui: Fix missing import for NEWLINE_SEPARATOR

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
ArberSephirotheca pushed a commit to ArberSephirotheca/llama.cpp that referenced this pull request Apr 21, 2026
* webui: add setting for first-line chat titles

Add an opt-in setting (`titleGenerationUseFirstLine`) to use the first
non-empty line of a prompt as the generated conversation title.

Previously, the complete multi-line prompt was being used, which created
long titles for complex queries. Coupled with
"Ask for confirmation before changing conversation title", the dialog
would overflow.

* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* Update tools/server/webui/src/lib/utils/text.ts

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>

* webui: Run build to update the bundle

As requested in:
ggml-org#21797 (review)

* webui: Fix missing import for NEWLINE_SEPARATOR

---------

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants