Prompt Engineering

Definition

Prompt engineering is the practice of writing and testing the instructions you give a model so it reliably produces the output you want.

Key takeaways

  • A clear, specific prompt usually beats a clever one.
  • Give the model context, the task, the format you want, and any limits.
  • Examples in the prompt (Few-Shot Prompting) are one of the strongest tools you have.
  • Treat prompts like code: change one thing at a time and test on real inputs.
  • The same prompt can behave differently on different models, so test on the luv13 model you'll ship with.

The basics

Most good prompts cover four things:

  1. Context. Who is the audience? What does the model need to know?
  2. Task. What exactly should it do? Use a verb: summarize, classify, rewrite, extract.
  3. Format. How should the answer look? A list, a table, JSON, a single word?
  4. Limits. Length, tone, and what to do when it isn't sure.

Rules that apply to every turn belong in the System Prompts. The specific task goes in the user message.

Techniques worth knowing

Testing prompts

Keep a small set of real inputs, including hard and odd ones. Each time you change the prompt, run the whole set and compare. Settings like Temperature also change results, so keep them fixed while you test wording.

Example

curl https://api.luv13.ai/v1/chat/completions \
  -H "Authorization: Bearer $LUV13_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "luv13/glm-5.3-flash",
    "messages": [
      {"role": "system", "content": "You write release notes for developers. Be brief and concrete."},
      {"role": "user", "content": "Summarize this change as one bullet under 20 words: Added retry with exponential backoff to the upload client."}
    ]
  }'