Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] how to change system_message at runtime #3086

Open
phgcha opened this issue Jan 9, 2025 · 2 comments
Open

[Question] how to change system_message at runtime #3086

phgcha opened this issue Jan 9, 2025 · 2 comments
Labels
question Question about the usage

Comments

@phgcha
Copy link

phgcha commented Jan 9, 2025

❓ General Questions

Hi,
I can't seem to find a way to update system_message at runtime. I've read this doc. I've tried modifying the mlc-chat-config.json before making the completion call but it doesn't seem like the effect is taking place.

I know I can add a message {"role": "system", "content": system_prompt} in messages but it adds additional tokens to the prompt.

Please shed some light!

@phgcha phgcha added the question Question about the usage label Jan 9, 2025
@phgcha
Copy link
Author

phgcha commented Jan 9, 2025

Is it a good idea to make the system_message in mlc-chat-config.json empty and add {"role": "system", "content": system_prompt} however I need?

@Mawriyo
Copy link

Mawriyo commented Jan 9, 2025

When you say

"I've tried modifying the mlc-chat-config.json before making the completion call but it doesn't seem like the effect is taking place."

  • Have you re-packaged/recompiling the project?

"I know I can add a message {"role": "system", "content": system_prompt} in messages but it adds additional tokens to the prompt."

  • My understanding is that additional tokens should only happen for the first run. If you tried sending another message, that system prompt should persist from my experience.

I shall preface that I work on the android side so our process may be different. I apologize if this is not helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question about the usage
Projects
None yet
Development

No branches or pull requests

2 participants