microsoft / microsoft/BitNet

How to use this model on Windows with structured JSON output and persistent system instructions (like OpenAI Playground)

Open
#296 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
40.3k
Forks
3.7k
PR merge metrics
No merged PRs in 30d

Description

Hi team,

I'm trying to use this model locally on Windows with minimal system dependencies, ideally via llama.cpp. In OpenAI Playground, we can set a System Instruction and the model provides consistent structured JSON outputs based on user inputs, while also retaining short-term conversational context. I want to replicate this functionality locally.

What I'm trying to achieve:
I have a long system instruction (~78 lines) describing how to interpret user commands and convert them into a fixed structured JSON.

Example commands from the user:

"Turn on the task light"
"Switch the light to green"
"Set the desk height to 55"

The model should output a consistent structured JSON like:

json
{
"task": "RGB Color Control",
"action": "set_color",
"value": "green"
}

What I’ve tried:
I added the full system instruction into the prompt template in llama.cpp.
But the model often responds with just a plain message like "ok light turned on" instead of the required JSON.
Sometimes it even echoes the entire prompt/instruction back in the response, which is not expected.

Questions:
What’s the best practice to persist such a long system instruction across user prompts?
How can I force the model to respond only with a specific JSON schema every time?
Is there a way in llama.cpp to maintain short-term memory (like a few previous turns) to help with conversational context?

Any advice or example configurations to achieve this behavior with local inference (especially via llama.cpp) would be greatly appreciated.

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files, tests, or entry points are named. Start by reviewing the existing inference documentation and examples for Windows, prompt templates, structured output, and conversational context; done would require a clearly scoped, reproducible usage guide or configuration.

Written by the indexing model from the issue text.

Assessment

Domain
ai
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.