Gemma 3 System Prompt: Write Instructions That Stick
A good gemma 3 system prompt is short, specific and placed in the system role, not buried in the first user message. This guide covers structure, examples and how to test what you wrote.
Updated

Key points
- Put stable rules in a system message; keep per-request data in user messages.
- State role, task, format and limits in that order, in plain sentences.
- Test prompts with a fixed seed and low temperature so changes are visible.
- A 1,000-token system prompt over 10,000 requests adds about $1.50 of input cost.
Where the system prompt goes
If you are searching for a gemma 3 system prompt, one detail first. The chat template published for Gemma models has historically had no dedicated system role; frameworks fold the system text into the first user turn. Check the model card of the exact variant you use. On this API you do not need that workaround. It is OpenAI-compatible, so you send a normal system message and the server handles the formatting for the model, which is uncensored. It is a different open-weight model, not Gemma, so prompt habits that carry over are the general ones.
from openai import OpenAI
client = OpenAI(base_url="https://api.gemmauncensored.cc/v1", api_key="YOUR_KEY")
resp = client.chat.completions.create(
model="uncensored",
messages=[
{"role": "system", "content": "You are a fiction editor. Reply in plain prose, under 150 words."},
{"role": "user", "content": "Tighten this paragraph: ..."},
],
temperature=0.4,
)
print(resp.choices[0].message.content)
Role definitions work best when they describe a job and not an identity. "You are a careful copy editor who changes as little as possible" gives the model a behaviour to follow. "You are the best writer in the world" gives it nothing to act on. The same holds for tone: name the reader ("explain to a junior developer") and the model will pick vocabulary to match.
Keep the system message for things that stay the same across a session: who the model is, what it does, how it formats. Put the changing material, such as a document or the user's question, in the user message.
A four-part structure that works
Most weak prompts fail because they mix everything into one paragraph. Split the instruction into four parts and write each as a short sentence or two.
- Role. One sentence on who the model is. "You are a copy editor for a mystery publisher."
- Task. What it does with the input. "Rewrite the paragraph for pace and keep the plot facts unchanged."
- Format. Exactly what the output looks like. "Return only the rewritten paragraph, no preface."
- Limits. What to avoid or when to stop. "If the input is not prose, reply with the single word SKIP."
A model follows a precise limit better than a vague tone request. "Be concise" is weak. "Use at most three sentences" is testable, and you can check it with code.
Examples of system prompts
A structured extractor
You extract data from support emails.
Return JSON with keys: product, problem, urgency (low, medium, high).
Use null for anything missing. Do not guess.
Output the JSON object and nothing else.
Pair this with JSON mode (response_format set to {"type":"json_object"}) so the reply parses every time.
A character for adult fiction
You are Mara, a sardonic ship's navigator in a space-opera story for adult readers.
Stay in character. Write in first person, present tense, 2 to 4 short paragraphs.
Do not speak for the user's character. Do not break the fourth wall.
This kind of prompt is where an uncensored model earns its place: dark themes, morally grey characters and violence in fiction are handled as story material instead of being cut off. The one hard rule is that nothing sexual involving minors is ever produced, and you should state it in your own app's rules too.
A strict assistant
Use this style when wrong answers cost more than missing ones, for example in documentation helpers.
You answer questions about our API only, using the notes the user provides.
If the notes do not contain the answer, say "Not in the notes."
Never invent endpoints or parameters.
Making rules stick over a long chat
Instructions drift. After 30 turns the model gives more weight to the recent text than to the first message. Three habits reduce the drift:
- Repeat the one rule that matters most. Add a short reminder at the end of the system prompt, or as a final system or user line before the latest question.
- Trim the history. The context window is 100,000 tokens for prompt plus completion, which is large, but long histories dilute the system prompt. Summarize old turns once they pass a size you choose.
- Use positive instructions. "Answer in two sentences" works better than "do not write long answers".
Another habit is to say what to do when the instruction cannot be followed. Without a fallback, the model improvises. A line such as "If the request is outside this task, say so in one sentence" gives you predictable behaviour and an easy case to test. The same applies to missing data: tell the model whether to ask a question, return null, or stop.
Examples inside the prompt also help more than adjectives. Two input-output pairs showing the exact format often fix problems that three paragraphs of rules do not. Keep the examples short and make sure they do not contain details you do not want copied into real answers.
Test changes one at a time
Keep a log of every version with the date and a one-line reason. Prompts are code, and without history you will not remember why a rule was added. Store them in version control next to the application, and review changes the way you review any other change that alters behaviour. When a user reports a bad answer, add that input to your test list so the same failure cannot return unnoticed.
Prompt edits feel like improvements until you run them on ten inputs. Use a small harness: a fixed list of inputs, a low temperature, and the seed parameter, which the API passes through. With the same seed, temperature and prompt, differences in output come mostly from your edit.
inputs = ["Tighten: The door was old and it creaked loudly.", "Tighten: He ran fast to the station."]
for text in inputs:
r = client.chat.completions.create(
model="uncensored",
messages=[{"role": "system", "content": SYSTEM}, {"role": "user", "content": text}],
temperature=0.2, seed=7, max_tokens=200,
)
print(repr(r.choices[0].message.content))
Change one thing per run: a word in the role, the format line, one example. Keep the old version next to the new one and compare outputs line by line. If you cannot tell which is better, the change did not matter, so keep the shorter prompt.
Common mistakes
- Writing a wall of text. A prompt of 40 rules is read less carefully than one of 8. Cut the rules that never fire.
- Contradictions. "Be brief" and "explain in detail" in the same prompt produce random behaviour. Read the prompt once as if you were the model.
- Putting data in the system role. If the document changes every request, it belongs in the user message. A fixed system prompt makes your tests repeatable.
- Forgetting the format. If code parses the reply, say so, and use JSON mode.
- Hiding user-facing rules. A system prompt is not a secret store. Do not put keys or private data in it.
What the system prompt costs
The system message is sent as input with every request, so it is billed every time at $0.15 per 1M input tokens. Take a 1,000-token system prompt and 10,000 requests: 1,000 x 10,000 = 10,000,000 tokens, which is 10 x $0.15 = $1.50. A 300-token version of the same prompt costs 3,000,000 tokens x $0.15 per 1M = $0.45. Shorter is cheaper, and usually clearer.
Output tokens are $0.50 per 1M, so a format rule that cuts replies from 500 to 250 tokens saves more than most input trimming. Failed or refused requests are not charged. See the pricing page for top-ups, and the docs for the full parameter list. When you are ready to test, the API key page gives new accounts a one-click $0.50 trial credit with no card.
More guides
- Gemma 4 Tool Calling With an OpenAI-Compatible API
- Gemma 3 vs Other Models: When Uncensored Fits
- Gemma 4 API: Pricing, Specs & Uncensored Guide
Frequently Asked Questions
Q: Is the Gemma 4 API compatible with OpenAI SDKs?
A: Yes, most uncensored Gemma APIs follow the OpenAI protocol, allowing you to use standard SDKs like the official OpenAI Python or Node.js libraries. You just need to update the base URL and API key.
Q: How do I get an API key?
A: You can sign up on the provider’s website, usually via Google or email. The API key is provided immediately after registration, ready for use in your applications.
Q: What happens if I exceed my token limit?
A: Your requests may be rate-limited or paused until your next billing cycle. Our prepaid model ensures you know your costs upfront, with no surprise charges.
Q: Can I run Gemma 4 locally?
A: Yes, since it’s an open-weight model, you can download the weights and run it on your own hardware, provided you have sufficient GPU memory. This offers full control over your data and inference.
Questions and answers
Does the model support a system role?
Yes. Send a message with role system, as with any OpenAI-compatible API. The server formats it for the model.
How long can a system prompt be?
The whole request, prompt plus completion, must fit in the 100,000-token context window. In practice, a few hundred tokens of clear rules work better than thousands.
Why does the model ignore my instruction?
Look for a conflicting rule, a vague wording, or a long history that buries the system message. Make the rule specific and repeat it near the end.
Is the system prompt used for training?
No. Prompts are not used for training.
Your key is one form away
Create an account, copy the key, change the base URL. That is the whole setup.
On this page
- Where the system prompt goes
- A four-part structure that works
- Examples of system prompts
- Making rules stick over a long chat
- Test changes one at a time
- Common mistakes
- What the system prompt costs
- More guides
Start with trial credit
Email and password, key on screen right away.