BroadRouter
Get started

Prompt engineering

Updated

Prompt engineering is the process of writing, structuring and testing the instructions given to a language model so that it consistently produces output that meets your requirements. It covers role messages, clear instructions, examples, formatting, and measuring results against test cases.

Also called: prompt design, prompting techniques

A prompt is a specification. Prompt engineering is writing it well and checking that the model follows it.

How it works

OpenAI’s guide defines prompt engineering as “the process of writing effective instructions for a model” so it “consistently generates content that meets your requirements.” The core techniques overlap across vendors:

Technique What to do
Roles Put rules in the system prompt (or developer message) and the request in the user message
Structure Order the system prompt as identity, instructions, examples, context; use Markdown headings and XML tags to mark sections
Examples Add a few input and output pairs (few-shot prompting) that cover different cases
Reasoning Ask for step-by-step thinking (chain of thought), or use a reasoning model
Output format Ask for a fixed format, or use structured output where the API supports it
Stability Pin a model version so behavior does not shift under you

Anthropic’s overview says to start with three things: clear success criteria, a way to test against them, and a first draft prompt. In practice that means an eval set.

A short example, before and after:

Before: Summarize this ticket.

After:  You summarize support tickets for an engineering team.
        Write 3 bullet points: the problem, the customer impact, the next step.
        Use the customer's words for error messages. Do not guess at causes.
        <ticket>...</ticket>

For agents, the prompt is one part of a larger context. Anthropic’s context engineering post separates prompt engineering, “methods for writing and organizing LLM instructions,” from context engineering, which manages everything else the model sees.

Why it matters

  • Quality without training. A better prompt is the cheapest fix to try, before fine-tuning or a bigger model.
  • Cost. The system prompt is resent on every request. Cut what does not change the output; see reducing prompt tokens.
  • Migration. A prompt tuned for one model may behave differently on another. Rerun your eval set when you switch.

On BroadNet Inference

BroadNet’s chat models take the standard Chat Completions messages list, so system, user and assistant roles and few-shot examples work as usual. You can try prompts in the playground before writing code. For Arabic output, Arabic prompt engineering covers register, dialect, numerals and right-to-left formatting.

Structured output is documented for GLM 5.3 and Qwen3.8 27B. On DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B, reasoning counts toward max_tokens, so a “think step by step” prompt also needs room in the budget.

Questions

Is prompt engineering still needed with newer models?

Yes, though the tricks change. Newer models follow plain, specific instructions well, so most of the work is stating requirements clearly, giving examples and testing against real inputs.

When should I fine-tune instead?

When a well-tested prompt with examples still fails on a large share of cases, or is too long to send on every request. Anthropic's docs also note that some goals, such as lower latency or cost, are easier to reach by choosing a different model.

Should I write prompts for Arabic output in Arabic?

Either can work. Say which register or dialect you want, and how to handle numerals and mixed text. The Arabic prompt engineering post compares both approaches.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity