Skip to content

server: Add support for carry_initial_prompt#3781

Open
alubbe wants to merge 2 commits into
ggml-org:masterfrom
alubbe:server-carry_initial_prompt
Open

server: Add support for carry_initial_prompt#3781
alubbe wants to merge 2 commits into
ggml-org:masterfrom
alubbe:server-carry_initial_prompt

Conversation

@alubbe
Copy link
Copy Markdown
Contributor

@alubbe alubbe commented Apr 29, 2026

This adds support for carry_initial_prompt to the server, just as the CLI has it

@alubbe
Copy link
Copy Markdown
Contributor Author

alubbe commented May 7, 2026

I just watched a talk on an AI conference about 'clankers', so I wanted to make sure to leave a note that this PR was made by a real human with a real issue he's trying to solve, and I thought opening a PR is more useful than an issue because we can discuss both on whether this PR has merit but also see and discuss code changes.

For this PR specifically, my issue is that I'm migrating an application from using the CLI to using one central server and I'm missing support for carry_initial_prompt

fprintf(stderr, " -l LANG, --language LANG [%-7s] spoken language ('auto' for auto-detect)\n", params.language.c_str());
fprintf(stderr, " -dl, --detect-language [%-7s] exit after automatically detecting language\n", params.detect_language ? "true" : "false");
fprintf(stderr, " --prompt PROMPT [%-7s] initial prompt\n", params.prompt.c_str());
fprintf(stderr, " --carry-initial-prompt [%-7s] always prepend initial prompt\n", params.carry_initial_prompt ? "true" : "false");
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: The usage output is no longer aligned:

  -l LANG,   --language LANG     [en     ] spoken language ('auto' for auto-detect)
  -dl,       --detect-language   [false  ] exit after automatically detecting language
             --prompt PROMPT     [       ] initial prompt
             --carry-initial-prompt [false  ] always prepend initial prompt
  -m FNAME,  --model FNAME       [models/ggml-base.en.bin] model path

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.

Would you be okay with me adding whitespace to the other lines?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would you be okay with me adding whitespace to the other lines?

Yes that would be fine, thanks!

else if (arg == "-l" || arg == "--language") { params.language = argv[++i]; }
else if (arg == "-dl" || arg == "--detect-language") { params.detect_language = true; }
else if ( arg == "--prompt") { params.prompt = argv[++i]; }
else if ( arg == "--carry-initial-prompt") { params.carry_initial_prompt = true; }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: It would be nice to keep the if statement bodies aligned as before.

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.

Would you be okay with me adding whitespace to the other lines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants